In Citrix XenServer, there is a module that allows you to do physical-to-virtual conversions (P2V). This module works for supported operating systems (OSes) only, and currently supported are Red Hat Enterprise Linux 4 and SUSE Linux Enterprise Server 9 sp2 and later. P2V techology available in XenServer is limited, but if you have a physical server running one of the supported OSes, it is useful anyway.
Why is XenServer's P2V support so limited? The installation you run on your physical machine uses its own "physical machine kernel." To use it in a Xen environment, this kernel must be replaced by a paravirtualized kernel. Because you can't just put any kernel on an operating system, the list of supported operating systems is limited. XenServer provides these kernels for supported OSes only. XenServer by itself does not support P2V for Windows servers. If you want to do that, you need one of the third-party tools that is available for this purpose.
Before you start, there are two conditions to meet, aside from the requirement that your OS is supported. First is that you must have access to the XenServer. Normally there isn't a reason to switch it off anyway, but just make sure that it is up and you can reach it. The second condition is that you have the XenServer installation CD available.
Basically, if you are doing P2V on 64-bit Linux, it should work fine. In case you are using 32-bit hardware or software and the P2V conversion fails, you need to take a different approach to the P2V conversion. In that case, on the very first screen you see when booting from the XenServer installation CD, press F2 for advanced options. Next, type p2v-legacy. This starts a special P2V program with support for 32 bits. The procedure below describes how to do a P2V conversion of a supported server operating system.
- Put the XenServer installation CD in the optical drive of the physical server you want to convert and reboot your server. Make sure that it boots from the CD when starting again.
- After selecting the keyboard layout, from the Welcome to XenServer menu, select Convert an existing OS on this machine to a VM (P2V). When the installer tells you that this option will copy a locally installed operating system into a VM running on a XenServer Host, press OK.
- In order to write the virtual image file to XenServer, the machine on which you want to do P2V needs to communicate to XenServer, so it needs network configuration. This network configuration is only needed to do the P2V conversion, so there is nothing wrong if you temporarily use a DHCP-assigned IP address.
- Enter the name or IP address of the XenServer host you want to access and provide a username and password to authenticate to the XenServer.
- Based on the storage that is configured on this server, you now need to specify where you want to store the image file. Select one of the available storage options, such as Local storage on XenServer.
- If your operating system is not supported, you'll see an error message now. If this is the case, just abort, because there is no way you can do P2V on a non-supported operating system. If a supported OS was found on the server on which you are running the P2V program, you will see it now with the question "Which OS installation do you want to P2V?" Select the operating system of which you want to create a virtual machine and press Enter to proceed.
- Now enter the size of the volume that will be created on the XenServer host for this machine. By default, a size of 150% the existing disk size will be created. If you don't like the installer's suggestion, change the size and press Enter to continue. Next, select Start Transfer, and in the meantime, have a cup of coffee. Depening on the size of the physical machine, it will take a while before the P2V process is complete.
- When it finishes, you will see a message indicating whether the conversion was succesful. If this is the case, you can now start XenCenter and connect to your XenServer host. The machine you just converted has been added in the overview of managed servers, mentioning the DNS name of the machine. By default it has the status of Halted. You can start it to find out if it works properly.
After a succesful conversion, you will see the virtual machine listed in XenCenter.
On the XenServer installation CD, you'll find a simple tool that does the conversion for you. However, if you need to do P2V on a non-supported operating system, you'll still need external utilities, such as Platespin PowerConverter.
ABOUT THE AUTHOR: Sander van Vugt is an author and independent technical trainer, specializing in Linux since 1994. Vugt is also a technical consultant for high-availability (HA) clustering and performance optimization as well as an expert on SUSE Linux Enterprise Desktop 10 (SLED 10) administration.
Dig deeper on P2V, V2V and V2P migration