rackspace / gophercloud

A Go SDK for OpenStack. IN FEATURE FREEZE. See Issue #592
http://gophercloud.io
Other
456 stars 185 forks source link

detaching volume by attachment_id #617

Open jangseon-ryu opened 7 years ago

jangseon-ryu commented 7 years ago

This is a patch for detaching volume by attachment_id, when using in attaching a same volume to multiple hosts. This patch, Of course, support both 1:1 and 1:N attachment.

Currently, detaching logic in gophercloud can only support on 1:1(volume:host) attachment. But many users want to be able to attach the same volume to multiple hosts. (for example : clustered application(A:P))

BP : https://specs.openstack.org/openstack/cinder-specs/specs/kilo/multi-attach-volume.html

Signed-off-by: Jangseon Ryu jangseon.ryu@navercorp.com

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.006%) to 80.499% when pulling e881b4a5c5617fb552ded7c64c725729e06bcf2f on jangseon-ryu:block-detach-attachmentid into e00690e87603abe613e9f02c816c7c4bef82e063 on rackspace:master.

j-griffith commented 7 years ago

So technically this works, but it's pretty outdated. The problem here is that the attachment_id isn't always accessible. I'd suggest at this point that we add the V3/Attachments controller and utilize that (as it's designed to do what you want here). I have it on my list after Snapshots if that's helpful.