diff --git a/qmcreate.sh b/qmcreate.sh index f8619b1..0890132 100644 --- a/qmcreate.sh +++ b/qmcreate.sh @@ -1,11 +1,19 @@ #!/bin/bash while read $line do + echo $line ip=$(echo $line | cut -d ' ' -f 1) echo "IP address: $ip" hostname=$(echo $line | cut -d ' ' -f 2) - echo "IHostname: $hostname" + echo "Hostname: $hostname" vmnum=35$(echo $ip | cut -d '.' -f 4) echo "VM number: $vmnum" - qm clone 5000 $vmnum + qm clone 5000 $vmnum --name $hostname --full + if [ $? -eq 0 ] + then echo "clone OK" + else "clone ERROR" + fi + qm set $vmnum --tags 3,gfx + qm set $vmnum --cicustom "user=local:snippets/user${vmnum}.yaml," + qm resize $vmnum scsi0 +50G done < ./hosts \ No newline at end of file