nova sometimes doesn't clean up neutron ports when VM spawning fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
New
|
Undecided
|
Unassigned | ||
nova-cloud-controller (Juju Charms Collection) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
It appears that sometimes, nova doesn't clean up ports when spawning the instance fails. I'm using SR-IOV so I'm creating ports manually.
Example :
Create port with :
$ neutron port-create <net_id> --name direct --binding:vnic_type direct
Boot instance using said port :
$ nova boot --image <image> --flavor <flavor> --key-name admin_key --nic port-id=<port-id from above> vm_direct
If VM creation fails and the failed VM gets deleted, the port is still bound :
$ neutron port-show direct2
+------
| Field | Value |
+------
| admin_state_up | True |
| allowed_
| binding:host_id | xxxxxx |
| binding:profile | {"pci_slot": "0000:04:10.2", "physical_network": "physnet1", "pci_vendor_info": "8086:10ca"} |
| binding:vif_details | {"port_filter": false, "vlan": "1234"} |
| binding:vif_type | hw_veb |
| binding:vnic_type | direct |
| device_id | 2aecc61b-
| device_owner | compute:None |
| dns_assignment | {"hostname": "host-10-190-5-35", "ip_address": "10.190.5.35", "fqdn": "host-10-
| dns_name | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "72cfdfed-
| id | f34b55c1-
| mac_address | fa:16:3e:5d:da:16 |
| name | direct |
| network_id | 200d501c-
| security_groups | feb7b440-
| status | BUILD |
| tenant_id | 09fae15a5f6f4ac
+------
$ nova show 2aecc61b-
ERROR: No server with a name or ID of '2aecc61b-
This is similar to LP#1423845, but I do have the fix from that bug already in my code.
Package versions are : 2:12.0.
Thanks
nova delete logs from nova-api- os-compute. log (for another instance/port with the same behaviour) :
2016-04-21 00:57:49.671 2210 DEBUG nova.api. openstack. wsgi [req-6af0e69a- 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Calling method '<bound method Controller.delete of <nova.api. openstack. compute. legacy_ v2.servers. Controller object at 0x7fddf66aab90>>' _process_stack /usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ wsgi.py: 792 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] [instance: 6d91af13- 0884-4bd3- b170-f627a8321d df] Fetching instance by UUID get /usr/lib/ python2. 7/dist- packages/ nova/compute/ api.py: 2024 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] [instance: 6d91af13- 0884-4bd3- b170-f627a8321d df] Going to try to terminate instance delete /usr/lib/ python2. 7/dist- packages/ nova/compute/ api.py: 1934 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Attempting to reserve resources for project 09fae15a5f6f4ac f838a97d202786d 25 and user 2e675365e86241b b9072c0d6d1f823 57. Deltas: {'instances': -1, 'ram': -2048, 'cores': -1} reserve /usr/lib/ python2. 7/dist- packages/ nova/quota. py:550 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Quota limits for project 09fae15a5f6f4ac f838a97d202786d 25: {'project_id': u'09fae15a5f6f4 acf838a97d20278 6d25'} reserve /usr/lib/ python2. 7/dist- packages/ nova/quota. py:559 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Getting quotas for project 09fae15a5f6f4ac f838a97d202786d 25. Resources: ['instances', 'ram', 'cores'] _get_quotas /usr/lib/ python2. 7/dist- packages/ nova/quota. py:409 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Quotas for project 09fae15a5f6f4ac f838a97d202786d 25 after resource sync: {'instances': 10, 'ram': 51200, 'cores': 20} reserve /usr/lib/ python2. 7/dist- packages/ nova/quota. py:565 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Getting quotas for user 2e675365e86241b b9072c0d6d1f823 57 and project 09fae15a5f6f4ac f838a97d202786d 25. Resources: ['instances', 'ram', 'cores'] _get_quotas /usr/lib/ python2. 7/dist- packages/ nova/quota. py:401 6733-47bc- 8283-6431bcb7bd 30 2e675365e86241b b9072c0d6d1f823 57 09fae15a5f6f4ac f838a97d202786d 25 - - -] Quotas for project 09fae15a5f6f4ac f838a97d202786d 25 and user 2e675365e86241b b9072c0d6d1f823 57 after resource sync: {'instances': 10, 'ram': 51200, 'cores': 20} reserve /usr/...
2016-04-21 00:57:49.671 2210 DEBUG nova.compute.api [req-6af0e69a-
2016-04-21 00:57:49.740 2210 DEBUG nova.compute.api [req-6af0e69a-
2016-04-21 00:57:49.825 2210 DEBUG nova.quota [req-6af0e69a-
2016-04-21 00:57:49.831 2210 DEBUG nova.quota [req-6af0e69a-
2016-04-21 00:57:49.831 2210 DEBUG nova.quota [req-6af0e69a-
2016-04-21 00:57:49.838 2210 DEBUG nova.quota [req-6af0e69a-
2016-04-21 00:57:49.839 2210 DEBUG nova.quota [req-6af0e69a-
2016-04-21 00:57:49.847 2210 DEBUG nova.quota [req-6af0e69a-