Auto-deploy on Rocks/KVM

From PRAGMA wiki
Jump to: navigation, search

This example is showing the migration of a VM named rxvm. rxvm was created on a Rocks/Xen hosting server - fiji. then was deploy on a Rocks/KVM hosting server - rkhs. Rkhs is a x86_64 system running Rocks 6.0 with KVM roll.

On fiji

Dump VM xml file

  • Logon to fiji as root
  • Start the VM named rxvm
  • Dump the VM's xml file (make sure that the basename of the xml file is the same as the basename of the VM image file)
# virsh dumpxml rxvm > rxvm.xml
  • Warning: in case you want to rename the VM image file and the xml file after they have been created, you can, but make sure that
    • keep the base name consistent (for example, if to change rxvm.img.gz to vm1.img.gz, then change rxvm.xml to vm1.xml)
    • keep the name and contents of the xml file consistent (for example, if you change the rxvm.xml to vm1.xml, then replace all "rxvm" with "vm1" in the contents of the xml file as well.)

On rkhs

VM image depository setup

Either use gfarm or local disk, the depository setup is the same

  • copy the VM image file rxvm.img.gz and its xml file rxvm.xml to vm-images/SDSC directory
  • add an entry in vm-images/vmdb.txt
rxvm,xen-kvm,SDSC/rocks-201.img.gz,16dee62db517fb608699c8b837e4eba3

Check/install Perl modules required by virt-v2v

Logon to rkvm as root, run "virt-v2v". If there is any perl module missing, it will indicate in its output. Install the missing module(s), then run "virt-v2v" again, ... until all errors are cleared.
For example, if virt-v2v indicates that it couldn't find perl-Pod-Simple module, do

# yum list --enablerepo=base,updates | grep perl-Pod-Simple
# yum install perl-Pod-Simple.x86_64