Command : vim-cmd vmsvc/device.diskaddexisting 22 MY_VM /vmfs/volumes/datastore1/DISK1_PATH/MY_VM_Data_Disk_0001.vmdk 0 2
Output : Failed to find a 3 controller with bus number 0.
Return Code : 0 ( WHY ????, it should be non-zero)
Note :
1> Disk(MY_VM /vmfs/volumes/datastore1/DISK1_PATH/MY_VM_Data_Disk_0001.vmdk) is successfully created before executing this command.
2> SCSI position "0:2" is available (is not occupied) [ I checked by adding from VMware HTML Client, it was adding successfully in 0:2, after command failed)
Similar Question in forum (with no progress)
https://communities.vmware.com/thread/552802
Documentation says that this command can be run on ESXi 5.5, 6.0 but i need to run on ESXi 6.5 , is there any alternate command ?
vim-cmd vmsvc/device.diskaddexisting 22 MY_VM /vmfs/volumes/datastore1/DISK1_PATH/MY_VM_Data_Disk_0001.vmdk 0 2
The "22" portion of your command should be the vmid (verify with vim-cmd vmsvc/getallvms), but you put "MY_VM" afterwards which is not valid. Try it with just the ID, and in the fully-qualified path to the VMDK descriptor, use the non-linked format (GUID instead of canonical name). I just verified this on an ESXi 6.5 host and the command completes successfully for me.
vim-cmd vmsvc/device.diskaddexisting 22 MY_VM /vmfs/volumes/datastore1/DISK1_PATH/MY_VM_Data_Disk_0001.vmdk 0 2
The "22" portion of your command should be the vmid (verify with vim-cmd vmsvc/getallvms), but you put "MY_VM" afterwards which is not valid. Try it with just the ID, and in the fully-qualified path to the VMDK descriptor, use the non-linked format (GUID instead of canonical name). I just verified this on an ESXi 6.5 host and the command completes successfully for me.
Thanks !!
It got working , actually it was a degrade in my script, (I changed some code) and failed to notice the command string also changed