undefined method vlan? for vs_port on Ubuntu

Bug #1554096 reported by Matt Fischer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-vswitch
Fix Released
High
Unassigned

Bug Description

This bug is either here or in vswitch. I have a setup that was working on liberty, but this morning I moved all my references to master (mitaka) and also my UCA pointer to mitaka. I now see this issue related to ovs ports and the vs_port resource:

Error: Could not set 'present' on ensure: undefined method `vlan?' for Vs_port[eth1](provider=ovs):Puppet::Type::Vs_port::ProviderOvs at 7:/etc/puppet/modules/neutron/manifests/plugins/ovs/port.pp
Error: Could not set 'present' on ensure: undefined method `vlan?' for Vs_port[eth1](provider=ovs):Puppet::Type::Vs_port::ProviderOvs at 7:/etc/puppet/modules/neutron/manifests/plugins/ovs/port.pp
Wrapped exception:
undefined method `vlan?' for Vs_port[eth1](provider=ovs):Puppet::Type::Vs_port::ProviderOvs
Error: /Stage[main]/Neutron::Agents::Ml2::Ovs/Neutron::Plugins::Ovs::Port[br-ex:eth1]/Vs_port[eth1]/ensure: change from absent to present failed: Could not set 'present' on ensure: undefined method `vlan?' for Vs_port[eth1](provider=ovs):Puppet::Type::Vs_port::ProviderOvs at 7:/etc/puppet/modules/neutron/manifests/plugins/ovs/port.pp
Debug: Exec[eth1 up](provider=posix): Executing 'ip link set eth1 up'
Debug: Executing 'ip link set eth1 up'
Notice: /Stage[main]/Deployments::Profile::Neutron/Exec[eth1 up]/returns: Cannot find device "eth1"
Error: /Stage[main]/Deployments::Profile::Neutron/Exec[eth1 up]: Failed to call refresh: ip link set eth1 up returned 1 instead of one of [0]
Error: /Stage[main]/Deployments::Profile::Neutron/Exec[eth1 up]: ip link set eth1 up returned 1 instead of one of [0]

Here is the hiera that I used to produce this issue:

extnet_device: &extnet_device 'eth1'
neutron::agents::ml2::ovs::bridge_uplinks:
 - "br-ex:%{hiera('extnet_device')}"
neutron::agents::ml2::ovs::bridge_mappings:
 - "external:br-ex"

Matt Fischer (mfisch)
description: updated
Revision history for this message
Emilien Macchi (emilienm) wrote :

It sounds like something related to https://github.com/openstack/puppet-vswitch/commit/1b310a53189898e3690bc2d8f00aafd6c87959d2

I'm not sure puppet-neutron has something to deal with that.

no longer affects: puppet-neutron
Changed in puppet-vswitch:
status: New → Confirmed
Revision history for this message
Emilien Macchi (emilienm) wrote :

could you provide more logs with --trace option please? I can't reproduce it.

Revision history for this message
Matt Fischer (mfisch) wrote :
Download full text (10.3 KiB)

Here you go:

Debug: /Stage[main]/Vswitch::Ovs/Package[openvswitch-switch]: The container Class[Vswitch::Ovs] will propagate my refresh event
Debug: Executing '/sbin/status openvswitch-switch'
Debug: Executing '/sbin/initctl --version'
Debug: Class[Vswitch::Ovs]: The container Stage[main] will propagate my refresh event
Debug: Executing '/usr/bin/ovs-vsctl br-exists br-ex'
Debug: Executing '/usr/bin/ovs-vsctl add-br br-ex'
Debug: Executing '/sbin/ip link set br-ex up'
Notice: /Stage[main]/Neutron::Agents::Ml2::Ovs/Neutron::Plugins::Ovs::Bridge[external:br-ex]/Vs_bridge[br-ex]/ensure: created
Debug: /Stage[main]/Neutron::Agents::Ml2::Ovs/Neutron::Plugins::Ovs::Bridge[external:br-ex]/Vs_bridge[br-ex]: The container Neutron::Plugins::Ovs::Bridge[external:br-ex] will propagate my refresh event
Debug: Neutron::Plugins::Ovs::Bridge[external:br-ex]: The container Class[Neutron::Agents::Ml2::Ovs] will propagate my refresh event
Info: Neutron::Plugins::Ovs::Bridge[external:br-ex]: Scheduling refresh of Exec[eth1 up]
Debug: Executing '/usr/bin/ovs-vsctl list-ports br-ex'
Debug: Executing '/usr/bin/ovs-vsctl -- --id=@iface0 create Interface name=eth1 -- add-port br-ex eth1 interfaces=@iface0'
Error: Could not set 'present' on ensure: undefined method `vlan?' for Vs_port[eth1](provider=ovs):Puppet::Type::Vs_port::ProviderOvs at 7:/etc/puppet/modules/neutron/manifests/plugins/ovs/port.pp
/etc/puppet/modules/vswitch/lib/puppet/provider/vs_port/ovs.rb:36:in `create'
/usr/lib/ruby/vendor_ruby/puppet/property/ensure.rb:16:in `block in defaultvalues'
/usr/lib/ruby/vendor_ruby/puppet/property.rb:197:in `call_valuemethod'
/usr/lib/ruby/vendor_ruby/puppet/property.rb:498:in `set'
/usr/lib/ruby/vendor_ruby/puppet/property.rb:581:in `sync'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:191:in `sync'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:128:in `sync_if_needed'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:81:in `perform_changes'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:20:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:174:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:187:in `eval_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `call'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `block (2 levels) in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:327:in `block in thinmark'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:326:in `thinmark'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `block in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:108:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:164:in `block in apply'
/usr/lib/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
/usr/lib/ruby/vendor_ruby/puppet/transaction/report.rb:108:in `as_logging_destination'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:163:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:125:in `block in apply_catalog'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `blo...

Revision history for this message
Matt Fischer (mfisch) wrote :

This only happens on the first run. I'm digging into more.

Revision history for this message
Matt Fischer (mfisch) wrote :

There is no subclass for ubuntu so vlan? is never defined. This breaks this code.

summary: - undefined method vlan? for vs_port
+ undefined method vlan? for vs_port on Ubuntu
Revision history for this message
Matt Fischer (mfisch) wrote :

Whats confusing is that the ovs.rb on the liberty branch is like 2 years old. I dont know how that happened, then master includes a ton of new code.

Compare Liberty:
https://github.com/openstack/puppet-vswitch/blob/stable/liberty/lib/puppet/provider/vs_port/ovs.rb

with Master:
https://github.com/openstack/puppet-vswitch/blob/master/lib/puppet/provider/vs_port/ovs.rb

I'm going to work around this by not using master/mitaka for vswitch. The code is broken for Ubuntu.

Cody Herriges (ody-cat)
Changed in puppet-vswitch:
importance: Undecided → High
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

The quite similar problem was fixed by https://review.opendev.org/c/openstack/puppet-vswitch/+/292390 . Please feel free to reopen this in case you still hit the problem even with the recent versions.

Changed in puppet-vswitch:
status: Confirmed → Fix Released
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.