Update vmcreate.sh

This commit is contained in:
2025-10-28 12:51:43 +00:00
parent 113549d1c2
commit bbef84299e

View File

@@ -6,20 +6,16 @@
# ИЗУЧИТЬ!!!! /usr/share/pve-docs/examples/guest-example-hookscript.pl # ИЗУЧИТЬ!!!! /usr/share/pve-docs/examples/guest-example-hookscript.pl
storage="syno-tigra" storage="syno-tigra"
#path="/mnt/pve/$storage/snippets" path="/mnt/pve/$storage/snippets"
path="./snippets/" #SEE BELOW!!!
mkdir $path #REMOVE AFTER CORRECT PATH!!!!!!!!
node=3 node=3
size=50 size=50
# Далее объявляю переменные, в цикле getopts это не получается
harule="" harule=""
pubkey="" pubkey=""
username="" username=""
password="" password=""
tag="" tag=""
file="" file=""
# Конец костыля
show_help () { show_help () {
echo echo
@@ -280,7 +276,6 @@ do
echo "TAG: $tag" echo "TAG: $tag"
echo "$snippet:" echo "$snippet:"
cat "$snippet" cat "$snippet"
exit 100
#### ####
echo -n "Now cloning VM $vmnum from a template....." echo -n "Now cloning VM $vmnum from a template....."
qm clone 5000 $vmid --name $hostname --full > /dev/null qm clone 5000 $vmid --name $hostname --full > /dev/null
@@ -299,7 +294,6 @@ do
### DEBUG ### DEBUG
echo "DEBUG: ${vmid}.conf" echo "DEBUG: ${vmid}.conf"
cat /etc/pve/qemu-server/${vmid}.conf cat /etc/pve/qemu-server/${vmid}.conf
exit 102
### ###
# # Migrate VM to target node # # Migrate VM to target node
# echo -n "Migrating VM $vmid to pve${node}....." # echo -n "Migrating VM $vmid to pve${node}....."