On Vmware ESX or ESXi: If you are trying to Vmotion a Virtual Machine (VM) that has a Raw Device Mapping (RDM) attached, you may get an error message saying:
virtual disk ‘hd1’ is mapped direct-access LUN that is not accessible.
This error usually occurs when there is LUN ID mismatch across hosts. Here is solution from VMware KB:
One of the VMotion requirements is shared storage, this has to be seen from both hosts in the same way (physical ID) otherwise the VMotion checks will not allow you to proceed with the vMotion operation.
Warning: Before following the procedure below, check with your Hardware vendor to ensure the changes on step 3 will not affect the Datastores. If this cannot be avoided, you will need to power off all the virtual machines as changing the physical ID/presentation of the LUNs hosting Datastores may cause them to be recognised as snapshots and resigning may be required.
To fix the numbering mismatch on LUNs:
- Power-down virtual machines with RDMs.
- Select Virtual Machine > Edit Settings > Remove RDMs from the virtual machine (see screenshot of this option below).
- Make presentation changes on your array
- Check the Multipathing Checklist in the Fibre Channel or iSCSI SAN Configuration Guide for your version of ESX or ESXi.
- Request storage configuration best practices from your hardware vendor. Many vendors have a document that explains the configuration settings for use in conjunction with ESX.
- Rescan all ESX hosts.
- Select Virtual Machine > Edit Settings > Re-add RDMs with new LUN numbers.
- Power-up the virtual machines and verify they are accessing correct disks, and can now VMotion.
Screenshot of the Virtual Machine Edit Settings Options