User Tools

Site Tools


linuxxentokvmconversion
Xen Host
  • Install and boot into non-Xen kernel
    • yum install kernel
    • Edit /etc/grub.conf, make sure non-Xen kernel is default
  • Remove Xen
    • yum groupremove xen
    • Install KVM
    • Refer to [LinuxKVM]
  • Disable Xen services
    • chkconfig xend off; service xend stop
    • chkconfig xendomains off; service xendomains stop
    • chkconfig rhn-virtualization-host off; service rhn-virtualization-host stop
  • Convert Xen network scripts to standard sysconfig scripts
Xen Guest
  • Install a non-Xen kernel
    • yum install kernel kernel-devel
    • The kernel-devel may or may not be required but it often is
  • Update /etc/grub.conf
    • Make sure the new non-Xen kernel is default
    • Make sure no kernel lines contain console=xvc0
  • Modify /etc/modprobe.conf
    • Change alias eth0 xennet to alias eth0 virtio_net
    • Change alias scsi_hostadapter xenblk to alias scsi_hostadapter virtio_blk
  • Make a new initrd (where kernel_ver is the non-Xen one just installed)
mkinitrd -f --with=virtio_blk --with=virtio_pci --builtin=xenblk /boot/initrd-kernel_ver.img kernel_ver
  • Edit /etc/inittab
    • Remove co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav
    • Make sure lines containing :2345:respawn:/sbin/mingetty tty are not commented out
  • Shutdown the guest on Xen host
    • halt
  • Create a KVM config file for the new guest
    • On Xen host, virsh dumpxml guest_name>guest_name.xml
    • Copy this XML file to the KVM host, into /root or /tmp
  • On KVM host, edit KVM config file to match values from Xen config*
    • Change domain type to kvm
    • Remove bootloader line
    • Change type arch='x86_64' machine='xenpv'linux/type to type arch='x86_64' machine='pc'hvm/type
    • Add this line under devices emulator/usr/libexec/qemu-kvm/emulator
    • Change driver name='phy'/ to driver name='qemu' type='raw'/
    • Change target dev='xvda' bus='xen'/ to target dev='vda' bus='virtio'/
    • Change mouse bus to ps2
  • Define the domain on KVM host
    • virsh define /path/to/xml/guest.xml
  • Start guest on KVM host
    • virsh start guest
  • Clean-up tasks
    • Network (necessary only if eth0 is not active on reboot)
      • Stop network
      • Edit /etc/sysconfig/network-scripts/ifcfg-eth0 to original IP addr
      • Start network
    • Kernel
      • Uninstall old Xen kernels
      • rpm -ev kernel-xen kernel-xen-devel
linuxxentokvmconversion.txt · Last modified: 2017/11/10 01:12 by mark