Migrate Xen to KVM on RHEL/CentOS 6

Migrate Xen to KVM on RHEL/CentOS 6

 

Red Hat's own documentation can be found here:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtua...

Set up bridging on server:
  • http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtua...
  • Follow suggestion: Instead of turning off NetworkManager, add "NM_CONTROLLED=no" to the ifcfg-* scripts used in the examples.
  • In my experience it was necessary to have the following lines in ifcfg-br0 (replacing .4. as required)

    BROADCAST=192.168.4.255
    NETMASK=255.255.255.0
    NETWORK=192.168.4.0

  • It is also necessary to disable network manager or the network will have to be restarted by hand every time the system is booted
Storage Pool
  • An LVM volume group can be set up as a storage pool
Convert machine with virt-v2v
  • create an xml file on the xen server with: virsh dumpxml > vm_name.xml
  • Create a disk image file of exactly the same name that the LV will have
  • edit the xml file and in the disk section change the lines
    driver name='phy' to name='file' type='raw'
    source dev='name of old lV' to source dev='new disk image file'
  • optionally change the MAC address (and this will also have to be changed in /etc/sysconfig/network-scripts/ifcfg-eth0
  • Now create the VM: (lvm_cdrive is the LVM pool you have created)
    virt-v2v -i libvirtxml -op lvm_cdrive --bridge br0 www.xml
  • If a logical volume is created with a virt tool, it is important to use the tool to delete it.
Update Data
  • If the MAC address has been changed so that both the new and old machines can be running at the same time, directories in the new machine (that have changed since imaging) can be updated from the old with rsync:
    RSDIR=/etc
    RSREMOTE=www
    RSOPT="--archive -v --delete --compress --sparse --stats --progress --rsh=ssh"
    rsync $RSOPT root@$RSREMOTE:$RSDIR/ $RSDIR
KVM Notes
  • When changes are made to the xml file, you need to reload it
    virsh shutdown vm_name
    service libvirtd restart
    virsh start vm_name

See also:
- http://www.techotopia.com/index.php/Creating_a_CentOS_KVM_Networked_Brid...
- http://wiki.centos.org/HowTos/KVM

from:  http://drup.org/migrate-xen-kvm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值