3

We've make an OVA for customers, which uses DHCP to find its IP address. It's using CoreOS as the guest operating system.

Some customers would like to be able to use a static IP address, configuring that in VMWare.

What is the best practice way of doing that?

Is the only way to have a user interface at the console where the person deploying the virtual machine keys in the IP address and netmask and DNS and so on?

If so, is there a standard tool on Linux to do this, or do we have to write our own?

Or is there some other way of sending settings to the guest OS?

frabcus
  • 919
  • 1
  • 7
  • 18

1 Answers1

3

There is a possibility to pass information to the Guest OS using OVF/OVA. Functionality is called OVF Environment or VMware Guestinfo interface. I'm not sure if this really fits to your use-case and needs.

OVF Environment is a special section in OVF in ProductSection where you can specify Properties with custom key/value pairs.

Like this:

<ProductSection ovf:required="false">
      <Property ovf:key="my-static-address" ovf:type="string" ovf:userConfigurable="true" ovf:value="10.10.10.10">
          <Label>My static IP address</Label>
          <Description>Message about my static IP address</Description>
      </Property>
      <Property ovf:key="foo" ovf:type="string" ovf:userConfigurable="true" ovf:value="bar">
          <Description>foobar</Description>
      </Property>
</ProductSection>.

If you will specify ovf:userConfigurable="true" then the user will have a free text field during deployment when he can specify the static IP address for example.

Then there are two ways to deliver that to VM itself. This is called transport. It could be VMware VM Tools or ISO image attached as a CDROM.

1) VM Tools transport

VMware tools or Open VMware tools should be installed in Guest OS. You should specify in OVF: <ovf:VirtualHardwareSection ovf:transport="com.vmware.guestInfo"> After deployment you can read Product Section via vmware-rpc: vmware-rpctool "info-get guestinfo.ovfEnv" which will return you XML formatted Product Section. Then it is up to you to parse this XML, extract key/values and apply configuration (e.g. static IP).

2) ISO transport

You specify <VirtualHardwareSection ovf:transport="iso"> in OVF. Cloud/Virt platform will then extract Product Section, put it to the ISO9660 image as file ovf-env.xml and attach to the first available IDE device as a CDROM. Then you can mount this CDROM, read the file, parse the values and apply configuration.

If you don't want to parse values by yourself, you can consider cloud-init as an option inside the guest to apply configuration. There are plenty of modules to apply IP config, SSH keys or just write and execute files/commands. http://cloudinit.readthedocs.io/en/latest/topics/datasources/ovf.html You have mentioned CoreOS which supports VMware Guestinfo interface. https://coreos.com/os/docs/latest/booting-on-vmware.html

Pafnut
  • 51
  • 4
  • How can I make specifying this mandatory? Under the Property tag, if I set ovf:required="true" doesn't seem to make it mandatory to specify a value – dozer Jun 26 '18 at 05:29