setup-neutron hardcodes "datacentre" as the physical network

Bug #1398457 reported by James Polley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-cloud-config
Fix Released
High
Steve Kowalik
tripleo
Fix Released
High
Steve Kowalik

Bug Description

++ os-apply-config -m /home/shared/testenv.json --key baremetal-network.cidr --type raw --key-default 192.0.2.0/24
+ BM_NETWORK_CIDR=10.23.212.0/25
+ '[' -n 1598 ']'
+ BM_NETWORK_GATEWAY=
++ os-apply-config -m /home/shared/testenv.json --key baremetal-network.undercloud.range-start --type raw --key-default 192.0.2.21
+ BM_NETWORK_UNDERCLOUD_RANGE_START=10.23.212.9
++ os-apply-config -m /home/shared/testenv.json --key baremetal-network.undercloud.range-end --type raw --key-default 192.0.2.40
+ BM_NETWORK_UNDERCLOUD_RANGE_END=10.23.212.126
++ os-apply-config -m /home/shared/testenv.json --key undercloud.nameserver --type netaddress --key-default ''
+ UNDERCLOUD_NAMESERVER=
++ mktemp
+ NETWORK_JSON=/tmp/tmp.XiPMDf9AIZ
+ jq .
+ setup-neutron -n /tmp/tmp.XiPMDf9AIZ
+ rm /tmp/tmp.XiPMDf9AIZ
+ '[' -n 1598 ']'
++ jq -r '.["baremetal-network"].undercloud.public_vlan.start' /home/shared/testenv.json
+ BM_VLAN_START=15.126.48.7
++ jq -r '.["baremetal-network"].undercloud.public_vlan.finish' /home/shared/testenv.json
+ BM_VLAN_END=15.126.48.12
++ mktemp
+ PUBLIC_NETWORK_JSON=/tmp/tmp.cUvUPuAj2B
+ jq .
+ setup-neutron -n /tmp/tmp.cUvUPuAj2B
2014-12-02 16:23:09 - root - ERROR - Unexpected error during command execution
Traceback (most recent call last):
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/os_cloud_config/cmd/setup_neutron.py", line 77, in main
    keystone_client=keystone_client)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/os_cloud_config/neutron.py", line 46, in initialize_neutron
    net = _create_net(neutron_client, network_desc, network_type, admin_tenant)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/os_cloud_config/neutron.py", line 94, in _create_net
    return neutron.create_network({'network': network})
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 98, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 349, in create_network
    return self.post(self.networks_path, body=body)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1325, in post
    headers=headers, params=params)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1251, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1216, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/home/shared/tripleo-incubator/openstack-tools/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 66, in exception_handler_v20
    status_code=status_code)
BadRequest: Invalid input for operation: physical_network 'datacentre' unknown for VLAN provider network.
stack@bastion:/home/shared/tripleo-incubator$ cat /tmp/tmp.cUvUPuAj2B
{
  "physical": {
    "enable_dhcp": false,
    "gateway": "15.126.48.1",
    "metadata_server": "10.23.212.6",
    "cidr": "15.126.48.0/24",
    "allocation_start": "15.126.48.7",
    "allocation_end": "15.126.48.12",
    "name": "public",
    "nameserver": "",
    "segmentation_id": "1598"
  }
}

It looks to me as though the value "datacentre" is coming from around http://git.openstack.org/cgit/openstack/os-cloud-config/tree/os_cloud_config/neutron.py#n89

If 'datacentre' doesn't work, the cod shouldn't set it as a default value. If 'datacentre' will work if the correct setup has been done beforehand, that setup should be documented.

Revision history for this message
James Polley (tchaypo) wrote :

As far as I can tell, tripleo used to use the old shell version of setup-neutron; this was removed in https://review.openstack.org/#/c/117401

In this version, the provider:physical_network parameter used $PHYSICAL_NETWORK, which was read from $6, which in https://review.openstack.org/#/c/117401/2/scripts/devtest_undercloud.sh was ctlplane

I don't know why the new setup-neutron has this hardcoded to "datacentre" when the old setup-neutron had it configureable (and tripleo defaulted to call it "ctlplane"; but imo this seems to be a backwards-compatibility break.

I think that the new setup-neutron should take a parameter for configuring this, just like the old setup-neutron did.

Revision history for this message
Steve Kowalik (stevenk) wrote :

It may have been ctlplane, but keep in mind setup-neutron is being called twice. I'd like to see both lots of JSON that are passed to setup-neutron, since the first call is the one that may be doing the incorrect thing. I checked and double checked the changes I should be making when creating vlan'd networks with the new setup-neutron, but I am willing to accept I may have missed something.

Changed in os-cloud-config:
status: New → Incomplete
importance: Undecided → High
Steve Kowalik (stevenk)
Changed in os-cloud-config:
status: Incomplete → Confirmed
assignee: nobody → Steve Kowalik (stevenk)
Changed in tripleo:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Steve Kowalik (stevenk)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/149141

Changed in tripleo:
status: Confirmed → In Progress
James Polley (tchaypo)
summary: - setup-neutron has default values that don't work
+ setup-neutron hardcodes "datacenter" as the physical network
Changed in os-cloud-config:
status: Confirmed → In Progress
Steve Kowalik (stevenk)
summary: - setup-neutron hardcodes "datacenter" as the physical network
+ setup-neutron hardcodes "datacentre" as the physical network
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-cloud-config (master)

Reviewed: https://review.openstack.org/149135
Committed: https://git.openstack.org/cgit/openstack/os-cloud-config/commit/?id=9ea690d0d3d622c9f0d958c1b54f592cdbae181b
Submitter: Jenkins
Branch: master

commit 9ea690d0d3d622c9f0d958c1b54f592cdbae181b
Author: Steve Kowalik <email address hidden>
Date: Thu Jan 22 15:09:20 2015 +1100

    Do not hardcode datacentre as the physical network

    Currently, setup-neutron's net creation code sets the
    provider:physical_network property to 'datacentre' for VLAN'd networks.
    This is incorrect, and in fact is a (somewhat) obvious regression from
    the earlier VLAN code before the migration.

    Change-Id: I677f3de70980d1db8cf64c822ad10e07368f928e
    Closes-Bug: #1398457

Changed in os-cloud-config:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-incubator (master)

Reviewed: https://review.openstack.org/149141
Committed: https://git.openstack.org/cgit/openstack/tripleo-incubator/commit/?id=162b3febfc03653a99eb92f79f4e67593f2c4670
Submitter: Jenkins
Branch: master

commit 162b3febfc03653a99eb92f79f4e67593f2c4670
Author: Steve Kowalik <email address hidden>
Date: Thu Jan 22 15:24:48 2015 +1100

    Add physical_network to VLAN network descriptions

    setup-neutron is called a second time to set up the VLAN tagged
    public network, which contains the network segmentation id, but
    also backs onto the existing network created. os-cloud-config wrongly
    hardcoded this to datacentre, and has a new key, "physical_network"
    in the network description to configure it.

    Change-Id: Ifa677a5bc9a2127f4981e42fffc18eb7930b3191
    Closes-Bug: #1398457

Changed in tripleo:
status: In Progress → Fix Released
Jay Dobies (jdob)
Changed in os-cloud-config:
status: Fix Committed → 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.