← Back to team overview

openstack team mailing list archive

Re: [OpenStack] Remove unsed network on host with nova-network

 

Hi Vish,

I made a patch to implement that with the VLAN manager:
https://review.openstack.org/#/c/17352/

I put a lock on methods '_setup_network_on_host' and
'_teardown_network_on_host' of class 'VlanManager' and I reused (and
renamed) the locks already defined in class 'LinuxBridgeInterfaceDriver'
when a bridge or VLAN is created ('ensure_vlan' => 'lock_vlan' and
'unsure_bridge' => 'lock_bridge'). Do you think is enough to prevent any
race condition ?

I've got a bug. I create method '_remove_dnsmasq_accept_rules' to remove
filter rules for DHCP server but when I call it, nothing is deleted. Could
you help me to resolve that ? And I've got the same problem sometimes with
method 'remove_isolate_dhcp_address'. The ebtables rules are correctly
deleted but not  for iptables rules.

I didn't delete a network bridge if it handles VPN forward rules of the
private network even if no VM use this gateway on the host. But if a
network is deleted, nothing will tear down this gateway.
I think I found another bug. If network host must handle the VPN forward
rules for a private network and if we restart it, it should instantiate a
gateway on this private network and add VPN forward rules even if no VM use
this gateway on the host. But actually  it doesn't do that. Perhaps, the
method 'db.network_get_all_by_host' use in 'init-host' must return the
network in this case ?

I only implement this for the multi hosted networks with the VLAN manger. I
think isn't useful to add this on the multi hosted network with the Flat
DHCP manager because, in this mode, only one multi hosted network is
created for all instances of all tenants.

Regards,
Édouard.

On Wed, Nov 21, 2012 at 12:49 AM, Vishvananda Ishaya <vishvananda@xxxxxxxxx>
wrote:
> The only reason this is not done is that it makes the setup simpler. We
> don't have to worry about potential races between setting up and tearing
> down interfaces. It probably wouldn't be incredibly difficult to make a
> patch that would remove them, but you will likely have to do some creative
> locking to make sure that you don't run into issues.
>
> Vish
>
> On Nov 20, 2012, at 9:25 AM, Édouard Thuleau <thuleau@xxxxxxxxx> wrote:
>
>> Hi all,
>>
>> I use nova-network with VLAN manager.
>>
>> Why nova-network doesn't remove unused network interfaces on a host ?
>>
>> ie, if none VM on a host have a fixed IP attach to network X, the VLAN
>> and bridge of this network still up and unused. And 'dnsmasq' process
>> still listen and running.
>>
>> The number of unused network interfaces will grow over time.
>> In the VLAN mode, this number could be 4000 x 2 unused interfaces and
>> 4000 unused 'dnsmasq' processes (in worth case).
>>
>> Can it lead to decrease the kernel performance ?
>> Is it a bug ? Or a voluntary implementation ?
>>
>> Regards,
>> Édouard.
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openstack
>> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~openstack
>> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References