The flag is actually is defined twice. I'm not sure why it is redefined in vmwareapi_net.py.
I'm not sure if this is a naming conflict or the author was simply trying to change the default value of the flag. In any case, here is a possible fix:
On May 25, 2011, at 8:51 AM, Edouard Thuleau wrote:
> I try again with nova-compute rev1108 but the bug persists.
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/787657
>
> Title:
> VMware vlan_interface flag defined txice
>
> Status in OpenStack Compute (Nova):
> Triaged
>
> Bug description:
> Hi,
>
> I use Nova (bzr1101) with an ESXi 4.1 hypervisor.
> I set the flag 'vlan_interface' inm y configuration file but Nova didn't start and log says :
>
>
> 2011-05-24 18:10:38,728 ERROR nova [-] in Service.create()
> (nova): TRACE: Traceback (most recent call last):
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 267, in serve
> (nova): TRACE: services = [Service.create()]
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 164, in create
> (nova): TRACE: report_interval, periodic_interval)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 69, in __init__
> (nova): TRACE: self.manager = manager_class(host=self.host, *args, **kwargs)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 132, in __init__
> (nova): TRACE: self.network_manager = utils.import_object(FLAGS.network_manager)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/utils.py", line 73, in import_object
> (nova): TRACE: return cls()
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/network/manager.py", line 123, in __init__
> (nova): TRACE: self.driver = utils.import_object(network_driver)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/utils.py", line 69, in import_object
> (nova): TRACE: __import__(import_str)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/network/vmwareapi_net.py", line 34, in <module>
> (nova): TRACE: 'Physical network adapter name in VMware ESX host for '
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/flags.py", line 215, in _wrapped
> (nova): TRACE: func(*args, **kw)
> (nova): TRACE: File "/usr/lib/python2.6/dist-packages/gflags.py", line 1808, in DEFINE_string
> (nova): TRACE: DEFINE(parser, name, default, help, flag_values, serializer, **args)
> (nova): TRACE: File "/usr/lib/python2.6/dist-packages/gflags.py", line 1701, in DEFINE
> (nova): TRACE: flag_values)
> (nova): TRACE: File "/usr/lib/python2.6/dist-packages/gflags.py", line 1716, in DEFINE_flag
> (nova): TRACE: fv[flag.name] = flag
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/flags.py", line 131, in __setitem__
> (nova): TRACE: gflags.FlagValues.__setitem__(self, name, flag)
> (nova): TRACE: File "/usr/lib/python2.6/dist-packages/gflags.py", line 791, in __setitem__
> (nova): TRACE: raise DuplicateFlagError(name, self)
> (nova): TRACE: DuplicateFlagError: The flag 'vlan_interface' is defined twice. First from nova.network.manager, Second from nova.network.vmwareapi_net
> (nova): TRACE:
> 2011-05-24 18:10:38,750 CRITICAL nova [-] The flag 'vlan_interface' is defined twice. First from nova.network.manager, Second from nova.network.vmwareapi_net
>
> If I comment lines in source file 'nova/network/vmwareapi_net.py', it works correctly:
> flags.DEFINE_string('vlan_interface', 'vmnic0',
> 'Physical network adapter name in VMware ESX host for '
> 'vlan networking')
The flag is actually is defined twice. I'm not sure why it is redefined in vmwareapi_net.py.
I'm not sure if this is a naming conflict or the author was simply trying to change the default value of the flag. In any case, here is a possible fix:
=== modified file 'nova/network/ vmwareapi_ net.py' vmwareapi_ net.py 2011-05-11 19:24:01 +0000 vmwareapi_ net.py 2011-05-25 18:13:39 +0000
--- nova/network/
+++ nova/network/
@@ -30,9 +30,7 @@
FLAGS = flags.FLAGS DEFINE_ string( 'vlan_interface ', 'vmnic0', 'vlan_interface '].SetDefault( 'vmnic0' )
-flags.
- 'Physical network adapter name in VMware ESX host for '
- 'vlan networking')
+FLAGS[
def ensure_ vlan_bridge( vlan_num, bridge, net_attrs=None):
Vish
On May 25, 2011, at 8:51 AM, Edouard Thuleau wrote:
> I try again with nova-compute rev1108 but the bug persists. /bugs.launchpad .net/bugs/ 787657 pymodules/ python2. 6/nova/ service. py", line 267, in serve pymodules/ python2. 6/nova/ service. py", line 164, in create pymodules/ python2. 6/nova/ service. py", line 69, in __init__ class(host= self.host, *args, **kwargs) pymodules/ python2. 6/nova/ compute/ manager. py", line 132, in __init__ manager = utils.import_ object( FLAGS.network_ manager) pymodules/ python2. 6/nova/ utils.py" , line 73, in import_object pymodules/ python2. 6/nova/ network/ manager. py", line 123, in __init__ object( network_ driver) pymodules/ python2. 6/nova/ utils.py" , line 69, in import_object _(import_ str) pymodules/ python2. 6/nova/ network/ vmwareapi_ net.py" , line 34, in <module> pymodules/ python2. 6/nova/ flags.py" , line 215, in _wrapped python2. 6/dist- packages/ gflags. py", line 1808, in DEFINE_string python2. 6/dist- packages/ gflags. py", line 1701, in DEFINE python2. 6/dist- packages/ gflags. py", line 1716, in DEFINE_flag pymodules/ python2. 6/nova/ flags.py" , line 131, in __setitem__ FlagValues. __setitem_ _(self, name, flag) python2. 6/dist- packages/ gflags. py", line 791, in __setitem__ ror(name, self) manager, Second from nova.network. vmwareapi_ net manager, Second from nova.network. vmwareapi_ net vmwareapi_ net.py' , it works correctly: string( 'vlan_interface ', 'vmnic0',
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https:/
>
> Title:
> VMware vlan_interface flag defined txice
>
> Status in OpenStack Compute (Nova):
> Triaged
>
> Bug description:
> Hi,
>
> I use Nova (bzr1101) with an ESXi 4.1 hypervisor.
> I set the flag 'vlan_interface' inm y configuration file but Nova didn't start and log says :
>
>
> 2011-05-24 18:10:38,728 ERROR nova [-] in Service.create()
> (nova): TRACE: Traceback (most recent call last):
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: services = [Service.create()]
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: report_interval, periodic_interval)
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: self.manager = manager_
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: self.network_
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: return cls()
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: self.driver = utils.import_
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: __import_
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: 'Physical network adapter name in VMware ESX host for '
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: func(*args, **kw)
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: DEFINE(parser, name, default, help, flag_values, serializer, **args)
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: flag_values)
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: fv[flag.name] = flag
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: gflags.
> (nova): TRACE: File "/usr/lib/
> (nova): TRACE: raise DuplicateFlagEr
> (nova): TRACE: DuplicateFlagError: The flag 'vlan_interface' is defined twice. First from nova.network.
> (nova): TRACE:
> 2011-05-24 18:10:38,750 CRITICAL nova [-] The flag 'vlan_interface' is defined twice. First from nova.network.
>
> If I comment lines in source file 'nova/network/
> flags.DEFINE_
> 'Physical network adapter name in VMware ESX host for '
> 'vlan networking')