Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

add_floating_ip_to_server does not work if not provided with fixed_address #2

@dan-bar-dov

Description

@dan-bar-dov

In my code I call the following sdk API:
self.conn.compute.add_floating_ip_to_server(server_id, public_ip)
The doc string say:

        :param fixed_address: The fixed IP address to be associated with the
                              floating IP address. Used when the server is
                              connected to multiple networks.

But I do not pass any parameter since the server has only one interface,

The call fails with the following in the debug log.

2019-03-17 14:39:29,139 DEBUG: keystoneauth.session GET call to compute for https://ecs.cn-north-1.myhuaweicloud.com/v2.1/269c570058c048c9b15234f2bf02b2e9/servers/7f34145b-fae3-401f-9683-605680fb6352 used request id Req-4b79d2f3-4369-4549-a6b7-be0cae005987
17/03 14:39:29 ERS:MKOMM:DEBUG server.py:148 server_add_public_ip() Attaching EIP 10.154.193.208 to server 7f34145b-fae3-401f-9683-605680fb6352
2019-03-17 14:39:29,139 DEBUG: keystoneauth.session REQ: curl -g -i --insecure -X POST https://ecs.cn-north-1.myhuaweicloud.com/v2.1/269c570058c048c9b15234f2bf02b2e9/servers/7f34145b-fae3-401f-9683-605680fb6352/action -H "Accept: " -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}60a090323bbb97136268c3181c9b621dc8eed37c" -H "User-Agent: openstacksdk/1.0.10 keystoneauth1/3.4.0 python-requests/2.21.0 CPython/3.6.7" -d '{"addFloatingIp": {"address": "10.154.193.208"}}'
2019-03-17 14:39:30,161 DEBUG: keystoneauth.session RESP: [400] Date: Sun, 17 Mar 2019 12:40:56 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Accept-Ranges: bytes Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept, X-OpenStack-Nova-API-Version, OpenStack-API-Version X-Compute-Request-Id: req-6395f554-a749-4b8b-887f-0513aa1a10b7 X-Openstack-Request-Id: req-6395f554-a749-4b8b-887f-0513aa1a10b7 X-Openstack-Nova-Api-Version: 2.1 Openstack-Api-Version: compute 2.1 Server: api-gateway X-Request-Id: c7c3b96bfbf94a20bf19a00de86958a9
RESP BODY: {"badRequest":{"message":"{"error":{"message":"Restlet-The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method","code":"415"}}","code":"400"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions