Today I’ll discuss P2V and V2V of operating systems. Well P2V and V2V, are terms that refer to system migration. And migration (since before Christ – 40 years of migration of the Hebrews to Canaan rs) is a painful process and sometimes costly (of time and physical resources).
P2V (Physical to Virtual): is used when you want to turn a physical-to-virtual machine (migration of a PC or notebook for a VIRTUALIZER – ex. Xenserver);
V2V (Virtual to Virtual): is used when you want to turn a virtual machine to another virtual (usually when you’re migrating Vms between different Virtualizers – ex. Vmware -> Xenserver)
Well, in my tutorials I always like to explain the “State of the art” or the “Foundation” for constructing of their own knowledge through accurate and detailed information of studied point. In my head, only a how-to step-by-step, without the whys, becomes merely a “shut up and follow me”. That’s why, in almost all the tutorials I made, when I get in the “hands-on” I post links with the procedures. If you can raise questions about what you want to do and plan for such solutions, until a robot do the step by step.
I guarantee you that if you always follow this principle, your life will change, because the whys will become increasingly frequent. Remember that.
Well, coming back, without further delays, I will present (in steps) how occurs the process of migrating of a physical or virtual machine to a VM on Xenserver 7.0. These procedures are generic. The software used to carry out operations can be severals. At the end, I will put tutorials for you follow which mentioning useful tools for carrying out the procedures.
- Create an image of the hard disk of the machine;
1.1. In this step, it usually starts a cd/usb of boot of some backup program (clonezilla, G4L, etc) on the machine and it’s copied the entire hard disk, creating an image at the end of the process. This image should be kept.
- Create a VM with the same features of CPU, RAM memory, hard disk and OS (if you have template for it in the list of templates from XenServer – otherwise using the template other media install).
2.1. This step is pretty simple, just don’t install any OS in VM. Just create it and leave it there off.
- Start the VM for cd/usb of boot from the same program that backed up from the source machine and restore that image on new disk that you just created to the VM.
3.1. When the restore process is complete, usually occurs the VM cannot start yet, because information of initrd/grub (if the machine is GNU/Linux) are still pointing to the old kernel.
If the VM in question is not the GNU/Linux, then skip to step 5.
- Update initrd image, grub and paths of the disks in/etc/fstab
4.1. In this step, basically, you will have to mount all directories from the VM in chroot from a livecd/usb Linux and then create a new image for the initrd.
- After that, you will have a functional VM inside your Xenserver virtualization environment.
Only these 5 steps are required for migration P2V or V2V Windows/GNU/Linux where the destination is the Xenserver 7.0
Additional steps are necessary for the optimization of VM, like the conversion of same of HVM for PV (modes of virtualization – if you don’t know what is this click here) and the installation of the xentools (xen drivers for Network/disc – if you don’t know what it is click here)
Well, like I said, these are the generic steps to climb a VM on a Xenserver virtualization environment where the source was a VM from other virtualization system or a physical machine.
The following PDF, originated from a colleague (Germano Dias) of the institution where I work (Federal University of Ceará) will support the practical part of all information that I passed in this stream. In this is used Clonezilla software (GPL) for backup and restore of disks.
Download here the PDF.
Other tutorials can serve as a complement or alternative to this procedure:
Tutorial using the dd command: http://www.lewan.com/blog/2011/04/14/p2v-conversion-of-linux-virtual-machine-for-xenserver
Another tutorial using the clonezilla: http://www.ibm.com/developerworks/br/library/l-clonezilla/
You can also use G4L Ghost 4 Linux program for disk backup (as an alternative to the clonezilla) and that comes in the package Hiren’s bootCD 15.2: http://www.hiren.info/pages/bootcd
Well, I hope you enjoyed and until the next! Questions and suggestions are welcome! Hugs!
References:
http://www.ushistory.org/civ/4g.asp
http://www.ibm.com/developerworks/br/library/l-clonezilla/
http://www.lewan.com/blog/2011/04/14/p2v-conversion-of-linux-virtual-machine-for-xenserver
http://www.ppgia.pucpr.br/~jamhour/RSS/TCCRSS08A/Diego%20Lima%20Santos%20-%20Artigo.pdf
http://www.hiren.info/pages/bootcd
http://ports.marllus.com/wp-content/uploads/2016/02/GNU-Linux-P2V-e-V2V-para-XenServer-6.5.pdf
http://ports.marllus.com/2016/02/12/o-xenserver-tools-xenserver-6-5
This work Marllus, is licensed with a license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).