VMware Cloud Community
Mafaldo
Contributor
Contributor
Jump to solution

vmware-cmd : reaching datastores through vcenter

Hi,

I've got a proplem with vmware-cmd command.

When I query the esxi server with the VMA using the -l switch, it works fine. This is what I get :

vmware-cmd -H esxi02.axe.lan -U root -P xxxx -l

/vmfs/volumes/f0fd945a-275bd0c1/CL-VDC1/CL-VDC1.vmx
/vmfs/volumes/f0fd945a-275bd0c1/CL-VCEGID/CL-VCEGID.vmx
/vmfs/volumes/f0fd945a-275bd0c1/CL-VFILES/CL-VFILES.vmx
/vmfs/volumes/4d21cdc6-da1be880-18e5-68b59975c9d0/PDASERV0103/PDASERV0103.vmx
/vmfs/volumes/4d220aff-1b6f60b8-33cb-68b59975c9d0/VFILES/VFILES.vmx

But if I send the same command to the vcenter

vmware-cmd -H vcenter.axe.lan -T esxi02.axe.lan -U administrator -P xxxx -l

/vmfs/volumes//CL-VDC1/CL-VDC1.vmx
Use of uninitialized value in concatenation (.) or string at /usr/bin/vmware-cmd line 453.
/vmfs/volumes//CL-VCEGID/CL-VCEGID.vmx
Use of uninitialized value in concatenation (.) or string at /usr/bin/vmware-cmd line 453.
/vmfs/volumes//CL-VFILES/CL-VFILES.vmx
/vmfs/volumes/4d21cdc6-da1be880-18e5-68b59975c9d0/VMGMT/VMGMT.vmx
/vmfs/volumes/4d220c3b-3d4bec50-9b85-68b59975c9d0/XPCOMPTA/XPCOMPTA.vmx

Looks like vcenter has difficulties trying to read/parse one of the datastore's directory (f0fd945a-275bd0c1). See the double "//" ?

On top of that there's an error message from the perl script.I did take a look at it but I couldn't find any problem with it. This is beyond my competencies, I'm afraid.

Any ideas ? Permission issue ?

Ce message a été modifié par: Mafaldo

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

Mine too a 4.1 vMA. but the switches are different!!

[vi-admin@xx ~]$ cat /etc/vma-release
vMA 4.1.0 BUILD-268751
[vi-admin@xx ~]$ vmware-cmd --help
   Usage: vmware-cmd <options> <vm-cfg-path> <vm-action> <arguments>
          vmware-cmd -s <options> <server-action> <arguments>
     Options:
       Connection Options:
          -H or --server <host>            specifies an ESX host or a Virtual Center
          -h or --vihost <target host>     specifies a target host if host is a virtual center
          -O <port>                        specifies an alternative port
          -Q <protocol>                    specifies an alternative protocol
can you check the vMA version? and upgrade it if its possible.

View solution in original post

0 Kudos
11 Replies
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

when we query through vCenter server using vmware-cmd we have to mention the ESXi host name/ip epxplicitly using the switch --vihost.

Eg:

vmware-cmd --server esxhostpath_to_vmx_file getstate
vmware-cmd --server vcenter--vihost esxhostpath_to_vmx_file getstate

Ref: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=201296...

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

-h is the replacement for --vihost. So the required command will be. 

vmware-cmd -H vcenter.axe.lan -h esxi02.axe.lan -U administrator -P xxxx -l
0 Kudos
Mafaldo
Contributor
Contributor
Jump to solution

Thanks but when I run vmware-cmd --help I get that :

[vi-admin@vmgmt ~]$ vmware-cmd --help
   Usage: vmware-cmd <options> <vm-cfg-path> <vm-action> <arguments>
          vmware-cmd -s <options> <server-action> <arguments>

     Options:
       Connection Options:
          -H or --server <host>            specifies an ESX host or a Virtual Center
         -T <target host>                 specifies a target host if host is a virtual center

There's no --vihost switch. Is it a version problem ? I'm using vSphere v4.1.

Anyway, my understanding is that in my environment the "-T" switch stand for your "--vihost" switch.

I believe my command syntax is correct because one of the 2 datastores is treated correctly.

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

Mine too a 4.1 vMA. but the switches are different!!

[vi-admin@xx ~]$ cat /etc/vma-release
vMA 4.1.0 BUILD-268751
[vi-admin@xx ~]$ vmware-cmd --help
   Usage: vmware-cmd <options> <vm-cfg-path> <vm-action> <arguments>
          vmware-cmd -s <options> <server-action> <arguments>
     Options:
       Connection Options:
          -H or --server <host>            specifies an ESX host or a Virtual Center
          -h or --vihost <target host>     specifies a target host if host is a virtual center
          -O <port>                        specifies an alternative port
          -Q <protocol>                    specifies an alternative protocol
can you check the vMA version? and upgrade it if its possible.
0 Kudos
Mafaldo
Contributor
Contributor
Jump to solution

Interesting...

Couldn't find /etc/vma-release but I found /etc/vima-release !

It says :

vMA 4.0.0 BUILD-161992

Which is clearly outdated.

What is the best way to update it ?

0 Kudos
schepp
Leadership
Leadership
Jump to solution

Mafaldo wrote:

Which is clearly outdated.

What is the best way to update it ?

Deploy the latest vMA OVF since the version 5 is very different from version 4, as it now uses SUSE, like most VMware appliances today.

Regards

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

there is no direct upgrade from vMA4 to 5.

We have to deploy the new vMA OVF and configure it. You can find the realated documentation here.

http://www.vmware.com/support/developer/vima/

0 Kudos
Mafaldo
Contributor
Contributor
Jump to solution

Ok, I will deploy VMA 5.1 and try again

I will post a reply with the result.

Thanks yezdi

0 Kudos
Mafaldo
Contributor
Contributor
Jump to solution

Brilliant !

It works !

2 remarks though...

1. The process is quite long, it takes like 1 min to display the result. Not an issue for me anyway

2. Strangely enough, the datastore named "f0fd945a-275bd0c1" is now "nfs". However the other datastore which is SAS is still named

"4d21cdc6-da1be880-18e5-68b59975c9d0". I'm curious about the naming scheme behind this ?

What if I had several NFS link attached ?

Topic for another post probably...

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

what is the actual filesystem of "f0fd945a-275bd0c1?

is it a NFS datastore?

0 Kudos
Mafaldo
Contributor
Contributor
Jump to solution

Yes it is

0 Kudos