Migrate Linux RHEL 6.5 from XenServer to Nutanix AHV

Shares

Next part of my migration blog series, this time how to migrate Linux RHEL 6.5 from XenServer to Nutanix AHV.

So far you could read:

Requirements:

  • AOS – 4.6.1.1 or newer
  • AHV – 20160217.2 or newer
  • XenServer 6.5 or newer with XenCenter lastest buil
  • connectivity between legacy XenServer servers and Nutanix CVMs over NFS
  • remove all snapshots from VM

Let’s get started 🙂

  • check what Linux kernel is used  if you can see xen somwhere this means you have to install default kernel
[[email protected] ~]# uname -a
Linux rhel65xc.gso.lab 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] ~]#
  • Check if you have virtIO drivers present in system
[[email protected] ~]# grep -i virtio /boot/config-2.6.32-431.el6.x86_64
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=m
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_NET=m
CONFIG_VIRTIO_CONSOLE=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_VIRTIO=m
CONFIG_VIRTIO_RING=m
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
[[email protected] ~]#
  • Check if virtio modules are part of the initramfs. RHEL 6.5 has virtio drivers build it. If there is not output – no modules, meaning you have to create either new initrd or initramfs images.
[[email protected] ~]# zcat /boot/initramfs-2.6.32-431.el6.x86_64.img | cpio -it | grep virtio
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/block/virtio_blk.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko
  • create new initrd with virtio modules – RHEL 5.X
[[email protected] ~]# mkinitrd --with="virtio_blk virtio_pci" -f -v /boot/initrd-`uname -r`.img `uname -r`
  • create new initrd with virtio modules – RHEL 6.X
[[email protected] ~]# dracut --add-drivers "virtio_pci virtio_blk" -f -v /boot/initramfs-`uname -r`.img `uname -r`
  • check new initrd (RHEL 6.X), virtio modules are there. we can stop server
[[email protected] ~]# zcat /boot/initramfs-`uname -r`.img | cpio -it | grep virtio
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/block/virtio_blk.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko
lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko
96407 blocks
  • Update /boot/grub/grub.conf so that console=ttyS0 rather then console=hvc0.
  • In /etc/fstab remove disk UUID which is next to /boot and replace it by /dev/hda
  • Update /boot/grub/device.map and replace xvda with hda
  • Make sure VM boots in HVM mode with ‘xe vm-param-set uuid=[vm uuid] HVM-boot-policy=”BIOS order”‘ (you can get the vm uuid with xe vm-list) from the XenServer
  • Reboot the VM.
[[email protected] ~]# xe vm-list
uuid ( RO) : 480a7144-bf18-4c2e-a623-ee404fd8e70f
 name-label ( RW): Control domain on host: xenserver01.gso.lab
 power-state ( RO): running

uuid ( RO) : 021a6ea2-f11d-8590-931e-2bbd434f0998
 name-label ( RW): rhel65xs
 power-state ( RO): halted

[[email protected] ~]# xe vm-param-set uuid=021a6ea2-f11d-8590-931e-2bbd434f0998 HVM-boot-policy="BIOS order"
[[email protected] ~]# xe vm-param-get uuid=021a6ea2-f11d-8590-931e-2bbd434f0998 param-name=HVM-boot-policy
BIOS order
[[email protected] ~]#
  • Stop VM
  • List all VM disk, use command xe vm-disk-list uuid=<VM-UUID> – see example below. Note down UUID for VDI entry.
[[email protected] ~]# xe vm-list
uuid ( RO) : 480a7144-bf18-4c2e-a623-ee404fd8e70f
 name-label ( RW): Control domain on host: xenserver01.gso.lab
 power-state ( RO): running

uuid ( RO) : 021a6ea2-f11d-8590-931e-2bbd434f0998
 name-label ( RW): rhel65xs
 power-state ( RO): halted

[[email protected] ~]# xe vm-disk-list uuid=021a6ea2-f11d-8590-931e-2bbd434f0998
Disk 0 VBD:
uuid ( RO) : 547baeb1-b117-68df-d423-f3b4b6764bd8
 vm-name-label ( RO): rhel65xs
 userdevice ( RW): 0

Disk 0 VDI:
uuid ( RO) : 1433eadb-218c-4c22-b7bb-5931a5aec369
 name-label ( RW): rhel65xs 0
 sr-name-label ( RO): NFS virtual disk storage
 virtual-size ( RO): 8589934592

  • Use qemu-img tool to convert disk from VHD to RAW – see example below
[[email protected]]# qemu-img convert -f vpc 1433eadb-218c-4c22-b7bb-5931a5aec369.vhd -O raw rhel65xs01.img
  • Transfer file onto Nutanix container
  • Log in to Nutanix Acropolis and provision VM
  • Add new disk
    • Type: DISK
    • Operation: CLONE FROM ADSF FILE
    • Bus type: SCSI
    • Path – provide path to VM file image in raw format

2015-10-07_21h29_19

  • add network adapter
  • Take VM snaphot
  • Power VM on

Now we have to fix networking.

  • Remove below file and reboot VM
[[email protected] ~]# rm -f /etc/udev/rules.d/70-persistent-net.rules
  • Edit the same file and:
    • note down MAC address
    • change eth1 to eth0
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1af4:0x1000 (virtio-pci)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:2a:43:c6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
  • Edit network configuration file and:
    • remove UUID
    • change MAC address
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=52:54:00:2a:43:c6
IPADDR=10.4.92.22
PREFIX=24
GATEWAY=10.4.92.1
DNS1=10.4.89.111
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
  • restart networking services and you should have network up and running
[[email protected] ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 10.4.92.22 is already in use for device eth0...
 [ OK ]
[[email protected] ~]#

If you have time, watch video

 

0 0 votes
Article Rating

Artur Krzywdzinski

Artur is Consulting Architect at Nutanix. He has been using, designing and deploying VMware based solutions since 2005 and Microsoft since 2012. He specialize in designing and implementing private and hybrid cloud solution based on VMware and Microsoft software stacks, datacenter migrations and transformation, disaster avoidance. Artur holds VMware Certified Design Expert certification (VCDX #077).

Subscribe
Notify of
guest
5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Joseph Tse

So I’m seeing something different looking at my centos 5.x vms as well as my ubuntu vms. Are there steps for those?

Paul Stulac

Have you done this successfully with RHEL/CentOS7? Trying to figure out fstab edits for /boot and if anything needs to be done in grub.cfg?

5
0
Would love your thoughts, please comment.x
()
x

FOR FREE. Download Nutanix port diagrams

Join our mailing list to receive an email with instructions on how to download 19 port diagrams in MS Visio format.

NOTE: if you do not get an email within 1h, check your SPAM filters

You have Successfully Subscribed!

Don't miss any posts. Subscribe To Our Newsletter!!

Join our mailing list to receive the latest news and updates from www.vmwaremine.com.

You have Successfully Subscribed!

Pin It on Pinterest