New Question

Revision history [back]

Hi,

In short, the networkconfig plugin will take automatically the network info from metadata and will statically configure each interface inside the instance. But for this to happen, you must keep in mind two things: the DHCP on the subnet attached to the private network must be disabled and the flat network injection must be enabled. To enable flat injection, just add the entry "flat_injected=True" to /etc/nova/nova.conf under the DEFAULT group. To disable the DHCP, you can use the interface/dashboard to untick the DHCP checkbox by editing the subnet on the private network, or you can simply use the --disable-dhcp option with the neutron subnet-update/create command.

What happens next: Nova will see that DHCP is disabled and injection is allowed, so will gather network information using the networking driver. This info is handled by virt (netutils) and used to fill in a debian-interfaces-like template which will be exposed as a metadata content pointed out by the metadata json key "networkconfig". The networkconfig plugin from cloudbase-init finds the key, then searches further for the "contentpath", then reads the entire content from that path which is very similar to /etc/network/interfaces file from debian systems. For each available NIC in the instance, there's also an eth<n> entry and for each entry, there's a set of network details as address, netmask, gateway, broadcast, dns, mac etc. Finally, using these details, each corresponding network interface from the instance is configured statically.

For extra setting, you could use a powershell script passed as userdata, just to configure what you want as you want. The userdata could be provided from the interface when creating the instance by wizzard or with --user-data option under nova boot command. Don't forget to put as a first line the comment "#ps1" or "#ps1_x86" indicating that will follow a powershell script.

Hope this will answer your question(s) :).

Hi,

In short, the networkconfig plugin will take automatically the network info from metadata and will statically configure each interface inside the instance. But for this to happen, you must keep in mind two things: the DHCP on the subnet attached to the private network must be disabled and the flat network injection must be enabled. To enable flat injection, just add the entry "flat_injected=True" to /etc/nova/nova.conf under the DEFAULT group. To disable the DHCP, you can use the interface/dashboard to untick the DHCP checkbox by editing the subnet on the private network, or you can simply use the --disable-dhcp option with the neutron subnet-update/create command.

What happens next: Nova will see that DHCP is disabled and injection is allowed, so will gather network information using the networking driver. This info is handled by virt (netutils) and used to fill in a debian-interfaces-like template which will be exposed as a metadata content pointed out by the metadata json key "networkconfig". "network_config". The networkconfig plugin from cloudbase-init finds the key, then searches further for the "contentpath", "content_path", then reads the entire content from that path which is very similar to /etc/network/interfaces file from debian systems. For each available NIC in the instance, there's also an eth<n> entry and for each entry, there's a set of network details as address, netmask, gateway, broadcast, dns, mac etc. Finally, using these details, each corresponding network interface from the instance is configured statically.

For extra setting, you could use a powershell script passed as userdata, just to configure what you want as you want. The userdata could be provided from the interface when creating the instance by wizzard or with --user-data option under nova boot command. Don't forget to put as a first line the comment "#ps1" or "#ps1_x86" indicating that will follow a powershell script.

Hope this will answer your question(s) :).

Hi,

In short, the networkconfig plugin will take automatically the network info from metadata and will statically configure each interface inside the instance. But for this to happen, you must keep in mind two things: the DHCP on the subnet attached to the private network must be disabled and the flat network injection must be enabled. To enable flat injection, just add the entry "flat_injected=True" to /etc/nova/nova.conf under the DEFAULT group. To disable the DHCP, you can use the interface/dashboard to untick the DHCP checkbox by editing the subnet on the private network, network or you can simply use the --disable-dhcp option with the neutron subnet-update/create command.

What happens next: Nova will see that DHCP is disabled and injection is allowed, so will gather network information using the networking driver. This info is handled by virt (netutils) and used to fill in a debian-interfaces-like template which will be exposed as a metadata content pointed out by the metadata json key "network_config". The networkconfig plugin from cloudbase-init finds the key, then searches further for the "content_path", then reads the entire content from that path which is very similar to /etc/network/interfaces file from debian systems. For each available NIC in the instance, there's also an eth<n> entry and for each entry, there's a set of network details as address, netmask, gateway, broadcast, dns, mac etc. Finally, using these details, each corresponding network interface from the instance is configured statically.

For extra setting, you could use a powershell script passed as userdata, just to configure what you want as you want. The userdata could be provided from the interface when creating the instance by wizzard or with --user-data option under nova boot command. Don't forget to put as a first line the comment "#ps1" or "#ps1_x86" indicating that will follow a powershell script.

Hope this will answer your question(s) :).