VMware {code} Community
RockyConcept
Contributor
Contributor

How to convert XML based VMX to text-based VMX ?

Hi,

I do have the VMX file in XML format that I received from GetVmPropertyInfo call of the vSphere SDK. Now I want to convert this XML based VMX file to the text based vmx file (which workstation can understand ). Is there any way to convert it. If this is not the appropriate SDK forum, please feel free to move it to the correct one.

I am attaching the XML based VMX file herewith for your reference.  In case you have any sample code, please attach it herewith for reference.

0 Kudos
2 Replies
Steve_Jin
Expert
Expert

Both the schema of the XML and the format of VMX are not part of public API or Spec. Even you can hack it, it would be fragile from version to version. You can in fact download vmx file directly.

What do you want to achieve the conversion?

Steve Jin, Author of VMware VI and vSphere SDK, http://www.doublecloud.org

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
0 Kudos
RockyConcept
Contributor
Contributor

Unfortunately I don;t have the original VMX file. So I want to convert this XML based VMX to normal VMX. Smiley Sad

Actually these VMs are backed by one of our application and unfortunately that application failed to backup the VMX file. But I do have the XML file so I want to recreate the VMX from it. I don;t want to create the VMX manually for all those 100s of VM.

I am under the impression that if we input XML to 'some' vSphere SDK function it will create VMX for me. I understand this is not going to be straightforward but somehow I want to achieve this.

In case it is not at all possible, could please guide me mapping the XML tags to equivalant VMX values. Also the minimum XML tags that I need to visit to build the VMX. This will be of great help to me.....

Any pointers/docs would be of great help.

0 Kudos