首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用guestinfo属性在VMWare环境上部署ovf

使用guestinfo属性在VMWare环境上部署ovf
EN

Stack Overflow用户
提问于 2019-07-25 06:42:17
回答 1查看 351关注 0票数 0

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

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

代码语言:javascript
复制
<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">
....

在部署VM之后,我能够在VM vApp选项下验证OVF环境中的属性。这是我所看到的

代码语言:javascript
复制
<?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 vmtoolsd --cmd "info-get hello"获取guestinfo属性时,我得到的是No value found

我需要帮助调试这个问题。我不太确定我的OVF配置中是否遗漏了什么。提前谢谢。非常感谢您的帮助!

EN

回答 1

Stack Overflow用户

发布于 2019-07-25 08:43:08

我想是不是没有直接的方法来获取密钥,但是我可以在我的机器上运行vmtoolsd --cmd "info-get guestinfo.ovfenv",输出是

代码语言:javascript
复制
<?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>

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57192150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档