Total Pageviews

Monday, December 27, 2010

V2V Migrating from Vmware/XEN/Libvirt KVM to RHEV

V2V : Virtual machine conversion  Migrating from Vmware/XEN/Libvirt KVM to RHEV

What is V2V ?

V2V is a tool designed to automate the conversion of VMware or Xen virtual machine images into an OVF file for use within Red Hat Enterprise Virtualization .

From RHEV 2.2 , V2V incorporated into the Red Hat Enterprise Virtualization  and it will allow you to  take Red Hat Enterprise Linux 3, 4 or 5 virtual machines created in VMware or Xen environments and automatically convert them into Red Hat Enterprise Virtualization virtual machines.  Latest Version of V2V support conversion of Windows XP, Windows 2003 and Windows 2008 virtual machines images running on Vmware to RHEV .

Steps

 Download and install (upgrade if already RHEV2.1 is installed )  RHEVM 2.2 from the RHN

Download the Latest RHEV tools setup iso of RHEV2.2 from RHN  and place it in your nfs iso library.

Once your Data Center is up on running  then attach and activate   the nfs export disk to the data center where you want to migrate the xen/kvm Virtual Machines to this nfs export disk.

Now log into the RHEL 5.4  KVM Host (steps are same for xen host else i mentioned explicitly) , Subscribe it to  Red Hat Enterprise Virt V2V Tool Child Channel  on RHN  and install the latest virt-v2v from the RHN.

yum  install virt-v2v libguestfs

Once you installed you will find  RHEL4 and RHEL5  kernel rpms for replacing Xen PV kernels. under /var/lib/virt-v2v/.

Then copy the /usr/share/doc/virt-v2v-0.4.10/virt-v2v.conf file to your  desired location and edit as per your requirement.(see below note before edit this file)

cp /usr/share/doc/virt-v2v-0.4.10/virt-v2v.conf /home/paps/rhev/virt-v2v.conf

Note: If you're never going to convert a Xen PV guest, you could actually comment out all the <app> sections

Now Stop the Virtual machine you want to Migrate Using VIrt-Manager or using virsh command line , then run the below command to dump the xml content of virtual machine. (only for kvm guest)

 virsh dumpxml guestname

virsh dumpxml  kvm-libivirt-v2v-guest1

<Output Truncated>

<domain type='kvm'>
  <name>kvm-libivirt-v2v-guest1</name>
  <uuid>38ce5240-9b46-5c4c-ce15-3cedde2a6e0b</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
   .
   .
   .
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

<Output Truncated>


For Xen guest you have to dump the xml file of the guest and  redirected to your prefered loaction.



virsh dumpxml rhelxen > /home/paps/rhev/ rhelxen.xml

Finally the time to start the migration of kvm/xen based guests on to RHEV.

Libvirt KVM Guest Migration

Syntax:

virt-v2v -f virt-v2v-config-file-location -o rhev -osd  nfsserverip:/nfsexportdisk guestname

Eg:

virt-v2v -f /home/paps/virt-v2v.conf  -o rhev -osd  rhevnfsstorage1:/rhev-import-disk1  kvm-libivirt-v2v-guest1

 Xen Guest Migration

Syntax:

virt-v2v -f  virt-v2v-config-file-location -i inputmethod -o rhev -osd   nfsserverip:/nfsexportdisk  <domain>.xml


Eg:

virt-v2v -f /home/paps/virt-v2v.conf -i libvirtxml -o rhev -osd rhev-storage:/rhev-export-disk1   /home/paps/rhev/ rhelxen.xml



Depends upon the Virtual Machine size and the Storage it will take some time  to  migrate the vm and its ovf file to the export storage domain

After the successful completion of v2v , Log into RHEV Manager, Go to Storage-->Select the Export Disk-->Click on VM Import Tab on the Bottom Pane  you will  find the new Virtual Machine which  migrated from your kvm/xen guest.

Select the VM and Import it to the desired Storage disk on the particular Data Center.

Vmware Guest Migration


virt-v2v -f virt-v2v.conf -ic esx://esx-fqdn/?no_verify=1 -o rhev -osd  rhevstorage.example.com:/rhev-export-disk1  rhel5vmwareguest

  Now go to RHEVM  and import the Virtual Machine to the Desired Data Center.

No comments: