Ask Your Question

Instance IP configuration without DHCP

asked 2015-11-22 15:18:48 -0500

satish.lx gravatar image

Its very stupid question but just want to make sure whether it is possible or not. I have openstack running with FLAT networking without DHCP agent. I have all VM directly connected to existing network in bridging mode. I have configured IP POOL 10 IPs. when i launch instance Openstack assigned IP to VM and configured all iptables & security rules. but on VM i have to configured that IP manually because i don't have DHCP.

Is there any method when my instance launch it use API or whatever method to obtain its IP from openstack and configure ifcfg-eth0 file so i don't need configure IP manually :(

is it possible with cloud-init ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-07 12:44:53 -0500

akaris gravatar image

updated 2017-06-07 12:46:55 -0500

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."

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.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-11-22 15:18:48 -0500

Seen: 2,505 times

Last updated: Jun 07 '17