【问题标题】:ovf deployment on VMWare environment with guestinfo property带有 guestinfo 属性的 VMWare 环境中的 ovf 部署
【发布时间】:2019-07-24 22:42:16
【问题描述】:

我正在尝试使用 OVF 配置部署 VM,我的目标是使用 VMware guestinfo 将用户在 OVF 环境中提供的键值传递给 VM。

以下是我添加到 OVF 文件中的设置/属性

<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">
....

部署虚拟机后,我可以在虚拟机 vApp 选项下验证 OVF 环境中的属性。这是我看到的

<?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>

最后,当我登录到盒子并尝试使用 vmtoolsd cmd 获取 guestinfo 属性时 vmtoolsd --cmd "info-get hello" 我正进入(状态 No value found

我需要帮助调试这个问题。不太确定我的 OVF 配置中是否缺少某些内容。提前致谢。感谢您的帮助!

【问题讨论】:

    标签: virtual-machine vmware vmware-tools ovf


    【解决方案1】:

    我想没有直接的方法可以专门获取密钥,但我可以在我的盒子上运行 vmtoolsd --cmd "info-get guestinfo.ovfenv" 并且输出是

    <?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>
    

    这是我在OVF 环境中看到的vcenter 中的虚拟机。假设这可能是使用 vmtools 从 vm 获取键值的一种方法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 2017-04-25
      • 1970-01-01
      • 2018-12-20
      • 2018-06-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多