Home > Server Virtualization Tips > Virtualization strategies > Open source Xen provides cost-effective P2V conversions
Server Virtualization Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

VIRTUALIZATION STRATEGIES

Open source Xen provides cost-effective P2V conversions


Sander van Vugt, Contributor
10.13.2009
Rating: --- (out of 5)


Server virtualization technical tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


The benefits of virtualization – including reducing hardware and power costs, minimizing data center footprint and greater data center flexibility -- are well documented. Nevertheless, the startup costs for propriety virtualization software can be high. But these costs can be mitigated by performing physical-to-virtual (P2V) conversions with open source Xen.

The basic principles of P2V conversions are easy to understand. First, you need to turn the contents of your physical machine into an image file. Once you do so, you need to be able to boot from that image file. To accomplish this, make sure that you use the correct kernel. If this sounds daunting, this article will walk you through the basics.

From physical machine to image file
First, write your physical server's contents to an image file. I prefer the one-to-one approach: one image file for each disk. If, for example, the server you want to convert has four disks, you need to repeat this procedure four times.

Rebooting the server from a Linux live system is the easiest way to clone the contents of your physical disk to an image file. You can use your distribution's installation disk or use another live system, like Knoppix. After booting your server from the live disk, find the name of the disk that you want to clone. In most cases, fdisk -l provides that information. And typically, a Linux hard disk uses a device file, such as /dev/sda.

After determining the name of your physical disk, you need to create the storage device where you want to keep the image file. Attaching an external hard drive is an easy way of doing this. Once attached, mount it somewhere in the current file system in order to write the image file to this location. Let's assume it's mounted on the /mnt directory.

Now that the preparations are complete, it's time to clone the disks. To do so, use the dd command. Then, use the following command to write the entire /dev/sda contents to a f...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google





ile with the name sda.img in the /mnt directory:

dd if=/dev/sda of=/mnt/sda.img bs=4096

This step can be time-consuming. It's not uncommon for a 300 GB disk, for example, to take several hours. Do something else and return to the task at the end of the day.

Including the disk image file into your Xen configuration
After creating the image file, you must include it in your Xen configuration. Using the import wizard in the virt-manager application is the easiest way. In the Virtual Machine Manager main interface, click New to create a virtual machine. Next, click Forward, and from the Create a Virtual Machine window, select I have a disk or disk image with an installed operating system.

[IMAGE]
Figure 1
Select I have a disk or disk image with an installed operating system.(Click image for enlarged view.)

After selecting the operating system that's on the physical server, Virtual Machine Manager will show the summary screen. In this screen, find the disk file that you previously cloned. Then select the appropriate kernel. This last step is crucial: By default, a paravirtualization kernel is selected on some operating systems . On a machine that you have just cloned with P2V, there will be no paravirtual kernel installed by default, so make sure to select Full Virtualization as the virtualization type and you'll be able to start the converted virtual machine in Xen.

About the expert
Sander van Vugt is an independent trainer and consultant based in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command Line, Beginning Ubuntu Server Administration and Pro Ubuntu Server Administration.


Rate this Tip
To rate tips, you must be a member of SearchServerVirtualization.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Search More Tips on Virtual Implementation
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersEvents
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2006 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts