From ca7f23d0d1876dc53ef4d5ecbf2c5f367aafe13e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 3 Dec 2020 12:41:25 +0000 Subject: compute: Add 'server volume update' command We're not going to expose the ability to swap volumes since that's a things humans should not generally use. From the API docs [1]: When updating volumeId, this API is typically meant to only be used as part of a larger orchestrated volume migration operation initiated in the block storage service via the os-retype or os-migrate_volume volume actions. Direct usage of this API to update volumeId is not recommended and may result in needing to hard reboot the server to update details within the guest such as block storage serial IDs. Furthermore, updating volumeId via this API is only implemented by certain compute drivers. We *do* want users to have the ability to change the delete on termination behavior though, so that's what we expose. [1] https://docs.openstack.org/api-ref/compute/?expanded=update-a-volume-attachment-detail#update-a-volume-attachment Change-Id: I50938e1237b4d298521b26a5f9cb90c018dfebaf Signed-off-by: Stephen Finucane --- openstackclient/compute/v2/server.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'openstackclient/compute/v2/server.py') diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 50299d65..fa27f68c 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -513,27 +513,27 @@ class AddServerVolume(command.Command): '--tag', metavar='', help=_( - "Tag for the attached volume. " - "(Supported by API versions '2.49' - '2.latest')" + 'Tag for the attached volume ' + '(supported by --os-compute-api-version 2.49 or above)' ), ) + # TODO(stephenfin): These should be called 'delete-on-termination' and + # 'preserve-on-termination' termination_group = parser.add_mutually_exclusive_group() termination_group.add_argument( '--enable-delete-on-termination', action='store_true', help=_( - "Specify if the attached volume should be deleted when the " - "server is destroyed. " - "(Supported by API versions '2.79' - '2.latest')" + 'Delete the volume when the server is destroyed ' + '(supported by --os-compute-api-version 2.79 or above)' ), ) termination_group.add_argument( '--disable-delete-on-termination', action='store_true', help=_( - "Specify if the attached volume should not be deleted when " - "the server is destroyed. " - "(Supported by API versions '2.79' - '2.latest')" + 'Do not delete the volume when the server is destroyed ' + '(supported by --os-compute-api-version 2.79 or above)' ), ) return parser -- cgit v1.2.1