Scenario: All commandline based, using perl vmware tools, and direct ssh commands. ESXi 5 cluster.
On a SAN I take snapshots of a volume, I export the snapshot to vmware, rescan all HBAs, retrieve path to device,
vmkfstools -z args to map the RDM to a vmdk file.
All working thus far.
The next step (if my procedures are correct, if not please detail steps I may be missing) is to hot add this vmdk to a
running VM:
vim-cmd help vmsvc/device.diskaddexisting
Usage: device.diskaddexisting vmid disk file controller number unit number
Add an existing disk to this virtual machine.
Running the following on the esxi host that contains the VM.
~ # vim-cmd vmsvc/device.diskaddexisting 15 /vmfs/devices/disks/naa.50002ac001750dbd 0 4
Reconfigure failed
Also tried above command using full path to the vmdk I created with vmkfstools -z:
~ # vim-cmd vmsvc/device.diskaddexisting 15 /vmfs/volumes/VmWareRDM/QA02/VC-database.vmdk 0 4
Reconfigure failed
This can be done successfully using vSphere gui client. Surely this can be done using vmware cli tools.
Use of PowerShell is not an option as this operation is part of a larger script that gets executed in a cron job on a linux host.
So how can I hot add this RDM to a running VM, is there another command I can use instead of vim-cmd?