From e94b275f5630e032a6971831f8be520ae81a5d02 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 21 Dec 2024 16:45:32 +0800 Subject: v1vm3-done --- others/vm3/compute/create.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'others/vm3/compute/create.sh') 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 " 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}"/* -- cgit v1.2.3-70-g09d2