Skip to content

Commit 371f5f5

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add 'openstack server migrate (confirm|revert)' commands"
2 parents aa64eb6 + 609988e commit 371f5f5

3 files changed

Lines changed: 34 additions & 5 deletions

File tree

openstackclient/compute/v2/server.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,15 @@ def take_action(self, parsed_args):
15551555
# then adding the groups doesn't seem to work
15561556

15571557
class MigrateServer(command.Command):
1558-
_description = _("Migrate server to different host")
1558+
_description = _("""Migrate server to different host.
1559+
1560+
A migrate operation is implemented as a resize operation using the same flavor
1561+
as the old server. This means that, like resize, migrate works by creating a
1562+
new server using the same flavor and copying the contents of the original disk
1563+
into a new one. As with resize, the migrate operation is a two-step process for
1564+
the user: the first step is to perform the migrate, and the second step is to
1565+
either confirm (verify) success and release the old server, or to declare a
1566+
revert to release the new server and restart the old one.""")
15591567

15601568
def get_parser(self, prog_name):
15611569
parser = super(MigrateServer, self).get_parser(prog_name)
@@ -2159,10 +2167,10 @@ class ResizeServer(command.Command):
21592167
_description = _("""Scale server to a new flavor.
21602168
21612169
A resize operation is implemented by creating a new server and copying the
2162-
contents of the original disk into a new one. It is also a two-step process for
2163-
the user: the first is to perform the resize, the second is to either confirm
2164-
(verify) success and release the old server, or to declare a revert to release
2165-
the new server and restart the old one.""")
2170+
contents of the original disk into a new one. It is a two-step process for the
2171+
user: the first step is to perform the resize, and the second step is to either
2172+
confirm (verify) success and release the old server or to declare a revert to
2173+
release the new server and restart the old one.""")
21662174

21672175
def get_parser(self, prog_name):
21682176
parser = super(ResizeServer, self).get_parser(prog_name)
@@ -2261,6 +2269,12 @@ def take_action(self, parsed_args):
22612269
server.confirm_resize()
22622270

22632271

2272+
class MigrateConfirm(ResizeConfirm):
2273+
_description = _("""Confirm server migrate.
2274+
2275+
Confirm (verify) success of migrate operation and release the old server.""")
2276+
2277+
22642278
class ResizeRevert(command.Command):
22652279
_description = _("""Revert server resize.
22662280
@@ -2286,6 +2300,13 @@ def take_action(self, parsed_args):
22862300
server.revert_resize()
22872301

22882302

2303+
class MigrateRevert(ResizeRevert):
2304+
_description = _("""Revert server migrate.
2305+
2306+
Revert the migrate operation. Release the new server and restart the old
2307+
one.""")
2308+
2309+
22892310
class RestoreServer(command.Command):
22902311
_description = _("Restore server(s)")
22912312

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
features:
3+
- |
4+
Add ``server migrate confirm`` and ``server migrate revert`` commands.
5+
These are aliases of the ``server resize confirm`` and ``server resize revert``
6+
commands, respectively.

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ openstack.compute.v2 =
105105
server_list = openstackclient.compute.v2.server:ListServer
106106
server_lock = openstackclient.compute.v2.server:LockServer
107107
server_migrate = openstackclient.compute.v2.server:MigrateServer
108+
server_migrate_confirm = openstackclient.compute.v2.server:MigrateConfirm
109+
server_migrate_revert = openstackclient.compute.v2.server:MigrateRevert
108110
server_pause = openstackclient.compute.v2.server:PauseServer
109111
server_reboot = openstackclient.compute.v2.server:RebootServer
110112
server_rebuild = openstackclient.compute.v2.server:RebuildServer

0 commit comments

Comments
 (0)