Elcapitan VM fix

- forgot to change VM name
- also some code quality fixes in virt-install-all.sh
This commit is contained in:
Peter Šurda 2021-02-11 11:09:24 +01:00
parent 7def0b1d46
commit 28d722e9c9
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -13,7 +13,7 @@ trusty()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n trusty_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n trusty_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/trusty_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -39,7 +39,7 @@ xenial()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n xenial_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n xenial_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/xenial_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -65,7 +65,7 @@ bionic()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n bionic_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n bionic_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/bionic_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -91,7 +91,7 @@ focal()
xml=$(mktemp) xml=$(mktemp)
virt-install -r $mempercore --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \
-n focal_libvirt_"${hostname}_${id}" -w network=default --nographics \ -n focal_libvirt_"${hostname}_${id}" -w network=default --nographics \
--disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".qcow2 \ --disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".qcow2 \
--disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".iso,device=cdrom \ --disk path=/var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".iso,device=cdrom \
@ -111,7 +111,7 @@ elcapitan()
local cores local cores
id="$1" id="$1"
virsh undefine elcapitan_"${hostname}_${id}" virsh undefine elcapitan_libvirt_"${hostname}_${id}"
xml=$(mktemp) xml=$(mktemp)
@ -127,10 +127,10 @@ elcapitan()
/var/lib/libvirt/ephemeral/enoch_rev2839_boot /var/lib/libvirt/ephemeral/enoch_rev2839_boot
sed -Ei " sed -Ei "
s#<name>.*<#<name>elcapitan_${hostname}_${id}<#; s#<name>.*<#<name>elcapitan_libvirt_${hostname}_${id}<#;
s#<vcpu (.*)>[0-9]+#<vcpu \\1>$threads#; s#<vcpu (.*)>[0-9]+#<vcpu \\1>$threads#;
s#<topology (.*)cores='[0-9]+'#<topology \\1cores='$cores'#; s#<topology (.*)cores='[0-9]+'#<topology \\1cores='$cores'#;
s#<source file='(.*\\.qcow2)'#<source file='/var/lib/libvirt/ephemeral/elcapitan_${hostname}_${id}.qcow2'#; s#<source file='(.*\\.qcow2)'#<source file='/var/lib/libvirt/ephemeral/elcapitan_libvirt_${hostname}_${id}.qcow2'#;
" "$xml" " "$xml"
virsh define "$xml" virsh define "$xml"