Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I know it's an old post, but just because this one came up in google and I don't want to leave it unanswered.

"One use case for using the configuration drive is to pass a networking configuration when you do not use DHCP to assign IP addresses to instances. For example, you might pass the IP address configuration for the instance through the configuration drive, which the instance can mount and access before you configure the network settings for the instance." https://docs.openstack.org/user-guide/cli-config-drive.html

You can actually set:

crudini --set /etc/nova/nova.conf DEFAULT injected_network_template /usr/lib/python2.7/site-packages/nova/virt/interfaces.template
crudini --set /etc/nova/nova.conf DEFAULT flat_injected true
crudini --set /etc/nova/nova.conf DEFAULT force_config_drive true
crudini --set /etc/nova/nova.conf DEFAULT config_drive_cdrom True
crudini --set /etc/nova/nova.conf DEFAULT debug true
crudini --set /etc/nova/nova.conf DEFAULT use_ipv6 true
crudini --set /etc/nova/nova.conf os_vif_linux_bridge use_ipv6 true
crudini --set /etc/nova/nova.conf libvirt inject_partition -1

Make sure that DHCP is disabled on all subnets that the instance attaches to or it won't work:

neutron subnet-update provider1-subnet --disable-dhcp

I know it's an old post, but just because this one came up in google and I don't want to leave it unanswered.

"One use case for using the configuration drive is to pass a networking configuration when you do not use DHCP to assign IP addresses to instances. For example, you might pass the IP address configuration for the instance through the configuration drive, which the instance can mount and access before you configure the network settings for the instance." https://docs.openstack.org/user-guide/cli-config-drive.html

You can actually set:set (on all computes and controllers):

crudini --set /etc/nova/nova.conf DEFAULT injected_network_template /usr/lib/python2.7/site-packages/nova/virt/interfaces.template
crudini --set /etc/nova/nova.conf DEFAULT flat_injected true
crudini --set /etc/nova/nova.conf DEFAULT force_config_drive true
crudini --set /etc/nova/nova.conf DEFAULT config_drive_cdrom True
crudini --set /etc/nova/nova.conf DEFAULT debug true
crudini --set /etc/nova/nova.conf DEFAULT use_ipv6 true
crudini --set /etc/nova/nova.conf os_vif_linux_bridge use_ipv6 true
crudini --set /etc/nova/nova.conf libvirt inject_partition -1

Then, restart all nova services on all computes and controllers.

Make sure that DHCP is disabled on all subnets that the instance attaches to or it won't work:

neutron subnet-update provider1-subnet --disable-dhcp

I know it's an old post, but just because this one came up in google and I don't want to leave it unanswered.

"One use case for using the configuration drive is to pass a networking configuration when you do not use DHCP to assign IP addresses to instances. For example, you might pass the IP address configuration for the instance through the configuration drive, which the instance can mount and access before you configure the network settings for the instance." https://docs.openstack.org/user-guide/cli-config-drive.html

You can actually set (on all computes and controllers):

crudini --set /etc/nova/nova.conf DEFAULT injected_network_template /usr/lib/python2.7/site-packages/nova/virt/interfaces.template
crudini --set /etc/nova/nova.conf DEFAULT flat_injected true
crudini --set /etc/nova/nova.conf DEFAULT force_config_drive true
crudini --set /etc/nova/nova.conf DEFAULT config_drive_cdrom True
crudini --set /etc/nova/nova.conf DEFAULT debug true
crudini --set /etc/nova/nova.conf DEFAULT use_ipv6 true
crudini --set /etc/nova/nova.conf os_vif_linux_bridge use_ipv6 true
crudini --set /etc/nova/nova.conf libvirt inject_partition -1

Then, restart all nova services on all computes and controllers.

Make sure that DHCP is disabled on all subnets that the instance attaches to or it won't work:

neutron subnet-update provider1-subnet --disable-dhcp

If this still doesn't work, from the instance console, you can mount /dev/sr0 to /mnt and then search for network-data.json and verify if it holds the network information. Cloud-init should read that and configure the network accordingly.