diff options
Diffstat (limited to 'others/vm3/compute/create.sh')
| -rwxr-xr-x | others/vm3/compute/create.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/others/vm3/compute/create.sh b/others/vm3/compute/create.sh index 6d83a03..649cd86 100755 --- a/others/vm3/compute/create.sh +++ b/others/vm3/compute/create.sh @@ -14,6 +14,9 @@ disk_gb=$5 if [ $# -ne 5 ]; then echo "Usage: $0 <vm-name> <os> <vcpu> <ram(gb)> <disk(gb)>" echo "seed.iso and image file have to be present!" + echo "" + echo "Available images" + sudo ls /var/lib/libvirt/images/.image_store exit 1 fi @@ -41,20 +44,20 @@ fi sudo virt-install --name $vmname \ --vcpus $vcpu \ --memory "$((ram_gb * 1024))"\ - --disk path=$new_vm_path,size=$disk_gb,format=qcow2 \ + --disk path=$new_vm,format=qcow2 \ --disk path=$seed_iso,device=cdrom \ --os-type linux \ --os-variant $os \ --virt-type kvm \ --graphics none \ --network bridge=virbr0,model=virtio \ - --print-xml > $xml || { echo "Failed to print XML."; exit 1; } + --print-xml > $xml #|| { echo "Failed to print XML."; exit 1; } -sudo virsh define $xml &> /dev/null || { echo "Failed to define the new VM."; exit 1; } +sudo virsh define $xml #&> /dev/null || { echo "Failed to define the new VM."; exit 1; } sudo qemu-img resize $new_vm +$disk_gb"G" #&> /dev/null sudo virsh start $vmname -sudo rm "${workingdir}"/* +#sudo rm "${workingdir}"/* |
