RFE: Create Multiple Servers fails when a volume is specified even with a multiattach volume

Bug #1747985 reported by Steve Noyes
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Wishlist
Han Guangyu

Bug Description

With multiattach now enabled, it should be possible to use the Create Multiple Servers compute api to create multiple instances with a common multiattach disk attached to all of them (assuming you have met all the prerequisites for multiattach to work).

Currently when you try to do a multi-create with a bdm specified (as a non-boot volume), the operation fails with:

INFO nova.api.openstack.wsgi [None req-cc49eb29-6fa4-460f-9bda-45f9c157016f None None] HTTP exception thrown: Cannot attach one or more volumes to multiple instances

This is due to a check here:

https://github.com/openstack/nova/blob/master/nova/compute/api.py#L731

There may be other issues following this one, but this is the first issue that you run into.

version info:

nova$ git show
commit f25b744082b439b2520f4b3f0549fb074bf522a2
Merge: 980f5c3 a84e7ae
Author: Zuul <email address hidden>
Date: Wed Feb 7 12:24:04 2018 +0000

    Merge "Address comments from I51adbbdf13711e463b4d25c2ffd4a3123cd65675"

Matt Riedemann (mriedem)
summary: - Create Multiple Servers fails when a volume is specified
+ Create Multiple Servers fails when a volume is specified even with a
+ multiattach volume
tags: added: api volumes
tags: added: multiattach
Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote : Re: Create Multiple Servers fails when a volume is specified even with a multiattach volume

It looks to me that the multiattach feature wasn't fully taking care of all the corner cases, including the multiple create call.

Leaving that bug open for now in order to tackle that specific issue, but honestly I feel from a tracking perspective that a specless BP would be more appropriate.

Changed in nova:
importance: Medium → Low
tags: added: low-hanging-fruit
Revision history for this message
Steve Noyes (steve-noyes) wrote :

The next problem is hit in the n-api create code. During multi-instance create, for each instance, the method _validate_bdm is called on the common volume. When this is called for the first instance, it calls _check_attach_and_reserve_volume, which calls cinder to do an attachment_create to reserve the volume. So far so good.

Then when going thru the next instance, that call will now fail because the volume now in state 'reserved', and trying to reserve an already reserved volume gives you this:

Feb 08 10:17:16 ub16-ui-dev3 <email address hidden>[21240]: ERROR nova.volume.cinder [None req-1ee86e69-221a-485f-ae0c-4e5b68b564f7
tempest-MultipleCreateTestMultiAttachJSON-1625242046 tempest-MultipleCreateTestMultiAttachJSON-1625242046] [instance: 4a050b18-ea1e-437b-91c7-1d50f294a9d4]
Create attachment failed for volume 0d36be4c-d3eb-4593-8bd6-1755c88efdb7. Error: Invalid volume: Volume 0d36be4c-d3eb-4593-8bd6-1755c88efdb7
status must be available or in-use or downloading (HTTP 400) (Request-ID: req-016ed7db-71b5-454f-bc7b-7e0930f231f2) Code: 400: BadRequest:
Invalid volume: Volume 0d36be4c-d3eb-4593-8bd6-1755c88efdb7 status must be available or in-use or downloading (HTTP 400)

Normally, when you do individual instance creates, this doesn't happen because the volumes are actually attached before the next instance is created and the status is in-use which is legit for multi-attach.

It feels like any fix for this may involve both cinder and nova.

Revision history for this message
Matt Riedemann (mriedem) wrote :
Matt Riedemann (mriedem)
summary: - Create Multiple Servers fails when a volume is specified even with a
- multiattach volume
+ RFE: Create Multiple Servers fails when a volume is specified even with
+ a multiattach volume
Changed in nova:
importance: Low → Wishlist
Changed in nova:
assignee: nobody → Han Guangyu (hanguangyu)
Changed in nova:
assignee: Han Guangyu (han-guangyu) → nobody
assignee: nobody → Han Guangyu (han-guangyu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.