An openstacksdk 'find_foo' proxy method will return None by default if a
resource is not found. You can change this behavior by setting
'ignore_missing=False'. We were doing this in most, but not all cases:
correct the issue.
In the event of calling 'image delete' with multiple images, it will no
longer fail on the first missing image and will instead attempt to
delete remaining images before failing.
Change-Id: I1e01d3c096dcaab731c28e496a182dd911229227
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Add some pagination helpers to configure pagination parameters for
various commands. Two pagination schemes are supported, based on what we
currently support across OSC commands: marker-based pagination and
offset-based pagination.
Change-Id: I551bb4c3ff0568c6df5244a1d0f0669497bee58f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
When creating a volume, the scheduler hints can be supplied as strings.
The "same_host" and "different_host" hints can also be supplied as a
list if affinity/anti-affinity to multiple volumes is requested [0]
The previously-used `KeyValueAction` only supplies strings as values - the
last one if multiple --hint contain the same key. An alternative already
used in `CreateServer` would be `KeyValueAppendAction`, but only a subset of
the scheduler hints accept lists, so we cannot use that in general.
Therefore, we create `KeyValueHintAction`. It contains both a
`KeyValueAction` and a `KeyValueAppendAction` object and calls the
appropriate action based on the beginning of the given values as defined
in `APPEND_KEYS`.
[0] d96b705774/cinder/api/schemas/scheduler_hints.py (L31-L65)
Change-Id: Ida7f4662dc9fea24510758541fd4f2622b73bf31
Another quality of life improvements. The key for this one is weird and
the whole thing is a little more involved, hence why it's kept separate.
Change-Id: I75aa85f27905104dc84fffe823c01b4c90a6a822
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Add aliases for the enabling multiattach, caching and replication via
extra spec properties. These are useful since the syntax for setting
each of them is a bit weird and frankly not very discoverable.
Change-Id: I08b51224c66a34a9dcfcffc95847e61d9aac0e7e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Starting in volume API microversion 3.52, it is possible to filter
volume types by extra specs (a.k.a. properties). Even non-admins can do
this for so-called "user visible" extra specs. Make it possible to do
this.
While we're here, the test file is renamed to match the name of the
module under test.
Change-Id: Ia9acc06c0c615bf24e12b63146ea97ac2505f596
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This patch migrates following volume backend commands to SDK:
volume backend capability show
volume backend pool list
Change-Id: Idded38a5f87d51574426c4ac10c806af52984b7c
It's of interest which backups are incremental or full. Returning this
information as a column to the list of backups.
Change-Id: I766330228634d5db678df11c23877077a3635372
We use flags, not options with boolean-like values, for boolean
parameters. The affected commands were only introduced recently so this
should have minimal fallout.
Change-Id: I700733e750bff539806af167c9d47cec769c3343
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This removes the need for a number of base test case subclasses. We use
'image_client' rather than 'client' to avoid conflicts with clients for
other services.
Note that this highlights a minor bug with the 'volume create' command
when using the v1 block storage API and creating a volume from an image.
This is corrected, though it can be assumed that no one is actually
using this code path to say it hasn't been reported in the few years
since the bug was introduced in Ussuri.
Change-Id: I571be27f68bb7669dcb883f3b4799731b4a35479
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This patch migrates the following backup commands to SDK:
* Create Backup
* Show Backup
* List Backup
* Restore Backup
* Delete Backup
Change-Id: Icfadd65b92f4cd343bc327d33e29767bc9b969f9
Supporting "--no-property" option will apply user a convenient way to
clean all properties of volume qos in a short command. The patch adds
"--no-property" option in "volume qos set" command and update related
test cases and docs.
Change-Id: I1fb5b4f0a923bbf557a3af3f63809bde9e84ffd4
We also rename the test file and fixup some of the tests.
Change-Id: I3731255648dc91c023a1390c3b37e68b6608f850
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
Story: 2008478
Task: 41518
Black used with the '-l 79 -S' flags.
A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.
Change-Id: Ic318617c67ab7ce6527f9016b759a1d4b0b80802
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch add a check to be sure that the volume created is in a
available state before trying to set bootable or readonly flag.
Story: 2002158
Change-Id: I8db71fd8cf5bd14eb67880f76d2e9135edeb3ed2
There are now many ways to create a new volume group, thus the
positional arguments don't make sense. Deprecate them.
Change-Id: Id0b212426861719db1812b7d07b82613cf591de4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch adds ``--source-group`` and ``--group-snapshot`` options
to the ``volume group create`` command to allow creating group from
a source group or a group snapshot.
Change-Id: I87482a5dd43c519dfdcf981635aa879914a70a5c
This patch adds the ``block storage volume manageable list`` and
``block storage snapshot manageable list`` commands that
allow operators to list the volumes and snapshots on a
particular host or cluster for management under OpenStack.
Change-Id: I328dada5a0dc4e9e44c0d51db5cf3f224e27f88f
This patch adds the ``block storage cleanup`` command that
allow operators to cleanup resources (volumes and snapshots) with
failed operations by requesting services in other hosts in the
same cluster to cleanup resources of a failed service.
Change-Id: I1375223f525021db5201fa0a9f9a647d17dd01f7
This patch adds the ``block storage log level list`` and
``block storage log level set`` commands that allow
operators to list the current log levels of cinder services
and also enables them to set a particular log level.
Change-Id: I16cd8084fb505a9e68a35a936ef3b8b1f3cdc712
The '--consistency-group-source' and '--consistency-group-snapshot' opts
are unnecessarily verbose. Shorten them to '--source' and '--snapshot',
respectively, maintaining aliases to avoid breaking users.
Change-Id: I2b6656a8a09d953eb4406f1d4fd1e804743a8963
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch adds the ``volume summary`` command which shows the total
size, total count and metadata of all volumes.
This command is available from microversion 3.12 and the metadata
info is available from microversion 3.36.
Change-Id: I6472337e8b1dc91aad5fbe416673a5d5a5d5fa88
Each command should have a summary line followed by a longer
description, if needed. Some commands were not following this. Fix them.
Change-Id: If1ce7654037d192626460f34c069ea0979919b9b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch adds a test to create a new volume from source.
We also include code changes to pass the right size i.e. either
size passed by the user via --size argument or the source volume
size. This case is already handled at the API layer[1] but it
helps being consistent with passing the right size value as in case
of creating a volume from snapshot or backup.
[1] 7c1a5ce7b1/cinder/api/v3/volumes.py (L381-L382)
Change-Id: Idc71636dad6bb678fe24f19b0836d2e9bd92d7d2
Support for creating a volume from backup was added in
microversio 3.47. This patch adds a --backup option
to the volume create command to add that support.
Change-Id: Ib26d2d335475d9aacbf77c0fd7b7cda2ba743943
The command "volume attachment create" has a typo in the docstring.
The docstring says to use "server add volume", but the command is
actually "server volume add". This
change fixes the typo in the docstring.
Task: 46781
Story: 2010401
Change-Id: Ie19a24ead100dd9177669653a7a9997772ef4538