Baremetal Restore of Xen Servers
Baremetal restore of Xen servers may fail at times if you are performing the disk creation manually. At times it may work, but most of the times this will give an issue. This is because, Xenservers requires something called its metadata backup to restore the server properly. We can perform the metadata backup on a domain host, but the same backup will not work on another Xenserver host. Due to this reason, it is imperative that we need to have a method to backup Xenserver metadata. The Xackup utility provided by Fungusware is used to backup every Xenserver VMs every two to three days and we can use it when we require a baremetal restoration using R1Soft. We don't use Xackup to store backups daily and to do baremetal restore due to the following reasons:
- It is extremely slow to take backup on Xackup. So, daily backup is not possible.
- Space issue on the Xackup server.
- It is extremely slow to restore.
- Per-file and database backups can be difficult to extract and then to restore if we are on a tight schedule.
Due to the above reason, we can do the below when baremetal restore Xen VMs are required.
- Perform a restore of the VM to any of the Xenserver host you want using Xackup (make sure that it goes through local network by confguring the local IP of the Xenserver host when doing restore).
- Before it gets completed, go to Xencenter and you can see that this new restore looks like a template while the restore is running. Right click it and select New VM Wizard.[Image: ns3.jpg]
- Create a new VM without starting it.[Image: ns3_1.jpg]
- Now, once the VM is created, you will see a template and this new VM listed.[Image: ns3_2.jpg]
- You can now abort the Xackup restore.[Image: ns3_3.jpg]
- Insert the R1Soft baremetal restore ISO on the new VM that is created and start it in recovery mode to boot from ISO. (VM > Start/Shut down > Start in recovery Mode)
- Once the ISO is booted, follow the usual step to perform a baremetal restore of R1Soft:
# system-config-networkThen select Device Configuration. > eth0
- Enter a static IP and go to R1Soft and perform the baremetal restore to this IP by following R1Soft articles.
- Once the baremetal restore is complete, you will be able to boot the VM normally.
Note: You will not require to change the mode of the VM between Paravirtualised (PV) and Hardware Virtual Machine (HVM) if going through the above method. But in case you need to restore the VM directly without any Xackup backups, you may need to perform the below to get the VM booting:
http:wiki.r1soft.com/display/kb3/BMR+of+a+Citrix+Xen+6.0+paravirtualized+VM
Usually, you will only require to execute:
For HVM to PV conversion:
xe vm-param-set uuid=[vm uuid] HVM-boot-policy=
xe vm-param-set uuid=[vm uuid] PV-bootloader=pygrub
For PV to HVM conversion:
xe vm-param-set uuid=[vm uuid] HVM-boot-policy="BIOS Order"
xe vm-param-set uuid=[vm uuid] PV-bootloader=
This is equally applicable to Xen 7 VMs too. For CentOS 6, it should be PV mode. For CentOS 7, it should be HVM mode. You may need to check the Xenserver provided templates or Google to see what is the preferred mode for other Operating Systems.