can't create floating IP pools from CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenContrail |
New
|
Undecided
|
Unassigned |
Bug Description
When working from the CLI, an admin cannot create a pool of floating IPs and allocate them to a tenant without first becoming a part of that tenant. A pool of public IPs cannot be made "shared" from neutron, and the neutron command to create a new floating IP shows a failure (but *does* actually allocate the IP).
showing the work:
First, we create a tenant and a user and a public key - you probably already have all this:
[<email address hidden>] ~ $ keystone tenant-create --name dsmith --description "test tenant for dsmith" --enabled true
+------
| Property | Value |
+------
| description | test tenant for dsmith |
| enabled | True |
| id | fa816605d3b34ed
| name | dsmith |
+------
[<email address hidden>] ~ $ keystone user-create --name dsmith --tenant dsmith --pass f00b4r --email <email address hidden> --enabled true
+------
| Property | Value |
+------
| email | <email address hidden> |
| enabled | True |
| id | aa45fd675d0f449
| name | dsmith |
| tenantId | fa816605d3b34ed
+------
[<email address hidden>] ~ $
I update my credentials.sh file with the new values and source the new file. I'm now the user 'dsmith', and can create myself a key pair for use in new VMs:
[<email address hidden>] ~ $ nova keypair-add dsmith_testing
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQE
<deletia>
Xe3R2K9Bo6C/
-----END RSA PRIVATE KEY-----
[<email address hidden>] ~ $
Now I load the new private key into my ssh keychain using 'ssh-add'. Let's just check on that new user, shall we?
[<email address hidden>] ~ $ nova list
+----+-
| ID | Name | Status | Task State | Power State | Networks |
+----+-
+----+-
[<email address hidden>] ~ $
Good, that works - can we boot a machine?
[<email address hidden>] ~ $ nova boot --flavor m1.small --image precise --key-name dsmith_testing dsmith-testing
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | JHgmrFUt2hR7 |
| config_drive | |
| created | 2014-07-
| flavor | m1.small (11) |
| hostId | |
| id | ba15ec30-
| image | precise (103e9f82-
| key_name | dsmith_testing |
| metadata | {} |
| name | dsmith-testing |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | fa816605d3b34ed
| updated | 2014-07-
| user_id | aa45fd675d0f449
+------
[<email address hidden>] ~ $ nova list
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| ba15ec30-
+------
[<email address hidden>] ~ $
...that looks like a no. Of course not! We're on an OpenContrail cloud, and haven't specified any networks yet.
Let's start with declaring a couple of networks with neutron:
[<email address hidden>] ~ $ neutron net-create DREW_0
Created a new network:
+------
| Field | Value |
+------
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | dsmith |
| | DREW_0 |
| contrail:
| id | b2edf3c1-
| name | DREW_0 |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | fa816605d3b34ed
+------
[<email address hidden>] ~ $ neutron net-create DREW_1
Created a new network:
+------
| Field | Value |
+------
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | dsmith |
| | DREW_1 |
| contrail:
| id | 79cb86d0-
| name | DREW_1 |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | fa816605d3b34ed
+------
[<email address hidden>] ~ $
Now we're going to need to add subnets to those networks, assuming we want to be able to have machines able to come up and talk to them. I'm not sure exactly why, but I found that the 'neutron subnet-create' command didn't much care for the fact that I named the networks DREW_0 and DREW_1, so I had to create the subnets by referencing the networks by id instead of name:
[<email address hidden>] ~ $ neutron subnet-create b2edf3c1-
Created a new subnet:
+------
| Field | Value |
+------
| allocation_pools | {"start": "192.168.42.1", "end": "192.168.42.253"} |
| cidr | 192.168.42.0/24 |
| contrail:
| contrail:
| | default-project |
| | default-
| dns_nameservers | 169.254.169.254 |
| enable_dhcp | False |
| gateway_ip | 192.168.42.254 |cd
| host_routes | {"destination": "TODO-destination", "nexthop": "TODO-nexthop"} |
| id | 6ae4b999-
| ip_version | 4 |
| name | |
| network_id | b2edf3c1-
| tenant_id | fa816605d3b34ed
+------
[<email address hidden>] ~ $ neutron subnet-create 79cb86d0-
Created a new subnet:
+------
| Field | Value |
+------
| allocation_pools | {"start": "192.168.23.1", "end": "192.168.23.253"} |
| cidr | 192.168.23.0/24 |
| contrail:
| contrail:
| | default-project |
| | default-
| dns_nameservers | 169.254.169.254 |
| enable_dhcp | False |
| gateway_ip | 192.168.23.254 |
| host_routes | {"destination": "TODO-destination", "nexthop": "TODO-nexthop"} |
| id | 04a69f5d-
| ip_version | 4 |
| name | |
| network_id | 79cb86d0-
| tenant_id | fa816605d3b34ed
+------
[<email address hidden>] ~ $
... switch out of blogger mode. Sorry, this was all meant to be a blog post, and it's ending with a bug.
Ok, so here is where things start to fall apart a little. We need to basically boot machines into these networks with 'nova boot', and then we need to assign a floating IP to at least one of them so we can get onto the networks that we've created... but the actual assignment of the floating IP is where things begin failing.
[<email address hidden>] ~/WORK/jlab $ nova boot --flavor m1.small --image precise --key-name dsmith_testing --nic net-id=
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | jZQHRvp2gD47 |
| config_drive | |
| created | 2014-07-
| flavor | m1.small (11) |
| hostId | |
| id | de41d257-
| image | precise (a3434bfd-
| key_name | dsmith_testing |
| metadata | {} |
| name | drew testing #1 |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | 01ae248eed15415
| updated | 2014-07-
| user_id | bbd0bc3b5e4e46b
+------
[<email address hidden>] ~/WORK/jlab $
So there's machine #1, and we'll do the same again for another one, and now 'nova list' shows us this:
[<email address hidden>] ~/WORK/jlab $ nova list
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| de41d257-
| 5dc71837-
+------
[<email address hidden>] ~/WORK/jlab $
...but we can't actually connect to those until we assign a floating IP. So let's try that:
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-list
+----+-
| Ip | Server Id | Fixed Ip | Pool |
+----+-
+----+-
[<email address hidden>] ~/WORK/jlab $
nope, nothing there... make one maybe?
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-create Public
ERROR: FloatingIpPoolN
[<email address hidden>] ~/WORK/jlab $
Ok, so basically we need access to the floating ip pool "Public". Let's try it as admin instead. First I deleted all the floating IPs in the pool, just so we can start from scratch:
[<email address hidden>] ~/WORK/jlab $ for i in `neutron floatingip-list | grep 10 | cut -d " " -f2`; do neutron floatingip-delete $i; done
Deleted floatingip: 609b3cfa-
Deleted floatingip: 28571f0f-
Deleted floatingip: a2d31f7b-
Deleted floatingip: 1eebccb8-
Deleted floatingip: 27a10f46-
...
Now we have no floating IPs in the pool, though the network is still available to our admin tenant. Check for sure:
[<email address hidden>] ~/WORK/jlab $ neutron floatingip-list
...nothing.
Ok, let's create one then!
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-create public
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-e1a183db-
The command fails. OR DOES IT??
[<email address hidden>] ~/WORK/jlab $ neutron floatingip-list
+------
| id | fixed_ip_address | floating_ip_address | port_id |
+------
| fe516956-
+------
Looks like it just says it fails.
Anyway. Clearly we can create floating IPs from the Public network. If the 'dsmith' user/tenant could see that network, probably he could create floating IPs from it also... so let's check the docs.
According to this page: http://
"Shared" networks should be able to be used by other tenants or projects. If we view the "Public" network as admin, it looks like this:
[<email address hidden>] ~/WORK/jlab $ neutron net-show b09fd0c8-
+------
| Field | Value |
+------
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | Public |
| contrail:
| contrail:
| id | b09fd0c8-
| name | Public |
| shared | False |
| status | ACTIVE |
| subnets | 5da81cd2-
| tenant_id | 29098dc789f1402
+------
Shared = False. So, let's try updating that to be shared, according to the docs:
[<email address hidden>] ~/WORK/jlab $ neutron net-update b09fd0c8-
Updated network: b09fd0c8-
aaaand check it again?
[<email address hidden>] ~/WORK/jlab $ neutron net-show b09fd0c8-
+------
| Field | Value |
+------
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | Public |
| contrail:
| contrail:
| id | b09fd0c8-
| name | Public |
| shared | False |
| status | ACTIVE |
| subnets | 5da81cd2-
| tenant_id | 29098dc789f1402
+------
No change. The tool does not update the shared status, for some reason. Ok, back to the docs:
"Using Router:External Attribute
When a network has the router:external attribute set, users (including non-admin) in other tenants or projects can use that network for allocating floating-ips, using:
neutron floatingip-create <router-
then associating the IP address pool with their instances."
So! Let's try it:
[<email address hidden>] ~/WORK/jlab $ neutron net-update b09fd0c8-
Updated network: b09fd0c8-
Looks like it succeeded... but the network still hasn't changed:
[<email address hidden>] ~/WORK/jlab $ neutron net-show b09fd0c8-
+------
| Field | Value |
+------
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | Public |
| contrail:
| contrail:
| id | b09fd0c8-
| name | Public |
| shared | False |
| status | ACTIVE |
| subnets | 5da81cd2-
| tenant_id | 29098dc789f1402
+------
Well, let's try anyway. As dsmith again, can we view that network...?
[<email address hidden>] ~/WORK/jlab $ neutron net-list
+------
| id | name | subnets |
+------
| 59bbc517-
| ea29ef39-
+------
Nope. And trying to allocate an IP from it still fails:
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-create Public
ERROR: FloatingIpPoolN
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-create public
ERROR: FloatingIpPoolN
[<email address hidden>] ~/WORK/jlab $ nova floating-ip-create b09fd0c8-
ERROR: FloatingIpPoolN
So that's where I'm stuck. Admin can create floating IPs in the public pool, but regular users cannot.
Drew,
Which image are you running? 'contrail-version' command will give the details