VMware Cloud Community
Mokshir
Enthusiast
Enthusiast

Using PowerCLI to Create Custom OVF Properties

Hi Guys,

I am working on a OVF build from a existing VM. This VM is deployed from a template and then gets additional configuration through powerCLI. The last step is to configure the OVF properties and export the OVF.  The properties are very minimal i.e. network configuration only.

The reason i did not use VMStudio is because we had to use an existing VM Template and build on it further.  All I need is to get the following incorporated in the OVF properties for the VM.

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

   <PlatformSection>

      <Kind>VMware ESXi</Kind>

      <Version>5.5.0</Version>

      <Vendor>VMware, Inc.</Vendor>

      <Locale>en</Locale>

   </PlatformSection>

   <PropertySection>

         <Property oe:key="vmDnsserver1" oe:value="192.168.1.253"/>

         <Property oe:key="vmDnsserver2" oe:value="192.168.1.254"/>

         <Property oe:key="vmGateway1" oe:value="192.168.1.1"/>

         <Property oe:key="vmHostname" oe:value="WIN2K8"/>

         <Property oe:key="vmIPaddress1" oe:value="192.168.1.11"/>

         <Property oe:key="vmSubnetmask1" oe:value="255.255.255.0"/>

   </PropertySection>

   <ve:EthernetAdapterSection>

      <ve:Adapter ve:mac="00:50:56:93:40:99" ve:network="VM Network" ve:unitNumber="7"/>

   </ve:EthernetAdapterSection>

</Environment>

I want to know if I cant just suply this xml or use powercli vAppConfigSpec object. I am not very clear on how to use this

Any help will be highly appreciated.

Thanks

mohit

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

I haven't played with this myself yet, but the VMware Tools variable guestinfo.ovfEnv can be used to point to the XML file.

See Self-Configuration and the OVF Environment


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos