[Nova] Nova removes a port after unsuccessful attaching

Bug #1581037 reported by Oleksii Chuprykov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Status tracked in 10.0.x
10.0.x
Confirmed
Medium
stgleb
9.x
Won't Fix
Medium
MOS Nova

Bug Description

Steps to reproduce:
1) Create a port: neutron port-create a72ac858-7a5d-4ab5-b03b-2ce5bd334f91
2) Boot a server with this port:
3) Start polling nova with detach requests:nova boot b --flavor=m1.micro --image=TestVM --nic port-id=fea272eb-557a-4cc5-8757-e132d45897b4
so you can probably will see such messages:
ERROR (Conflict): Cannot 'detach_interface' instance 094283e8-3ea5-4b69-8666-1bcd872a9101 while it is in vm_state building (HTTP 409)
After successful detach try to attach mentioned port again, you will see: ERROR (ClientException): Failed to attach network adapter device to bc4c1dca-ea67-4a1d-80e4-3385d00ccd49 (HTTP 500) (Request-ID: req-f38dad45-9ed1-40a8-81e1-eb544e3a1056)

After this unsuccessful attach we can't find mentioned port:
root@node-2:~# neutron port-show fea272eb-557a-4cc5-8757-e132d45897b4
Unable to find port with name or id 'fea272eb-557a-4cc5-8757-e132d45897b4'

The reason of this behaviour may be in some races in nova, so in some moment after changing of BUILD state nova can't correctly serve detach requests.

Attached nova logs: http://xsnippet.org/361695/

Changed in mos:
importance: Undecided → High
summary: - Nova removes a port after unsuccessful attaching
+ [Nova] Nova removes a port after unsuccessful attaching
Changed in mos:
milestone: none → 9.0
assignee: nobody → MOS Nova (mos-nova)
Revision history for this message
Bug Checker Bot (bug-checker) wrote : Autochecker

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

version

expected result

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Oleksii, could you please clarify:

1) the version of MOS you are using

2) do you simply boot a VM? or you try to detach an interface during boot? I'm confused how you can possibly get HTTP 409 (Conflict) on booting a new VM with a port passed...

Changed in mos:
status: New → Confirmed
tags: added: area-nova
Revision history for this message
Oleksii Chuprykov (ochuprykov) wrote :

1) 9.0 As I pointed in milestone
2) I'm simply boot a VM with port and then trying to detach this port during booting. Nova responds with ERROR (Conflict): Cannot 'detach_interface' instance 094283e8-3ea5-4b69-8666-1bcd872a9101 while it is in vm_state building (HTTP 409) . I don't know is this really conflict or anything else, but explanation seems correct to me.
After such pooling of nova instance to detach port, nova successfully detaches port in some time.
After that, if you try to attach this port again, you'll receive Conflict and port will be deleted.
The problem here is that nova deletes port, but obviously shouldn't.

Revision history for this message
Oleksii Chuprykov (ochuprykov) wrote :

I want to emphasize, that reason isn't in polling itself, but rather in the moment of "successful" detach. It happens right after transition of vm from building to some other state, likely active.

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Thanks, Oleksii! This makes sense and sounds like a race condition.

At the same time, I don't think this should be of High importance, giving the fact how exactly this is reproduced.

stgleb (gstepanov)
Changed in mos:
assignee: MOS Nova (mos-nova) → stgleb (gstepanov)
Revision history for this message
stgleb (gstepanov) wrote :

I'm trying to reproduce steps that you have enumerated.

1) create port
2) boot instance with this port
3) while instance is in building state detach port (409 Conflict as expected)
4) After instance become active port attach works well ( not as expected HTTP 500).

Enviroment with MOS 9.0

Changed in mos:
milestone: 9.0 → 10.0
tags: added: 10.0-reviewed
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.