[openstack-dev] [nova][cinder] Update (swap) of multiattach volume should not be allowed

Matt Riedemann mriedemos at gmail.com
Wed Jun 6 13:13:22 UTC 2018


On 6/6/2018 7:55 AM, Jay Pipes wrote:
> I'd love to know who is actually using the swap_volume() functionality, 
> actually. I'd especially like to know who is using swap_volume() with 
> multiattach.

The swap volume API in nova only exists as a callback routine during 
volume live migration or retype operations. It's admin-only by default 
on the nova side, and shouldn't be called directly (similar to 
guest-assisted volume snapshots for NFS and GlusterFS volumes - totally 
just a callback from Cinder). So during volume retype, cinder will call 
swap volume in nova and then nova will call another admin-only API in 
Cinder to tell Cinder, yup we did it or we failed, rollback.

The cinder API reference on retype mentions the restrictions about 
multiattach volumes:

https://developer.openstack.org/api-ref/block-storage/v3/#retype-a-volume

"Retyping an in-use volume from a multiattach-capable type to a 
non-multiattach-capable type, or vice-versa, is not supported. It is 
generally not recommended to retype an in-use multiattach volume if that 
volume has more than one active read/write attachment."

There is no API reference for volume live migration, but it should 
generally be the same idea.

The Tempest test for swap volume with multiattach volumes was written 
before we realized we needed to put restrictions in place *on the cinder 
side* to limit the behavior. The Tempest test just hits the compute API 
to verify the plumbing in nova works properly, it doesn't initiate the 
flow via an actual retype (or volume live migration).

-- 

Thanks,

Matt



More information about the OpenStack-dev mailing list