I also posted this in the CLI forum, but this area seems to have more activity.
Help!!!! Please!!
I am trying to automate the testing of iSCSI NIC cards, and am stumped at one spot. I can automate the creation of LUNs on the storage device, I can add them to the ESX host, and I can create an RDM, but I cannot figure out how to attach that RDM to a VM.
Creating the RDM is simple and straight forward.
vmkfstools -r /vmfs/devices/disks/naa.60060160cd103300b2678da7b981e211 /vmfs/volumes/datastore3/Linux1Auto1/Linux1Auto1_3.vmdk
This creates:
-rw------- 1 root root 5368709120 Mar 4 10:24 Linux1Auto1_3-rdm.vmdk
-rw------- 1 root root 487 Mar 4 10:24 Linux1Auto1_3.vmdk
If I use the vSphere GUI then it is easy to attach the exisiting drive (just created) to a VM.
Obviously, that is unacceptable for automation.
Googling this subject shows a lot of people asking the same question, but no satisfactory answer.
For example, one answer says to edit the appropriate .vmx file.
Obviously, that is unacceptable for automation.
Other answers point to perl scripts, so that indicates this is a doable task. We use Python for our automation, but all the automation work is command line on a vMA guest.
So, the question is what is the CLI command to attach this RDM to a VM.
It can be a vmware-cmd, or esxcli, or vmkfstools, or vicfg-user, or something else. I just need it to work with a vMA 5.1
Thanks.