Merge lp:~soren/nova/network-fixes into lp:~hudson-openstack/nova/trunk
Status: | Merged |
---|---|
Approved by: | Soren Hansen |
Approved revision: | 304 |
Merged at revision: | 317 |
Proposed branch: | lp:~soren/nova/network-fixes |
Merge into: | lp:~hudson-openstack/nova/trunk |
Diff against target: |
202 lines (+64/-22) 5 files modified
nova/db/api.py (+12/-0) nova/db/sqlalchemy/api.py (+12/-0) nova/network/linux_net.py (+30/-20) nova/network/manager.py (+8/-0) nova/tests/network_unittest.py (+2/-2) |
To merge this branch: | bzr merge lp:~soren/nova/network-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Todd Willey (community) | Approve | ||
Vish Ishaya (community) | Approve | ||
Review via email: mp+36700@code.launchpad.net |
Description of the change
Fixes to address the following issues:
* nova-network no longer refrains from configuring bridges if it finds them already created. This solves a race condition with nova-network and nova-compute running on the same box. If nova-compute happened to do its network config first, nova-network would find the bridge already created and assume it was correctly setup. If nova-network got there first, it would apply the correct IP configuration to the interface. The assumption is that no harm will be done by reapplying the correct IP configuration, so we no longer make this check before doing so.
* nova-network does not use persistent network configuration (like putting stuff in /etc/network/
* If installed, dnsmasq wouldn't find nova-dhcpbridge properly (it would look for it in /usr/lib/
* dnsmasq needs to be able to read the dhcp config written by nova. dnsmasq runs as user "nobody", so chmod 644 the config file so that it can be read.
* dnsmasq needs to be sent a SIGHUP to reread its config. Wrap this call in sudo, because we may be running as non-root.
This looks good. One issue:
We have a couple different solutions in the works for applying network configuration at service boot. In the branch I am working on lp:~vishvananda/nova/fix-iptables which fixes a number of isssues in devcamcar's version that is under review, we have added an explicitly called init_host() which is called when the manager is loaded from service.py. I don't want init to happen in two places, so we should move one or the other. Preference on whether we do it in init or an explicit method?
On Sep 27, 2010, at 4:57 AM, Soren Hansen wrote:
> Soren Hansen has proposed merging lp:~soren/nova/network-fixes into lp:nova. interfaces) , so it needs to check at boot time whether it's already set as a network's designated network node and do the appropriate configuration. python2. 6/blahblahblha) . Add a flag to specify its location (and make use of it in the packaging). /code.launchpad .net/~soren/ nova/network- fixes/+ merge/36700 update( context, volume_id, values) ####### ###### networks( context, host): get_networks( context, host) sqlalchemy/ api.py' sqlalchemy/ api.py 2010-09-23 19:31:17 +0000 sqlalchemy/ api.py 2010-09-27 11:57:40 +0000 ref.save( session= session) ####### ###### networks( context, host): query(models. Network by(deleted= False by(host= host
>
> Requested reviews:
> Nova Core (nova-core)
>
>
> Fixes to address the following issues:
>
> * nova-network no longer refrains from configuring bridges if it finds them already created. This solves a race condition with nova-network and nova-compute running on the same box. If nova-compute happened to do its network config first, nova-network would find the bridge already created and assume it was correctly setup. If nova-network got there first, it would apply the correct IP configuration to the interface. The assumption is that no harm will be done by reapplying the correct IP configuration, so we no longer make this check before doing so.
>
> * nova-network does not use persistent network configuration (like putting stuff in /etc/network/
>
> * If installed, dnsmasq wouldn't find nova-dhcpbridge properly (it would look for it in /usr/lib/
>
> * dnsmasq needs to be able to read the dhcp config written by nova. dnsmasq runs as user "nobody", so chmod 644 the config file so that it can be read.
> --
> https:/
> Your team Nova Core is requested to review the proposed merge of lp:~soren/nova/network-fixes into lp:nova.
> === modified file 'nova/db/api.py'
> --- nova/db/api.py 2010-09-23 19:31:17 +0000
> +++ nova/db/api.py 2010-09-27 11:57:40 +0000
> @@ -554,3 +554,15 @@
>
> """
> return IMPL.volume_
> +
> +
> +######
> +
> +
> +def host_get_
> + """Return all networks for which the given host is the designated
> + network host
> + """
> + return IMPL.host_
> +
> +
>
> === modified file 'nova/db/
> --- nova/db/
> +++ nova/db/
> @@ -848,3 +848,15 @@
> for (key, value) in values.iteritems():
> volume_ref[key] = value
> volume_
> +
> +
> +######
> +
> +
> +def host_get_
> + session = get_session()
> + with session.begin():
> + return session.
> + ).filter_
> + ).filter_
> + ...