Bug 1066549 - openstack-puppet-modules: puppet fail deploy neutron-controller when vlan_range value without '#:#' .
Summary: openstack-puppet-modules: puppet fail deploy neutron-controller when vlan_ran...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-puppet-modules
Version: 4.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: z4
: 4.0
Assignee: Martin Magr
QA Contact: Omri Hochman
URL:
Whiteboard:
: 1078217 (view as bug list)
Depends On:
Blocks: 1040649
TreeView+ depends on / blocked
 
Reported: 2014-02-18 15:46 UTC by Omri Hochman
Modified: 2018-12-04 17:33 UTC (History)
12 users (show)

Fixed In Version: openstack-puppet-modules-2013.2-8.el6ost
Doc Type: Bug Fix
Doc Text:
Previously, openstack-puppet-modules required VLAN range values to be in the format 'ID:ID' or 'NETWORK:ID:ID'. As such, deploying neutron-controller through Puppet failed if an administrator supplied a VLAN range that did not strictly adhere to this format, regardless of whether the range was valid. With this release, Puppet will now accept a single ID, physical network name, or comma-separated list as valid values for VLAN range.
Clone Of:
Environment:
Last Closed: 2014-05-29 19:58:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
puppet-neutron patch (1.48 KB, patch)
2014-03-24 13:48 UTC, Martin Magr
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 74709 0 None None None Never
OpenStack gerrit 83366 0 None None None Never
Red Hat Product Errata RHBA-2014:0577 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform 4 Bug Fix and Enhancement Advisory 2014-05-29 23:55:40 UTC

Description Omri Hochman 2014-02-18 15:46:36 UTC
openstack-puppet-modules: puppet fail deploy neutron-controller when vlan_range value without '#:#' .


Environment (havana A2 2014-02-17.1): 
-------------
packstack-modules-puppet-2013.2.1-0.24.dev982.el6ost.noarch
openstack-foreman-installer-1.0.4-1.el6ost.noarch
puppet-3.2.4-3.el6_5.noarch
puppet-server-3.2.4-3.el6_5.noarch

Steps : 
--------
1) Install foreman-server.

2) Edit parameters of neutron-controller hostgroup --> set for ovs_vlan_range 'int_vlan_range:216:217,int_vlan_range:192' (or any number without :192:X) 

3) Attempt to run puppet on foreman-client from neutron-controller host group. (puppet agent -t -v)

Results:
---------
- Puppet failed to run - Error: network vlan ranges are invalid.

puppet agent -t -v ( output):
--------------------------------
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: network vlan ranges are invalid. on node puma02.scl.lab.tlv.redhat.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


Code:
-------
the validator code can be found at : (line 30) /usr/share/packstack/modules/neutron/lib/puppet/parser/functions/validate_network_vlan_ranges.rb


module Puppet::Parser::Functions
  newfunction(:validate_network_vlan_ranges) do |args|
    value = args[0]
    if not value.kind_of?(Array)
      value = [value]
    end

    value.each do |range|
      if m = /^(.+:)?(\d+):(\d+)$/.match(range)
        first_id = Integer(m[-2])
        second_id = Integer(m[-1])
        if (first_id > 4094) || (second_id > 4094)
          raise Puppet::Error, "vlan id are invalid."
        end
        if ((second_id - first_id) < 0 )
          raise Puppet::Error, "network vlan ranges are invalid."
        end
      elsif range
        raise Puppet::Error, "network vlan ranges are invalid."
      end
    end
  end
end

Comment 5 Omri Hochman 2014-03-19 09:16:51 UTC
Reproduce with :
-----------------
packstack-modules-puppet-2013.2.1-0.28.dev989.el6ost.noarch
openstack-foreman-installer-1.0.5-1.el6ost.noarch. 


From foreman_server UI - set the 'neutron-controller' host group , 'ovs_vlan_range' parameter  to :
int_vlan_range:216:217,int_vlan_range:192

run puppet -t -v : 
----------------------
Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: network vlan ranges are invalid. on node rhos-compute-node-03.lab.eng.rdu2.redhat.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Debug: report supports formats: b64_zlib_yaml pson raw yaml; using pson



** Note- When setting 'ovs_vlan_range' parameter to: int_vlan_range:216:217,int_vlan_range:192:192

run puppet -t -v : 
----------------------
There's no such an error.

Comment 8 Lon Hohberger 2014-03-20 17:00:59 UTC
Steve, this was impacting you - is it okay to simply work around by specifying the same # twice?

Comment 9 Steve Reichard 2014-03-20 19:27:29 UTC
When I don't specify the range it means I am not using a VLAN but flat networking. Since I am not using a vlan, I would assume setting a 1 number range would make it use a VLAN which I may not have configured.

Comment 10 Steve Reichard 2014-03-20 19:35:48 UTC
to be clear, the parameter this is check is not just used for VLANs but also for other network configuration.   This variable allow the creation of OVS physical devices.

So when I set up a to use VLANs for my data, I still use flat for my public provider network. i.e. "physint:900:910,physext"

Also when I setup to use GRE, VXLAN, I still use a flat provider net. Thus this is set to "physext"

Comment 11 Martin Magr 2014-03-24 13:48:35 UTC
Created attachment 878071 [details]
puppet-neutron patch

Comment 12 Martin Magr 2014-03-24 14:36:19 UTC
After some investigation it seems the problem with the value which Nir tested is that validation function expects array, but neutron::plugins::ovs puppet class expects string. This will have to be fixed. Anyway, vlan ranges values above should work with ML2 plugin. Will fix OVS plugin in A4. Sorry about that, I completely missed this bug.

Comment 14 Martin Magr 2014-03-27 13:15:04 UTC
Submitted patch upstream

Comment 15 Martin Magr 2014-03-27 14:34:52 UTC
So the validation passes with the patch from comment 14, but neutron-server is failing with following error:

2014-03-27 15:07:38.430 23242 ERROR neutron.plugins.openvswitch.ovs_neutron_plugin [-] Invalid network VLAN range: 'int_vlan_range:192' - 'need more than 2 values to unpack'. Server terminated!

Which concerns me a little bit. So either Neutron has to be fixed or we should get back to not allowing values of above type.

Comment 16 Jakub Libosvar 2014-03-27 14:38:55 UTC
'int_vlan_range:192' is invalid for network_vlan_range.

From the code: """Interpret a string as network[:vlan_begin:vlan_end]."""

So either "network" or "network:min:max" are valid values.

Comment 17 Martin Magr 2014-03-27 14:41:16 UTC
Great. Omri, where did you find out that you can use values such as 'int_vlan_range:192'?

Comment 18 Martin Magr 2014-03-28 14:51:45 UTC
*** Bug 1078217 has been marked as a duplicate of this bug. ***

Comment 19 Steve Reichard 2014-03-28 19:58:21 UTC
Cisco attempted to installed:
 
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: network vlan ranges are invalid. on node
labnodenodecontroller.sdulab.com


Where they said: 'Here's the complete value I have used "physint:2001:2010,physext:101:110" '

Which I know I used in A2 without problems.

Comment 20 Sadique Puthen 2014-03-31 08:27:20 UTC
Did you try with or without quotes? There is no need for double quotes. Try without it.

Comment 21 Martin Magr 2014-03-31 09:38:57 UTC
Anyway, physint:2001:2010,physext:101:110 is a valid value with or without this bug fixed.

Comment 23 Omri Hochman 2014-04-25 12:45:02 UTC
Verified,  ranges value are valid.

Comment 25 errata-xmlrpc 2014-05-29 19:58:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0577.html


Note You need to log in before you can comment on or make changes to this bug.