Comment 2 for bug 1538952

Revision history for this message
Miguel Lavalle (minsel) wrote : Re: Creat a port with ip address which is not the address pool in subnet

I just tried to replicate this error. I am using devstack built from master with Neutron. Here's my request:

Request

POST http://9.114.111.101:9696/v2.0/ports

    Accept: application/json
    Content-Type: application/json
    X-Auth-Token: 506e1e77dd6948e9ac8c7e16498acb3b

Body
{ "port": { "network_id": "38c5e950-b450-4c30-83d4-ee181c28aad3", "fixed_ips": [ { "subnet_id": "5b9282a1-0be1-4ade-b478-7868ad2a16ff", "ip_address": "10.0.1.10" } ], "admin_state_up": true } }

The subnet I am using is:

5b9282a1-0be1-4ade-b478-7868ad2a16ff | private-subnet | 10.0.0.0/24 | {"start": "10.0.0.2", "end": "10.0.0.254"}

And the response I get from the port POST is the expected one:

400 Bad Request

{
  "NeutronError": {
    "message": "IP address 10.0.1.10 is not a valid IP for the specified subnet.",
    "type": "InvalidIpForSubnet",
    "detail": ""
  }
}