can't create/update port of no IP with command line

Bug #1526509 reported by yalei wang
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-neutronclient
Confirmed
Low
kavitha h r
python-openstackclient
New
Undecided
Unassigned

Bug Description

1. when I trying to create a port without IP from a network with subnet. I specify the ip within this cmd:

#neutron --debug port-create ext_net1 --fixed-ip=""

it actually send the request with such data to server:

'{"port": {"network_id": "be7badb2-170d-46f2-9e87-480fa0a221c5", "fixed_ips": [{}], "admin_state_up": true}}'

and neutron server will parse the fixed_ips. Because currently server only support unaddress port by inputting "fixed_ips": []
When input "fixed_ips": [{}] , it will get error of "InvalidInput" from IPAM backend of neutron.

=======
in exception_handler_v20
    status_code=status_code)
BadRequest: Invalid input for operation: IP allocation requires subnet_id or ip_address.
========

2. another problem is that:

#nneutron --debug port-create ext_net1 --fixed-ip "" --fixed-ip={ip_address=10.0.0.1}

when the fixed-ip list include the empty one, what kind of request should be sent to neutron server?

3. how to specify unaddress port? could we use --fixed-ips?

#neutron --debug port-create ext_net1 --fixed-ips ""

will send out the "fixed_ips": ""

#neutron --debug port-create ext_net1 --fixed-ips list=true ''
will send out "fixed_ips": [""]

yalei wang (yalei-wang)
Changed in python-neutronclient:
assignee: nobody → yalei wang (yalei-wang)
yalei wang (yalei-wang)
description: updated
yalei wang (yalei-wang)
description: updated
Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

The syntax that you have used is actually passing a single fixed-ip argument that is an empty string. But, what you really want is to pass an empty list. I thought there was a way to do this but I'm having trouble finding it and kevinbenton tells me in IRC that he doesn't think it can be done at the moment.

As a work-around, curl can be used to accomplish this by sending an empty list with the '{}'.

Changed in python-neutronclient:
importance: Undecided → Low
yalei wang (yalei-wang)
description: updated
Revision history for this message
yalei wang (yalei-wang) wrote :

@Carl thanks! yes, now the API only support "fixed_ips": []

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

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

Changed in python-neutronclient:
status: New → In Progress
yalei wang (yalei-wang)
summary: - can't create port of no IP with command line
+ can't create/update port of no IP with command line
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-neutronclient (master)

Change abandoned by yalei wang (<email address hidden>) on branch: master
Review: https://review.openstack.org/258572
Reason: thanks all, it is replaced by https://review.openstack.org/#/c/218388/

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 180 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in python-neutronclient:
assignee: yalei wang (yalei-wang) → nobody
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-neutronclient because there has been no activity for 60 days.]

Changed in python-neutronclient:
status: Incomplete → Expired
Andy Gomez (andygomez)
Changed in python-neutronclient:
status: Expired → Confirmed
Revision history for this message
Andy Gomez (andygomez) wrote :

This is also affecting me with python-neutronclient and python-openstackclient.
A curl request with "fixed_ips": [], will work.
Though with the client.

#openstack port create --network public --fixed-ip [] agtest
Expected comma separated 'key=value' pairs, but got: []

#openstack port create --network public --fixed-ip list=true agtest
Invalid keys list specified.
Valid keys are: subnet, ip-address

#neutron port-create --network public --fixed-ip []

#neutron port-create: error: argument --fixed-ip: missing value for key '[]'

#neutron port-create public --fixed-ip "" --name agtest2

Invalid input for operation: IP allocation requires subnet_id or ip_address.

kavitha h r (nidi)
Changed in python-neutronclient:
assignee: nobody → kavitha h r (nidi)
M V P Nitesh (m-nitesh)
Changed in python-openstackclient:
assignee: nobody → M V P Nitesh (m-nitesh)
M V P Nitesh (m-nitesh)
Changed in python-openstackclient:
assignee: M V P Nitesh (m-nitesh) → nobody
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.