Total Pageviews

Showing posts with label V2V. Show all posts
Showing posts with label V2V. Show all posts

Thursday, January 6, 2011

Debugging virt-v2v

Enable Debugging Level on RHEV  Virt-V2v

 In some case if you get any error while  trying  to migrate some of the virtual machines running on vmware or xen using virt-v2v tools and if you didn't get any error output on the command line then you can increase the virt-v2v  debug level verbosity by following the below steps to narrow down and fix the issue .

Check "netcat"  is installed on the machine that is executing virt-v2v from?

 Log in to the server console ( where v2v is installed ) a root and execute the below command to verify netcat is installed or not on the host .

# which  nc 
/usr/bin/nc
# rpm -qf /usr/bin/nc
nc-1.84-22.el6.x86_64

 If you didn't find any then use the below command to install it .


 yum install nc



Please enable debugging by running following commands to get debug logs on the same terminal console where you executed the above commands .

# export LIBGUESTFS_TRACE=1
# export LIBGUESTFS_DEBUG=1

Now try the earlier virt-v2v command on the same terminal console  and check the console logs for detailed error output



Monday, December 27, 2010

Converting a guest from RHEV to RHEL5.4 KVM Host


RHEV: V2V - Converting a guest from RHEV to RHEL5.4 KVM Host

  Its a very nice kbase article explains  the process to migrate a virtual machines running on RHEV to libvirt based KVM host.

https://access.redhat.com/kb/docs/DOC-28035

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.