VMware Cloud Community
JCaylor0
Contributor
Contributor

vSphere CLI 5.5 - Retreiving list of available VMs with the Data Store path

As of now, when I use the command:

$vmware-cmd -H <vcenter_hostname> -U <username> -P<password> -h <esx_host> -l


I get a list of virtual machines as discussed in the documentation using the UUID-based path: folder/subfolder/file

For example:

  '/vmfs/volumes/mystorage/testvms/VM1/VM1.vmx' (Linux) 

I am attempting to write a bash script to utilize this command to start/stop/reset virtual machines and eliminate the need for the full path of the vmx by using grep for the vm name that is input into the script and determining the full path using the list command.

My problem is that I would need a similar command to return the list of virtual machines using the Datastore prefix instead:

Datastore prefix style: [ds_name] <relative_path>

For example:

  '[myStorage1] testvms/VM1/VM1.vmx' (Linux) 

Is there a way to accomplish this?

Reply
0 Kudos
0 Replies