number5/cloud-init — pull request #1 by davejohnston (2013-11-01 10:09:10+00:00)
Title: Updated the DataSourceOVF.py to allow network interfaces to be configured

by properties in the OVF environment. This re-uses functions in distros
folder to configure the interfaces.

N.B the functions currently expect ubuntu style interface definitions i.e.

`network-interfaces: |
iface eth0 inet static
address 192.168.1.10
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
dns-nameservers 10.20.10.110 10.20.10.113
dns-search mydomain.com
dns-domain mydomain.com
iface eth1 inet static
address 192.168.1.11
netmask 255.255.255.0`

This isn't easy to represent as a single property, so instead indvidual properties
with the correct format define an interface. i.e. to define an interface add a property

`network.interface.0 = eth0`

to configure that interface add the following properties

`network.eth0.address = 192.168.1.10
network.eth0.netmask = 255.255.0.0
network.eth0.gateway = 192.168.1.255
network.eth0.dns-nameservers = 10.20.10.110 10.20.10.113`

Multiple interfaces maybe defined. N.B when using a vApp with multiple VMs the properties maybe
qualified by the entity id. In this case the ovf environment generated would actually look like:

`network.eth0.address.mymachineid
network.eth0.netmask.mymachineid`

The code will check if the entity id is set, and strip it off, so either format will work.

1) Example of generated ovf environment with entitiy id

`

VMware ESXi
5.1.0
VMware, Inc.
en

`

2) Example of generated ovf environment without the entity id

`

VMware ESXi
5.1.0
VMware, Inc.
en

`

Finally the corropsonding property section of the ovf file itself

`
Information about the installed software

network.interface

network.eth0.address

Netmask 1
The Netmask of interface 1

...
...
`

It looks like the entity id is only set when the OVF is a vApp. If it is a single OVF, it will not be used.