VMware {code} Community
ajayvk
Contributor
Contributor

Getting values from .vmxf file

Is there a way a way by which I can get the value of properties present in .vmxf file? I am able to get the values out of .vmx file using vSphere Web Services SDK. But, I couldn't figure out a way to get the 'VMId' value present in .vmxf file using vSphere Seb Services SDK.

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

I'm not aware of a way to extract fields from the extended configuration file (.vmxf), what you could do is just download the .vmxf locally and parse the configuration file to get what you need. Any reason you need data from that file? What tasks are you trying to perform?

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

ajayvk
Contributor
Contributor

I want to use VMId value within my application as a unique piece of information for a given VM so that I can diffferentiate VMs. I do not want to copy .vmxf file locally. Are there other values that I can use to uniquely identify a VM?- I am aware of a couple of uuids.

0 Kudos
lamw
Community Manager
Community Manager

Yes there are few other values you can use as unique identifiers and probably make it easier on you to track. Take a look at the VM configuration page: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.ConfigInfo.html

Specifically you can use either instanceUuid or locationId or uuid, if you're using vCenter then probably the instanceUuid will be the best since you can track a unique VM at vCenter level and its guarantee to be unique.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

ajayvk
Contributor
Contributor

Thanks.

I cannot use instanceUuid as it need not be set always. I can look into other values. I should even possibly look into getting VMId without copying the .vmxf file locally.

0 Kudos