How to migrate VMWare ESXi boot LUN and RDM to a new SAN system using free tools

. Monday, October 14, 2019

Disclaimer: Use this at your own risk. I provide no guarantees that this will work for you or set your SAN/VMWare ablaze. I suggest to test it with less risky resources.

To copy ESXi boot lun you'll need two ESXi hosts. Host #1 Source. Host #2 - assist host.

  • Put one in maintenance mode and ensure that this host has one throw away powered off the virtual machine.
  • Mount the boot from the old system you wish to clone/copy with a known Lun ID (let's say 7)
  • Mount the blank LUN (same sized) from a new SAN also with known Lun ID (let's say 8)
  • Re-scan storage adapter (skip VMFS discovery for the quicker process)
  • SSH to the ESXi host in maintenance mode 
  • I generally like to browse to the folder of temp VM.
  • Issue two commands: 
    esxcfg-mpath -L |grep L7 
    esxcfg-mpath -L |grep L8
  • Make a note of "naa." device IDs for both LUNs - you will need them in a second

  • vmkfstools -z /vmfs/devices/disks/naa.of_source_lun   /vmfs/volumes/location _of_temp_ vm/name_of_lun_to_clone.vmdk
  • vmkfstools -i /vmfs/volumes/location _of_temp_ vm/name_of_lun_to_clone.vmdk  -d rdm:/vmfs/devices/disks/naa.of_destination_lun   name_of_lun_to_clone2.vmdk

DO NOT RESCAN storage yet or you will cause a purple screen!

Disconnect both luns from 2nd host, connect the new Lun to the source host as LUN ID 1

change boot policy on the host to boot from new LUN
reboot it validate boot

you're done.