Commit Graph

8 Commits

Author SHA1 Message Date
Rajat Dhasmana d714249ca9 Make instance_uuid optional in attachment create
Cinder and cinderclient assumes an attachment create request will
always contain instance_uuid. This is not true when glance calls
cinder for attachment in glance cinder configuration.
This patch (along with the cinder patch) make the instance_uuid
optional and allow glance to do attachments without passing
instance_uuid.

Change-Id: Ifbaca4aa87d890bc5130069638d42665b914b378
2021-07-14 11:20:28 -04:00
Sean McGinnis 246040a732 Drop support for --sort_key and --sort_dir
These arguments were deprecated in the kilo release in favor of a
combined --sort argument. This drops support for the deprecated
arguments.

Change-Id: If8f8ac44cc81f553009a15ca67257e86cb925b6f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-09-11 09:38:34 -04:00
John Griffith 9072700887 Add mode option to attachment-create
We introduce a mode option in attachment-create starting with
microversion 3.54.  The mode option is the new/preferred way of
setting ro mode (as opposed to admin-metadata).

This patch adds the support for the mode option to the client for
endpoints that support 3.54.

Depends-on: https://review.openstack.org/532702/
Change-Id: I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
2018-07-17 15:58:46 -05:00
jeremy.zhang e2618ebb24 Add api_version wraps for some v3 volume APIs
This patch is mainly to add api_version wraps for some v3 volume APIs.

Change-Id: Iea8b9b68930548156749da3f98629e3602ffca83
2018-01-25 21:56:28 +08:00
j-griffith da20fbf45b Add api_version_wraps to attachment-complete
The attachment-complete method didn't include the version
checking.  This patch adds that and adds a couple of tests.

Change-Id: I63dba6ee6d56bb63a79f3ad2ef3412ebd9c1ce07
Closes-Bug: #1715732
2017-09-09 18:17:01 +00:00
John Griffith b7d3468460 Add an attachment_complete API call
The new attachment_update method in Cinder's API creates an attachment
object and populates it with the provided connector info. In addition,
we set the volumes status to in-use and update the attachment object
status to "attached".

This isn't really accurate though, because we don't know if the volume
is actually attached (connected) by the consumer or not.  Also a big
side effect here is that currently all of our tests and automation
use volume-status to determine if a volume is fully connected/ready
for use and that everything went well.  It's used as an ack in most
cases.

This change goes back to using multiple states to signify where a
an attachment is in it's life-cycle:
1. attachment_create
    We've created an empty attachment record but haven't done anything
    with it yet.
2. attachment_update
    We provided a connector and set up the TGT so that everything is
    ready for a consumer to connect/use it.
3. attachment_complete
    An ACK back from the consumer letting us know that they connected
    it successfully and are doing their thing.

It would be cool to just key all these checks of the attachment object itself,
and just use attachment_update to do so, maybe in the future?

Change-Id: I3b28d2cb89a8d81c7cdec425f355c78bfdfe3450
Related-Bug: #1710295
2017-08-14 10:27:44 -06:00
maxinjian 2346c309f7 Fix simple parameter comment error
Change-Id: I65c2596297a386ce95ae4c79269f15ddfff62595
2017-03-27 05:50:26 -04:00
John Griffith 22c3693f8c Attach/Detach V2
Add an attachments API
This includes a new attachment controller and shell
commands.  To use you'll need to set your api version
    `export OS_VOLUME_API_VERSION=3.27`

Now you can do things like attach a volume (cinders part at least):
    `cinder attachment-create --connect True ......`

List/show/delete existing attachments:
    `cinder attachment-list`
    `cinder attachment-show <attachment-id>`
    `cinder attachment-delete <attachemnt-id>`

Change-Id: I2c463f0910b6c9e37502869b7ec33073f12939f1
2017-01-26 23:08:40 +01:00