View Source

h2. {color:#ff6600}BMR of a Citrix Xen 6.0 paravirtualized VM{color}


h2. Issue
----
A bare-metal-restore from a recovery point of a Citrix Xen paravirtualized VM is successful, but the restored machine does not boot properly or does not run in a paravirtualized mode.


{code}
Output from a HVM machine Output from a PV machine

# ps ax | grep xen Instead of: # ps ax | grep xen
8419 tty1 S+ 0:00 grep xen 24 ? S 0:00 [xenwatch]
25 ? S 0:00 [xenbus]
8419 hvc0 S+ 0:00 grep xen


# mount # mount
/dev/sda1 on / type ext3 Instead of: /dev/xvda1 on / type ext3

{code}


h2. Solution
----
The machine that was created or used for booting the R1Soft Recovery ISO was running in a HVM (hardware-based virtual machine).

The xvdaX type partitions from the original PV (paravirtualized machine) were restored to the available sdaX type partitions discovered by the R1Soft Recovery environment.

Converting the restored machine from an HVM to a PV will resolve the issue.




h2. Performing the successful bare-metal-restore
----
These instructions demonstrate using an "alternate host" as the target of your bare-metal-restore.



The R1Soft Recovery disk ISO image can be added to XenCenter by burning it to physical media, or placing the ISO on an NFS share accessible as an "NFS ISO Library".



1. Review the details of your restore in the CDPServer Recovery Point, noting under "Recovery Point Details" the sizes of the devices and partitions used in the PV machine.

2. Enter your XenCenter application, and choose "New VM"


3. Select the template "Other install media", create a VM Name, select "r1soft-cdp-bootcd-agent-3.18.2.iso" in the virtual drive as the installation method, choose the VM home server, CPUs, memory, create a new virtual disk of proper size, and select a network.

4. When booting of the R1Soft Recovery environment is complete, run "ifconfig" at the prompt, and note its IP address.



5. Complete the necessary steps to bare-metal-restore to an "Alternate Host Name/IP", and restore the source "xvdX" partition tables and devices to the matching target "sdX" tables and devices discovered by the R1Soft Recovery environment.



h2. *Converting the successfully bare metal restored machine back into a paravirtualized VM:*
----
Editing of the virtual machine record will convert the restored machine from HVM to PV mode.

In this example the virtual machine is named “Ubuntu 10.04 x64”



After the successful bare-metal-restore, proceed with the following steps:


{code}
From the console of the XenServer host (dom0), use the following xe commands:

#1. Retrieve the UUID of the virtual machine: Cut & paste for further usage.
xe vm-list name-label="Ubuntu 10.04 x64" params=uuid

#2. Clear the HVM boot mode:
xe vm-param-set uuid=[vm uuid] HVM-boot-policy=

#3. Set pygrub as the boot loader:
xe vm-param-set uuid=[vm uuid] PV-bootloader=pygrub

#4. Set the display arguments:
xe vm-param-set uuid=[vm uuid] PV-args="console=hvc0 xencons=hvc"
(Other possible options are: "console=tty0" or "console=hvc0")

#5. Find the UUID of the interface of the VBD virtual disk:
xe vm-disk-list uuid=[vm uuid]

#6. Set the disk device as bootable:
xe vbd-param-set uuid=[vbd uuid] bootable=true
{code}


Reboot the VM.  ( Restarting the XenCenter GUI is also recommended, \[by Citrix\] as the consoles may have changed.)

Remove any isos from the virtual cdrom device, so that there is no competition for boot devices.



You may need to change the various options for the consoles that are shown, to match your intended console needs.

Run the commands "mount" and "ps ax \|grep xen" as shown above, to verify that the restored machine is now running in a paravirtualized mode.

----
Note: Typical HVM to PV conversions may require other steps, including creating hvc console .conf files, adding xen-kernels, editing pygrub to point to proper root and initrd paths, adding xen_blkfront to the initrd, and adding xen-tools.

Steps for these procedures can be found in the links shown below.





h2. Various sources regarding converting HVM to paravirtualized, and installing XenTools:

[http://blog.403labs.com/post/1546501840/paravirtulization-with-citrix-xenserver-5-5-and-ubuntu]








































[http://support.citrix.com/article/CTX121875]





















































































[http://www.cetic.be/Paravirtualize-an-Ubuntu-VM-using]











































[http://www.jansipke.nl/installing-xenserver-tools-on-ubuntu-10-04]


[http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/guest.html]










































{kb-related-articles}