summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-06-10 17:09:56 +0100
committerDean Troyer <dtroyer@gmail.com>2019-09-10 13:45:41 +0000
commit609988ebac2c6bbb596aa77b46589274ffbc1e07 (patch)
tree6379f165b9b9c4e170c76f19959797b04c5b2086 /openstackclient
parenta15e4741fa1c02e3e87ce072cfee2b19f9279924 (diff)
downloadpython-openstackclient-609988ebac2c6bbb596aa77b46589274ffbc1e07.tar.gz
Add 'openstack server migrate (confirm|revert)' commands
While cold migration and resize are essentially the same operation under the hood, meaning one could use the 'openstack server resize confirm' and 'openstack server resize revert' commands instead, there is no reason the operator needs to know this. Add these flags as syntactic sugar to help simplify operators lives. The help texts for both the 'openstack server resize' and 'openstack server migrate' commands are updated to clarify the relationship between the two operations. Change-Id: I0cb6304c794bffaec785add9f7b8cf53ab28cacd Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/compute/v2/server.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 493fd5ad..09629138 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -1555,7 +1555,15 @@ class LockServer(command.Command):
# then adding the groups doesn't seem to work
class MigrateServer(command.Command):
- _description = _("Migrate server to different host")
+ _description = _("""Migrate server to different host.
+
+A migrate operation is implemented as a resize operation using the same flavor
+as the old server. This means that, like resize, migrate works by creating a
+new server using the same flavor and copying the contents of the original disk
+into a new one. As with resize, the migrate operation is a two-step process for
+the user: the first step is to perform the migrate, and the second step is to
+either confirm (verify) success and release the old server, or to declare a
+revert to release the new server and restart the old one.""")
def get_parser(self, prog_name):
parser = super(MigrateServer, self).get_parser(prog_name)
@@ -2159,10 +2167,10 @@ class ResizeServer(command.Command):
_description = _("""Scale server to a new flavor.
A resize operation is implemented by creating a new server and copying the
-contents of the original disk into a new one. It is also a two-step process for
-the user: the first is to perform the resize, the second is to either confirm
-(verify) success and release the old server, or to declare a revert to release
-the new server and restart the old one.""")
+contents of the original disk into a new one. It is a two-step process for the
+user: the first step is to perform the resize, and the second step is to either
+confirm (verify) success and release the old server or to declare a revert to
+release the new server and restart the old one.""")
def get_parser(self, prog_name):
parser = super(ResizeServer, self).get_parser(prog_name)
@@ -2261,6 +2269,12 @@ Confirm (verify) success of resize operation and release the old server.""")
server.confirm_resize()
+class MigrateConfirm(ResizeConfirm):
+ _description = _("""Confirm server migrate.
+
+Confirm (verify) success of migrate operation and release the old server.""")
+
+
class ResizeRevert(command.Command):
_description = _("""Revert server resize.
@@ -2286,6 +2300,13 @@ one.""")
server.revert_resize()
+class MigrateRevert(ResizeRevert):
+ _description = _("""Revert server migrate.
+
+Revert the migrate operation. Release the new server and restart the old
+one.""")
+
+
class RestoreServer(command.Command):
_description = _("Restore server(s)")