How to Boot Paravirtual Xen DomU to CD-ROM or ISO in SLES 10 SP1 or OpenSUSE 10.3
We needed to boot from a CD-ROM to perform maintenance to a paravirtualized DomU.
We were unable to find any info googling. It appears you cannot boot a Paravirtualized DomU directly to CD-ROM? So we temporarily changed our Paravirtual Xen DomU to boot from HVM or Full Virtual Machine.
Our environment has Xen running on HVM capable hardware (we can run Full Virtualization) with LVM Block devices for disks.
Our Paravirtual DomU is called guest-1
First backup your Running Xen config.
Save it to /etc/xen/vm/guest-1.run
xm list -l guest-1 >/etc/xen/vm/guest-1.run
You will use this file later on.
Novell’s documentation on how to save Running Xen DomU config.
Look for “Virtual Machine Settings”.
I found it easier to modify the startup config in /etc/xen/vm/guest-1 than modify the file that is outputted from the Novell Running config backup.
Backup the original Startup config (I believe this file gets created when you first build a new VM in virt-manager.)
/etc/xen/vm/#cp guest-1 guest-1.stp
Open your DomU (guest-1) config.
/etc/xen/vm/# vi guest-1
example below some things are xxx out.:
name=”guest-1” ostype=opensuse” uuid=”xxxxxx” memory=”1024 vcpus=1 on_crash=”destroy” on_poweroff=”destroy” on_reboot=”restart” localtime=0 builder=”linux” bootloader=”/usr/lib/xen/boot/domUloader.py” bootargs=”--entry=xvda1:/boot/vmlinuz-xen,/boot/initrd-xen” extra=” “ disk=[ ‘phy:/dev/array1/guest-1,xvda,w’ , ‘phy:/dev/hda,xvdb:cdrom,r’ , ] vif=[ ‘mac=xxxx’, ] vfb=[ ‘type=vnc,vncunused=1’]
Modify the file.
Items with semi-colon we deleted
name=”guest-1” ostype=opensuse” uuid=”xxxxxx” memory=”1024 vcpus=1 on_crash=”destroy” on_poweroff=”destroy” on_reboot=”restart” localtime=0 builder=”hvm” device_model=”/usr/lib/xen/bin/qemu-dm” kernel=”/usr/lib/xen/boot/hvmloader” boot=”d” ;bootloader=”/usr/lib/xen/boot/domUloader.py” ;bootargs=”--entry=xvda1:/boot/vmlinuz-xen,/boot/initrd-xen” ;extra=” “ disk=[ ‘phy:/dev/array1/guest-1,hda,w’ , ‘file:/usr/local/src/systemrescue-x86.iso,hdc:cdrom,r’ , ] vif=[ ‘mac=xxxx’, ] vfb=[ ‘type=vnc,vncunused=1’] apci=0 acpi=1 pae=1 <usb=1 usbdevice=’tablet’ serial=”pty”
In order to for Xen to read the modified config you need to undefine the guest-1 DomU.
We just delete it. That works. 🙂
xm delete guest-1 (remember earlier we backedup the running config)
Before starting your modified DomU make sure you have a valid boot file path or cdrom disk inserted.
Start your modified DomU
xm create guest-1
Now in the virt-manager graphical console you can see that it is booting to cdrom and loading system rescue.
Once you are finished with your work, you can shutdown the guest.
Then undefine it. (aka delete)
Rename the modified guest-1 file to guest-1.cdrom
Next rename or copy your original Running config back to guest-1.
/etc/xen/vm/#cp guest-1.run guest-1
Then start your original running VM.
xm create guest-1
In the virt-manager you can now see your guest-1 booting.
You need to run:
xm new guest-1
This will load the VM config back into virt-manager. Otherwise when you shutdown the VM it disappears out of virt-manager.
Hope someone finds this useful.