From b420683c7013dd681a19dcf42a3c4a7df60ff256 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 16 Jan 2014 21:49:49 -0600 Subject: [PATCH] create-vmachine: Create libvirt domain earlier in the process By moving the domain definition task earlier in the provisioning process, it allows the administrator the option of opening the virtual console in preparation for the virtual machine's first boot. This may be necessary if, for example, the boot needs to be closely monitored, as there may not be enough time to launch the console before the machine starts. --- create-vmachine.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/create-vmachine.sh b/create-vmachine.sh index af3de63..bd51a50 100755 --- a/create-vmachine.sh +++ b/create-vmachine.sh @@ -140,11 +140,12 @@ sed -i 's/#s0/s0/' "${MOUNTPOINT}"/etc/inittab trap - INT TERM EXIT +echo "Creating libvirt domain..." +virsh -c qemu:///system define <(m4 -P -DNAME="${DOMNAME}" "${DOMXML_TMPL}") + echo "Cleaning up..." umount "${MOUNTPOINT}"/{run,usr,var,home,} vgchange -an ${VMNAME} -echo "Creating libvirt domain..." -virsh -c qemu:///system define <(m4 -P -DNAME="${DOMNAME}" "${DOMXML_TMPL}") echo "Starting virtual machine..." virsh -c qemu:///system start ${DOMNAME}