Not possible to change fixed-ips if port is on routed provider network

Bug #1844124 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Harald Jensås
tripleo
Fix Released
High
Unassigned

Bug Description

For ports on normal networks (non-Routed Provider Networks) it is possible to change the fixed-ip of a port. When a port is on a Routed Provider Network the same operation return an error: "Invalid input for operation: IP allocation requires subnets for network." Since this is an unbound port, and the change does not move the port ip allocation to a subnet associated with a different segment this operation should succeed.

$ grep flat_networks /etc/neutron/plugins/ml2/ml2_conf.ini
flat_networks = public,mynetwork

$ openstack network create \
  --provider-network-type flat \
  --provider-physical-network mynetwork \
  mynetwork

$ openstack subnet create \
  --network mynetwork \
  --network-segment $(openstack network segment list --network mynetwork -f value -c ID) \
  --subnet-range 192.168.254.0/24 \
  --allocation-pool start=192.168.254.10,end=192.168.254.100 \
  mysubnet

$ openstack network show mynetwork -f value -c id && openstack subnet show mysubnet -f value -c id
57e622a0-3003-4d9f-b01e-c12613935265
df2cbb56-12b9-4156-8a23-36023b110b75

$ curl -s -X POST \
   -H "X-Auth-Token: $(openstack token issue -f value -c id)" \
   http://192.168.122.222:9696/v2.0/ports \
   -d '{"port": {"name": "test-port", "network_id": "57e622a0-3003-4d9f-b01e-c12613935265", "fixed_ips": [{"subnet_id": "df2cbb56-12b9-4156-8a23-36023b110b75"}]}}' \
  | python -m json.tool
{
    "port": {
        "admin_state_up": true,
        "allowed_address_pairs": [],
        "binding:host_id": "",
        "binding:profile": {},
        "binding:vif_details": {},
        "binding:vif_type": "unbound",
        "binding:vnic_type": "normal",
        "created_at": "2019-09-16T11:56:06Z",
        "description": "",
        "device_id": "",
        "device_owner": "",
        "dns_assignment": [
            {
                "fqdn": "host-192-168-254-44.openstackgate.local.",
                "hostname": "host-192-168-254-44",
                "ip_address": "192.168.254.44"
            }
        ],
        "dns_domain": "",
        "dns_name": "",
        "extra_dhcp_opts": [],
        "fixed_ips": [
            {
                "ip_address": "192.168.254.44",
                "subnet_id": "df2cbb56-12b9-4156-8a23-36023b110b75"
            }
        ],
        "id": "84ef332d-8c48-422a-b400-0655702b1a0e",
        "ip_allocation": "immediate",
        "mac_address": "fa:16:3e:43:7c:fe",
        "name": "test-port",
        "network_id": "57e622a0-3003-4d9f-b01e-c12613935265",
        "port_security_enabled": true,
        "project_id": "4abf7cb77b574734adf086dfa828cd84",
        "propagate_uplink_status": false,
        "qos_policy_id": null,
        "resource_request": null,
        "revision_number": 1,
        "security_groups": [
            "708b5fa0-244c-46ee-9b35-30ba45a71ccf"
        ],
        "status": "DOWN",
        "tags": [],
        "tenant_id": "4abf7cb77b574734adf086dfa828cd84",
        "updated_at": "2019-09-16T11:56:06Z"
    }
}

$ curl -s -X PUT \
   -H "X-Auth-Token: $(openstack token issue -f value -c id)" \
   http://192.168.122.222:9696/v2.0/ports/84ef332d-8c48-422a-b400-0655702b1a0e \
   -d '{"port": {"fixed_ips": [{"ip_address": "192.168.254.100"}]}}' \
   | python -m json.tool
{
    "NeutronError": {
        "detail": "",
        "message": "Invalid input for operation: IP allocation requires subnets for network.",
        "type": "InvalidInput"
    }
}

Revision history for this message
Harald Jensås (harald-jensas) wrote :

The heat template below can also be used to reproduce the issue:

# Create stack with:
#
# fixed_ips:
# [{subnet: mysubnet}]
#
# Update stack with:
#
# fixed_ips:
# [{'ip_address': '192.168.254.150'}]

# Result:
# stack_status_reason: 'Resource UPDATE failed: BadRequest: resources.port: Invalid
# input for operation: IP allocation requires subnets for network.
#
# Neutron server returns request_ids: [''req-18a11655-8a9d-4111-863f-7a9653555a90'']'
#

# Running the same operation on a non-Routed Provider Network succeeds.

#
heat_template_version: ocata

resources:
  port:
    type: OS::Neutron::Port
    properties:
      network: mynetwork
      name: test-port
      fixed_ips:
        [{'ip_address': '192.168.254.150'}]
        # [{subnet: mysubnet}]
      replacement_policy: AUTO

summary: - Not possible to change fixed-ips if port is on router provider network
+ Not possible to change fixed-ips if port is on routed provider network
Revision history for this message
Ade Lee (alee-3) wrote :

This bug prevents the successful completion of a TLS Everywhere brown filed deployment.

