When using Quantum, Nova injects static config for dynamic networks

Bug #1163985 reported by Ben Nemec
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Ben Nemec

Bug Description

When I set flat_injected to true to enable network config injection in Nova, I get static configurations injected even for subnets that are using DHCP. Nova-network does not do this, and I don't believe Quantum should either.

For example, when booting a VM using the following network:
+------------------+--------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.1.1.2", "end": "10.1.1.254"} |
| cidr | 10.1.1.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.1.1.1 |
| host_routes | |
| id | 8e785b95-af88-4444-b067-3bbc0385f791 |
| ip_version | 4 |
| name | |
| network_id | c0cbf362-a2f8-4792-97e1-a9abd464c100 |
| tenant_id | 51212554931246fd85a96351eae2d112 |
+------------------+--------------------------------------------+

I get this configuration injected through config-drive:
auto eth1
iface eth1 inet static
   address 10.1.1.2
   netmask 255.255.255.0
   broadcast 10.1.1.255
   gateway 10.1.1.1

I have a proposed fix for this, which I will submit for review shortly.

Ben Nemec (bnemec)
Changed in nova:
assignee: nobody → Ben Nemec (bnemec)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/26012

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/26012
Committed: http://github.com/openstack/nova/commit/2807ea5464e610b4ac77d95f9216b86b5f36bde0
Submitter: Jenkins
Branch: master

commit 2807ea5464e610b4ac77d95f9216b86b5f36bde0
Author: Ben Nemec <email address hidden>
Date: Mon May 13 23:06:11 2013 +0000

    Don't inject settings for dynamic network

    When using Quantum for networking and setting flat_injected to
    inject network settings into the guest VM, Nova injects a static
    network configuration for networks using DHCP. This change
    checks for the existence of a dhcp server and, if found, does not
    inject static settings for that network.

    Due to limitations of the legacy network info, the fix only
    applies when new-style network info is passed to the injection
    template function. The only code still passing in legacy
    network info is in libvirt, and there is work ongoing to
    remove that dependency.

    Fixes bug 1163985
    Fixes bug 1112659

    Change-Id: I8d3f16bde22e1c6dc0d2432aa263e2b15ae5c93a

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.