VMware Cloud Community
JCaylor0
Contributor
Contributor

vmware-cmd requires datastore path on esx with different datastore

Okay,

so my setup is actually quite simple. I have a vCenter with 2 ESXi servers (ESX01 and ESX02).

Each physical ESX server has its own datastore.

ESX01: mydatastore-01
ESX02: MY-OTHER-DATASTORE

Now, when I use the command:

$vmware-cmd -H vcenter.mydomain.com -h esx01.mydomain.com -l

After a couple of minutes waiting on the response.... (<--- if anyone knows how to resolve that it would be great!)

I get a list of

UUID-based path: folder/subfolder/file

For example:

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

so when I execute the command:

$vmware-cmd -H vcenter.mydomain.com -h esx01.mydomain.com /vmfs/volumes/mystorage/testvms/VM1/VM1.vmx getstate

It returns the appropriate "getstate() = on"

The problem is when I use ESX02 in the same manner. Even though the list command still shows me the UUID-based path, when I attempt to use it with this command:

$vmware-cmd -H vcenter.mydomain.com -h esx02.mydomain.com /vmfs/volumes/mystorage2/testvms/VM2/VM2.vmx getstate

I get a response of "No virtual machine found."

however, if I look on my vSphere (GUI) client in windows to get the datastore path

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

and use that in place of the UUID-path for ESX02, the command works just fine.

How can I fix the issue with ESX02 not accepting the UUID-path... OR, how can I get a list of registered machines with the datastore path?

Reply
0 Kudos
2 Replies
JCaylor0
Contributor
Contributor

Can anyone shed some light on how I might be able to force vmware-cmd to accept the UUID-based path?

Or, if that is not doable from VCenter, can I get a command that will allow me to retrieve a list of registered VMs with the datastore path?

Reply
0 Kudos
Anafp
Enthusiast
Enthusiast

Late reply, but because I also needed to have a UUID - Datastore relation for scripting purposes and searched a lot, you might find this command useful:

esxcli storage filesystem list


more info:

http://technicloudtraining.com/post/60577796404/using-the-vma-to-determine-the-relationship-between-...

Reply
0 Kudos