Changed in tripleo:
importance: Undecided → High
status: New → Triaged
milestone: none → train-3
Changed in neutron:
assignee: nobody → Harald Jensås (harald-jensas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/682489

Changed in neutron:
status: New → In Progress
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/682489
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=def8e95aad1e4588c369d537ee66234245eefdf6
Submitter: Zuul
Branch: master

commit def8e95aad1e4588c369d537ee66234245eefdf6
Author: Harald Jensås <email address hidden>
Date: Mon Sep 16 21:52:51 2019 +0200

    fixed_configured=True when Add/Remove port IPs

    When updating a port with the fixed_ips request the
    fixed_configured argument should be set to true when
    calling _ipam_get_subnets() so that all subnets are
    returned if host is not set.

    Otherwise the ip allocation will be deffered and an
    empty list of possible subnets for the port is
    returned. Which in turn led to raising an error that
    the network requires subnets to allocate an IP
    address.

    Closes-Bug: #1844124
    Change-Id: I2e690ea0cf5fa0614e39be2b0e83afad3daa7f48

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/687515

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/687516

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/687517

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/687518

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/stein)

Reviewed: https://review.opendev.org/687516
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=074e1832aae335d261ea938126256f1b672c1572
Submitter: Zuul
Branch: stable/stein

commit 074e1832aae335d261ea938126256f1b672c1572
Author: Harald Jensås <email address hidden>
Date: Mon Sep 16 21:52:51 2019 +0200

    fixed_configured=True when Add/Remove port IPs

    When updating a port with the fixed_ips request the
    fixed_configured argument should be set to true when
    calling _ipam_get_subnets() so that all subnets are
    returned if host is not set.

    Otherwise the ip allocation will be deffered and an
    empty list of possible subnets for the port is
    returned. Which in turn led to raising an error that
    the network requires subnets to allocate an IP
    address.

    Closes-Bug: #1844124
    Change-Id: I2e690ea0cf5fa0614e39be2b0e83afad3daa7f48
    (cherry picked from commit def8e95aad1e4588c369d537ee66234245eefdf6)

tags: added: in-stable-stein
tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/rocky)

Reviewed: https://review.opendev.org/687517
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=885351c825e32d574d2b817961f6765bbdba673f
Submitter: Zuul
Branch: stable/rocky

commit 885351c825e32d574d2b817961f6765bbdba673f
Author: Harald Jensås <email address hidden>
Date: Mon Sep 16 21:52:51 2019 +0200

    fixed_configured=True when Add/Remove port IPs

    When updating a port with the fixed_ips request the
    fixed_configured argument should be set to true when
    calling _ipam_get_subnets() so that all subnets are
    returned if host is not set.

    Otherwise the ip allocation will be deffered and an
    empty list of possible subnets for the port is
    returned. Which in turn led to raising an error that
    the network requires subnets to allocate an IP
    address.

    Closes-Bug: #1844124
    Change-Id: I2e690ea0cf5fa0614e39be2b0e83afad3daa7f48
    (cherry picked from commit def8e95aad1e4588c369d537ee66234245eefdf6)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/queens)

Reviewed: https://review.opendev.org/687518
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1bab70f909ff60c4dbc72a88b01bd9d511647f3c
Submitter: Zuul
Branch: stable/queens

commit 1bab70f909ff60c4dbc72a88b01bd9d511647f3c
Author: Harald Jensås <email address hidden>
Date: Mon Sep 16 21:52:51 2019 +0200

    fixed_configured=True when Add/Remove port IPs

    When updating a port with the fixed_ips request the
    fixed_configured argument should be set to true when
    calling _ipam_get_subnets() so that all subnets are
    returned if host is not set.

    Otherwise the ip allocation will be deffered and an
    empty list of possible subnets for the port is
    returned. Which in turn led to raising an error that
    the network requires subnets to allocate an IP
    address.

    Closes-Bug: #1844124
    Change-Id: I2e690ea0cf5fa0614e39be2b0e83afad3daa7f48
    (cherry picked from commit def8e95aad1e4588c369d537ee66234245eefdf6)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/687515
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a59bc98edd0b86705ee3c6b7098bbe242c583316
Submitter: Zuul
Branch: stable/train

commit a59bc98edd0b86705ee3c6b7098bbe242c583316
Author: Harald Jensås <email address hidden>
Date: Mon Sep 16 21:52:51 2019 +0200

    fixed_configured=True when Add/Remove port IPs

    When updating a port with the fixed_ips request the
    fixed_configured argument should be set to true when
    calling _ipam_get_subnets() so that all subnets are
    returned if host is not set.

    Otherwise the ip allocation will be deffered and an
    empty list of possible subnets for the port is
    returned. Which in turn led to raising an error that
    the network requires subnets to allocate an IP
    address.

    Closes-Bug: #1844124
    Change-Id: I2e690ea0cf5fa0614e39be2b0e83afad3daa7f48
    (cherry picked from commit def8e95aad1e4588c369d537ee66234245eefdf6)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 15.0.0.0rc2

This issue was fixed in the openstack/neutron 15.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.3

This issue was fixed in the openstack/neutron 14.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.5

This issue was fixed in the openstack/neutron 13.0.5 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.1.1

This issue was fixed in the openstack/neutron 12.1.1 release.

Changed in tripleo:
milestone: ussuri-1 → ussuri-2
Revision history for this message
Harald Jensås (harald-jensas) wrote :

This was fixed in neutron. We can close this in tripleo.

Changed in tripleo:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.0.0.0b1

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

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.