In preparation for a SRM project we had to check and migrate all RDM files to VMDK.
Check which VM has RDM using PowerCLI
Get-VM | Get-HardDisk -DiskType “RawPhysical”,”RawVirtual” | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName
Verify how RDM is connected
Edit the settings of the virtual machine in the VMware web client (while the machine is running) to verify if the RDM is connected physical or virtual.
The field compatibility tells how the RDM is connected, Physical or Virtual
Convert Physical RDM to VMDK
A physical connected RDM cannot be converted online to a VMDK. Before that we need to convert the Physical RDM to a Virtual RDM. (VMware KB)
- Write down the drive letter of the disk in the guest OS
- Stop the Virtual Machine by doing a shutdown of the guest OS
Note-down the LUN ID of the RDM by going into the multipath settings of the RMD connected to the VM
Remove the RDM, and check “Delete fr
Re-Add the RDM but change the compatibility mode to Virtual. Be sure the RDMs are connected to a separate SCSI-Controller (VM-PARAVIRTUAL). Select the same LUN ID as the LUN disconnected.
- Power on the virtual machine
Go into storage management and check if the disk is online. Default it will be offline, bring it back online and connect it to the correct drive letter.
- No your server is up and running with a Virtual RDM wich can be migrated online to a VMDK (see Convert Virtual RDM to VMDK)
Convert Virtual RDM to VMDK
A Virtual connected RDM can be migrated to a VMDK while the machine is running. (VMware KB)
Check if the RDM is connected virtual. Edit the VM settings and check compatibility mode of the disk
Start the Storage migration of the virtual machine
Be sure you change the disk mode to Thin or Thick provisioned.
- If you select “Same format as source” then the RMD link file will be moved and NO migration to VMDK will happen.
If needed you can select this setting for each disk (and VMX config file) if you go into the advanced
Change the setting for each individual disk and start the migration
- After the migration check the disk to see it is a VMDK and not a RDM.
During a migration process from ESX to ESXi at a customer site we had a problem removing a server from the vCenter inventory.
We checked the permissions on this server and we saw that the user who wanted to remove the server was admin on datacenter level. Here the screen we got.
Knowing there is a PowerCLI command to remove a ESXi host from the vCenter, we walked that way with success.
I used this
PowerCLI script to remove this server from the inventory after moving the
server out of the cluster to the datacenter level.
Remove-VMHost “HostThatCannotBeRemovedViaGui” –confirm:$false