Switch the server volume list command from novaclient to SDK.
Modified functional test for server add/remove volume.
Change-Id: I5b4ab7d0275aec2e02451c5371319ac350af6a5f
A recent change to cliff [1] means we're now stripping periods when
generating the summary line of command help strings. Account for this.
[1] https://review.opendev.org/c/openstack/cliff/+/867274
Change-Id: I45b39b9fe38914497505f157e91d84cd2f84f547
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
When creating a server with an attached volume, you can specify a block
device with a 'boot_index' of '0' and this will become the bootable
device. OSC allows users to do this by using either the '--volume'
option or a combination of the '--image' and '--boot-from-volume'
options, but we should also allow them to do it the "hard way" via the
'--block-device' option. For example:
openstack server create \
--block-device uuid=0a89ecd8-1fe2-45f0-94da-7789067911c9,boot_index=0 \
--block-device uuid=589266ef-fd88-46e9-b7b2-94503ce8f88f,boot_index=1 \
... \
my-server
Make this possible.
Change-Id: Ia48449fecbc590346630807b1c7da40102d53b33
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010376
Task: 46617
The 'server create' command should support multiple '--block-device'
parameters. Prove it.
Change-Id: I1bd83287efdbbe11774053b694bae99b6a4ebdf5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This reverts commit 042be7c7fe89f5a1a190af90d5980205d995941b. This
solution worked but it was confusing. The issue that the author was
seeing was presumably due to users not being able to list projects but in
theory the 'openstackclient.image.common.find_project' function that was
being called here should have already handle this. It transpires however
that there was a bug in this and we weren't correctly handling HTTP 403
errors correctly. This bug has since been fixed in change
I2ea2def607ec5be112e42d53a1e660fef0cdd69c meaning this change is no
longer necessary. Remove it and simplify the code somewhat.
Change-Id: I108efec2c8deda50fcb9cc84f313602bed2ac15c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Off the back of a recent post to openstack-discuss [1], list the common
actions used in OSC along with some conditions around their expected
use and implementation.
[1] https://lists.openstack.org/pipermail/openstack-discuss/2022-November/031284.html
Change-Id: Id6610d678e7b3b12afdd89a674fbbe7090f64444
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Update server list to use the compute component of the OpenStack SDK
instead of directly using the nova interface. This change depends on SDK
version 0.102.0 for automatic client-side query filters.
Change-Id: Ib9985812bfd98320b75f3a82bb594a0daa6e4d93
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
Note that we require some additional functionality in SDK for this to
work properly, but it's a start.
Change-Id: I87f94db6cced67f36f71685e791416f9eed16bd0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This is the equivalent of the 'image-stage' glanceclient command.
Change-Id: I10b01ef145740a2f7ffe5a8c7ce0296df0ece0bd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
You can provide data via stdin when creating an image. Using this with
'--progress' makes no sense and causes an error currently. Fix this.
Change-Id: I3c2d658b72a7c62931b779b0d19bb97f60a0c655
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>