Set a static IP address for OVA files using VMware vSphere

For static IP addresses to work with an OVA file, the OVA file must read values from vami properties defined in it.

Learn more about vami properties from the VMware community website.

Read values from vami properties and set static IP addresses

When you launch an OVA file with a static IP address, the following values are set:

  • prop:ip0=<ip address> (static IP address for example 10.0.0.2)

  • prop:netmask0=<netmask> (netmask for the configured static IP address for example 255.255.255.0)

  • prop:gateway=<gateway> (default gateway for the configured static IP address for example 10.0.0.1)

Note: Your OVA file must read the above values from vami properties and use them to set static IPs on the desired NIC.

On Linux, you must enable the following first Boot script and run it:

!/bin/bash

#Reads and sets IP values from vami

/opt/vmware/share/vami/vami_ovf_process --setnetwork

 The following figure shows how to enable Boot scripts using VMware Studio:

vsphere-ovf-static-ip.png

You can download the complete vami script from the VMware community page.

0 Comments