0

I am trying to deploy a VM using OVF configuration and my goal is to pass the key-value provided by the user in the OVF environment to the VM using VMware guestinfo.

Following are the settings/attributes I have added to my OVF file

<ProductSection ovf:required="false">
            <Info>Virtual Appliance</Info>
            <Property ovf:userConfigurable="true" ovf:type="string"
                      ovf:key="guestinfo.hello" ovf:value="">
              <Label>hello</Label>
              <Description>enter some string</Description>
            </Property>
</ProductSection>
....
<VirtualHardwareSection ovf:transport="com.vmware.guestInfo">
....

After deploying the VM, I am able to verify the property in OVF environment under VM vApp Options. Here is what I see

<?xml version="1.0" encoding="UTF-8"?>
<Environment
 xmlns="http://schemas.dmtf.org/ovf/environment/1"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:oe="http://schemas.dmtf.org/ovf/environment/1"
 xmlns:ve="http://www.vmware.com/schema/ovfenv"
 oe:id=""
 ve:vCenterId="vm-xxxx">
<PlatformSection>
  <Kind>VMware ESXi</Kind>
  <Version>6.0.0</Version>
  <Vendor>VMware, Inc.</Vendor>
  <Locale>en</Locale>
</PlatformSection>
<PropertySection>
     <Property oe:key="guestinfo.hello" oe:value="world"/>
</PropertySection>
<ve:EthernetAdapterSection>
  <ve:Adapter ve:mac="00:50:56:b2:d2:8a" ve:network="VLAN1804- 
xxx.xxx.xxx.0/25" ve:unitNumber="7"/>
  <ve:Adapter ve:mac="00:50:56:b2:83:ea" ve:network="VLAN1804- 
xxx.xxx.xxx.0/25" ve:unitNumber="8"/>
</ve:EthernetAdapterSection>
</Environment>

Finally, When I log in to the box and try to get the guestinfo property using vmtoolsd cmd vmtoolsd --cmd "info-get hello" I am getting No value found

I need to help to debug this problem. Not really sure if I am missing something in my OVF configuration. Thanks in Advance. I appreciate your help!

CuriousTechie
  • 413
  • 2
  • 8
  • 21

1 Answers1

0

I guess is there no direct way to get the key specifically but I am able to run vmtoolsd --cmd "info-get guestinfo.ovfenv" on my box and output is

<?xml version="1.0" encoding="UTF-8"?>
<Environment
 xmlns="http://schemas.dmtf.org/ovf/environment/1"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:oe="http://schemas.dmtf.org/ovf/environment/1"
 xmlns:ve="http://www.vmware.com/schema/ovfenv"
 oe:id=""
 ve:vCenterId="vm-xxxx">
<PlatformSection>
  <Kind>VMware ESXi</Kind>
  <Version>6.0.0</Version>
  <Vendor>VMware, Inc.</Vendor>
  <Locale>en</Locale>
</PlatformSection>
<PropertySection>
     <Property oe:key="guestinfo.hello" oe:value="world"/>
</PropertySection>
<ve:EthernetAdapterSection>
  <ve:Adapter ve:mac="00:50:56:b2:d2:8a" ve:network="VLAN1804- 
xxx.xxx.xxx.0/25" ve:unitNumber="7"/>
  <ve:Adapter ve:mac="00:50:56:b2:83:ea" ve:network="VLAN1804- 
xxx.xxx.xxx.0/25" ve:unitNumber="8"/>
</ve:EthernetAdapterSection>
</Environment>

which is what I see in OVF environment for the vm in vcenter. Assuming this can be one way to get the key-value from the vm using vmtools

CuriousTechie
  • 413
  • 2
  • 8
  • 21