All of lore.kernel.org
 help / color / mirror / Atom feed
* How to stop XenD creating bridge devices on startup?
@ 2007-07-23  3:26 Daniel P. Berrange
  2007-07-25 15:07 ` Luiz Vitor Martinez Cardoso
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2007-07-23  3:26 UTC (permalink / raw)
  To: xen-devel

Prior to starting XenD I have a single bridge device 'eth0' containing a
physical interface 'peth0':

  # brctl show
  bridge name     bridge id               STP enabled     interfaces
  eth0            8000.00161745105a       no              peth0

The /etc/xen/xend-config.sxp is configured to a no-op network-script config,
and yet when I start XenD:

  # /etc/init.d/xend start
  Starting xend:                                             [  OK  ]

It still feels the need to create a whole bunch of bridge devices...

  # brctl show
  bridge name     bridge id               STP enabled     interfaces
  eth0            8000.00161745105a       no              peth0
  virbr0          8000.000000000000       no
  virbr1          8000.000000000000       no
  vnet0           8000.000000000000       no

These bridge devices it is creating correspond to bridge devices I had 
previously configured on the host, but since deleted. XenD happily
re-creates them every time it starts.

This problem is pretty repeatable, if you simply define a bridge and
then start & stop Xen

  # brctl addbr foo
  # /etc/init.d/xend start
  Starting xend:                                             [  OK  ]
  # /etc/init.d/xend stop
  Stopping xend:                                             [  OK  ]

Now delete the bridge and start Xend again

  # brctl delbr foo
  # /etc/init.d/xend start
  Starting xend:                                             [  OK  ]

Low and behold it has re-created the bridge

  # brctl show | grep foo
  foo             8000.000000000000       no

This is seriously unhelpful behaviour, the only way to kill it seems to be
to stop XenD and then hand edit its persistent state file.

The problem code is in XendNode.py

        bridges = Brctl.get_state().keys()
        configured_bridges = [XendAPIStore.get(
                                  network_uuid, "network")
                                      .get_name_label()
                              for network_uuid in XendNetwork.get_all()]
        unconfigured_bridges = [bridge
                                for bridge in bridges
                                if bridge not in configured_bridges]
        for unconfigured_bridge in unconfigured_bridges:
            XendNetwork.create_phy(unconfigured_bridge)

This re-creates asks brctl for a list of all devices, records all their 
names and then re-creates any it previously saw, but which no longer
exist. In essence once XenD has seen a bridge you can never remove it.
IMHO, any devices XenD sees from 'brctl' need to be marked as 'transient'
in some way and not kept in XenD persistent state file - it should only 
be re-creating bridges that the user created via XenD's APIs

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to stop XenD creating bridge devices on startup?
  2007-07-23  3:26 How to stop XenD creating bridge devices on startup? Daniel P. Berrange
@ 2007-07-25 15:07 ` Luiz Vitor Martinez Cardoso
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Vitor Martinez Cardoso @ 2007-07-25 15:07 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: xen-devel

Hi,

Bridge creating is enabled in xen-config.sxp

Comment this lines

#(network-script 'network-bridge netdev=eth1')
#(network-script network-bridge)

And uncomment this line:

(network-script network-dummy)

Regards,
Luiz Vitor Martinez Cardoso (Grabber)


Em Mon, 23 Jul 2007 04:26:37 +0100
"Daniel P. Berrange" <berrange@redhat.com> escreveu:

> Prior to starting XenD I have a single bridge device 'eth0' containing a
> physical interface 'peth0':
> 
>   # brctl show
>   bridge name     bridge id               STP enabled     interfaces
>   eth0            8000.00161745105a       no              peth0
> 
> The /etc/xen/xend-config.sxp is configured to a no-op network-script config,
> and yet when I start XenD:
> 
>   # /etc/init.d/xend start
>   Starting xend:                                             [  OK  ]
> 
> It still feels the need to create a whole bunch of bridge devices...
> 
>   # brctl show
>   bridge name     bridge id               STP enabled     interfaces
>   eth0            8000.00161745105a       no              peth0
>   virbr0          8000.000000000000       no
>   virbr1          8000.000000000000       no
>   vnet0           8000.000000000000       no
> 
> These bridge devices it is creating correspond to bridge devices I had 
> previously configured on the host, but since deleted. XenD happily
> re-creates them every time it starts.
> 
> This problem is pretty repeatable, if you simply define a bridge and
> then start & stop Xen
> 
>   # brctl addbr foo
>   # /etc/init.d/xend start
>   Starting xend:                                             [  OK  ]
>   # /etc/init.d/xend stop
>   Stopping xend:                                             [  OK  ]
> 
> Now delete the bridge and start Xend again
> 
>   # brctl delbr foo
>   # /etc/init.d/xend start
>   Starting xend:                                             [  OK  ]
> 
> Low and behold it has re-created the bridge
> 
>   # brctl show | grep foo
>   foo             8000.000000000000       no
> 
> This is seriously unhelpful behaviour, the only way to kill it seems to be
> to stop XenD and then hand edit its persistent state file.
> 
> The problem code is in XendNode.py
> 
>         bridges = Brctl.get_state().keys()
>         configured_bridges = [XendAPIStore.get(
>                                   network_uuid, "network")
>                                       .get_name_label()
>                               for network_uuid in XendNetwork.get_all()]
>         unconfigured_bridges = [bridge
>                                 for bridge in bridges
>                                 if bridge not in configured_bridges]
>         for unconfigured_bridge in unconfigured_bridges:
>             XendNetwork.create_phy(unconfigured_bridge)
> 
> This re-creates asks brctl for a list of all devices, records all their 
> names and then re-creates any it previously saw, but which no longer
> exist. In essence once XenD has seen a bridge you can never remove it.
> IMHO, any devices XenD sees from 'brctl' need to be marked as 'transient'
> in some way and not kept in XenD persistent state file - it should only 
> be re-creating bridges that the user created via XenD's APIs
> 
> Dan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-25 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23  3:26 How to stop XenD creating bridge devices on startup? Daniel P. Berrange
2007-07-25 15:07 ` Luiz Vitor Martinez Cardoso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.