summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/server.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "compute: Fix bug with start/stop server"Zuul2023-05-171-4/+4
|\
| * compute: Fix bug with start/stop serverStephen Finucane2023-05-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | A mistake was introduced during the conversion from novaclient to SDK in change I5ebfa6b2468d5f20b99ea0eab1aea9377be09b8c. Fix the issue and add functional tests to prevent it being reintroduced. Change-Id: I6b314eab31bcf452e88b8b6a239ac2e296497cb9 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Story: 2010750 Task: 48004
* | Allow server rebuild --wait for SHUTOFF serversPavlo Shchelokovskyy2023-05-171-0/+10
|/ | | | | | | | | | | | | | | currently the command is waiting only for ACTIVE server status, but if the server was SHUTOFF before, it will be SHUTOFF after rebuild as well, so the command is stuck in waiting forever. Additionally, we now also pre-validate the server status on client side, and raise an error if the server to be rebuilt is not in ACTIVE, ERROR or SHUTOFF state. Change-Id: If90a4bbba9a7ecd972f8b594c52fee4f75a0ae5e Co-Authored-By: Oleksiy Molchanov <omolchanov@mirantis.com> Story: 2010751 Task: 48005
* Blacken openstackclient.computeStephen Finucane2023-05-101-240/+359
| | | | | | | | | | 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: I9af45c062d179ab3dc2a5e969e1c467932753a2b Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* compute: Migrate 'reboot server' to SDKStephen Finucane2023-04-041-14/+15
| | | | | Change-Id: Ibad4078f680d3b2615b9ca6f6c72c4fd28030b55 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Switch server shelve, unshelve to SDK"Zuul2023-04-031-34/+48
|\
| * Switch server shelve, unshelve to SDKStephen Finucane2022-12-191-34/+48
| | | | | | | | | | | | | | This one is a little more complicated because we support waiting. Change-Id: I5bd65b44c23bfee1e0144dbd060563ecc3cfb942 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "compute: Switch server restore to SDK"Zuul2023-04-031-5/+6
|\ \ | |/
| * compute: Switch server restore to SDKStephen Finucane2022-12-191-5/+6
| | | | | | | | | | | | Change-Id: I8df9711b736991c01136988aa06c8540d640f52f Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/868108
* | Merge "Switch server start, server stop to SDK"Zuul2023-03-301-14/+30
|\ \ | |/
| * Switch server start, server stop to SDKThrivikram Mudunuri2022-12-191-14/+30
| | | | | | | | | | | | Switch the server start and server stop commands from novaclient to SDK. Change-Id: I5ebfa6b2468d5f20b99ea0eab1aea9377be09b8c
* | Merge "Switch server lock, unlock to sdk"Zuul2023-03-301-17/+27
|\ \ | |/
| * Switch server lock, unlock to sdksuneethravi2022-12-191-17/+27
| | | | | | | | | | | | | | Switch server lock commands from novaclient to SDK. Change-Id: I042db99c9d7a0d8d207f8cdf69d786bd4fe904e7 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/867890
* | Merge "Fix really long help strings"Zuul2023-02-221-18/+16
|\ \
| * | Fix really long help stringsStephen Finucane2022-12-121-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge "compute: 'server volume update' -> 'server volume set'"Zuul2023-02-211-6/+2
|\ \ \ | |_|/ |/| |
| * | compute: 'server volume update' -> 'server volume set'Stephen Finucane2022-12-151-6/+2
| | | | | | | | | | | | | | | | | | | | | We use 'set', not 'update', in command names. An alias is provided. Change-Id: I7864599e06df055999b975aabf101611cd482753 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "Switch server dump create to using sdk"Zuul2022-12-151-6/+4
|\ \ \
| * | | Switch server dump create to using sdkDiwei Zhu2022-12-151-6/+4
| |/ / | | | | | | | | | | | | Change-Id: I8e2a4651bff1f739fa98533cd47074b143b2e3d6 Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
* | | Merge "Use the SDK for server show"Zuul2022-12-151-14/+69
|\ \ \
| * | | Use the SDK for server showDaniel Wilson2022-12-111-14/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the SDK for the server show command. This change modifies a helper function that is used by server show as well as other commands that print information about an individual server. The helper still uses novaclient APIs when additional OpenStack requests are needed since some of its callers are still using the nova client. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/864340 Change-Id: Ic253184ee5f911ec2052419d328260dc4664b273
* | | | Merge "Fix parameter handling in server add fixed ip cmd"Zuul2022-12-151-6/+6
|\ \ \ \
| * | | | Fix parameter handling in server add fixed ip cmdDr. Jens Harbott2022-12-121-6/+6
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fixed_ip_address parameter needs to be passed in a hash with key "ip_address" in order to be processed by the server, the previous arg was simply being ignored. Added a functional test for better coverage. Closes-Bug: 1998927 Change-Id: I6956d2642d8e80fc10c3739f0a571aa7ba276b1a
* | | | Fix server list error with --long and -c optionsThobias Salazar Trevisan2022-12-141-3/+3
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using options --long and -c and specifying same columns added by --long option, it passes duplicated column names to prettytable and report the following error: Field names must be unique! This patch removes duplicated columns. Change-Id: I9c0bd09c50dac568ca1980a6b53a6c544b85c2aa
* | | Fix functional-tips jobStephen Finucane2022-12-141-4/+5
|/ / | | | | | | | | | | | | | | | | | | 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>
* | Merge "compute: Allow users to manually specify bootable volumes"Zuul2022-12-051-6/+13
|\ \ | |/ |/|
| * compute: Allow users to manually specify bootable volumesStephen Finucane2022-12-011-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Use the compute SDK in server list"Zuul2022-12-021-52/+74
|\ \ | |/ |/|
| * Use the compute SDK in server listDaniel Wilson2022-11-291-52/+74
| | | | | | | | | | | | | | | | 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
* | Merge "Improve `server dump create` helptext"Zuul2022-11-291-2/+3
|\ \
| * | Improve `server dump create` helptextArtom Lifshitz2022-10-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `server dump create` command instructs Nova to trigger a crash dump in the guest OS. Assuming the guest supports this, the resulting dump file will be located in the guest, in a location dependent on the guest OS. Explain all that in the helptext. Story: 2010384 Change-Id: If940ed5cce6c5ab4193ab1494738149370da9aad
* | | Merge "Add note about microversion 2.87 in server rescue help"Zuul2022-11-291-1/+5
|\ \ \ | |_|/ |/| |
| * | Add note about microversion 2.87 in server rescue helpmelanie witt2022-11-071-1/+5
| |/ | | | | | | | | | | | | | | | | | | | | The ability to rescue a volume-backed server was added in compute microversion 2.87 [1]. This adds a note to the command help to improve user experience. [1] https://docs.openstack.org/nova/latest/user/rescue.html Change-Id: I5f40c3ca28e13bd1f979bc5f8c337302a3b9a5be
* | compute: Add missing microversion check for networksStephen Finucane2022-11-081-0/+8
| | | | | | | | | | | | | | | | | | | | The 'auto' and 'none' network allocation policies are only supported on compute API microversion 2.37 or later. Enforce this in the code. Change-Id: I90f8fb1e61ead4bd406ea76bbeb731b913805b13 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2010385 Task: 46657
* | compute: Fix '--network none/auto' handlingStephen Finucane2022-11-081-5/+6
| | | | | | | | | | | | | | | | | | | | This should lookup a network called 'none' or 'auto', not do the equivalent on '--nic none' or '--nic auto'. Correct this. Change-Id: I3c5acc49bfe8162d8fb6110603da56d56090b78f Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2010385 Task: 46658
* | compute: Add '--no-network', '--auto-network' flagsStephen Finucane2022-10-261-24/+86
|/ | | | | | | These are aliases for '--nic none' and '--nic auto', respectively. Change-Id: I7b4f7e5c3769a813bd8b2b9cd6090c6fe501e13d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Fix server evacuate command"Zuul2022-09-301-2/+2
|\
| * Fix server evacuate commandPavlo Shchelokovskyy2022-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think it has ever worked in fact.. The server.evacuate() in novaclient returns not a Server() instance, but a TupleWithMeta() object, that has no .to_dict() method [0] used in _prep_server_detail() function. [0] https://review.opendev.org/c/openstack/python-novaclient/+/276639 Change-Id: I22f9ac072eb1b0bfd1263a256e9bea4500c03290 Story: 2010204 Task: 45928
* | Merge "compute: Only retrieve necessary images"Zuul2022-09-301-7/+24
|\ \
| * | compute: Only retrieve necessary imagesStephen Finucane2022-04-121-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Glance API allows us to filter by multiple IDs using the 'in:' operator. Take advantage of this to speed up listing of server in larger deployments where image counts in the hundreds (or even thousands) are not uncommon. Unfortunately the Nova API does not support something similar for listing flavors. Boo. Change-Id: I7d3222d0b0b8bf72b4ff3e429bc49e621b569979 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/837613
* | | compute: Add support for microversion 2.93whoami-rajat2022-09-141-0/+57
| | | | | | | | | | | | | | | | | | | | | Add '--reimage-boot-volume' and '--no-reimage-boot-volume parameters' to the rebuild command to allow rebuilding of volume backed instances. Change-Id: I4a6e30b2cf12f32202a2d9ef1ced347e1dd139f3
* | | compute: Require image when rebuilding a volume-backed serverwhoami-rajat2022-09-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A volume-backed server will have no image attribute (or rather the image property will be set to the empty string). As such, if you want to try rebuild you will need to specify an image [*]. Enforce this. [*] Before microversion 2.93, this must be the same image. However, we don't touch on that here. This will be addressed later. Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4 Story: 2010297 Task: 46290
* | | Microversion 2.91: Support specifying destination host to unshelveRené Ribaud2022-08-221-1/+38
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This patch adds a new parameter ``--host`` to ``openstack server unshelve`` command. This can help administrators to specify an ``host`` to unshelve a shelve offloaded server. And add new parameter ``--no-availability-zone`` to unpin a server availability These parameters are available in the 2.91 microversion. Depends-On: https://review.opendev.org/c/openstack/python-novaclient/+/831651 Implements: blueprint unshelve-to-host Change-Id: I7986adc7563f63bcd4b3caf5eb7bc4329b4e1eca
* | Merge "Add more filter option of columns for server list -c COLUMN"Zuul2022-06-201-0/+21
|\ \
| * | Add more filter option of columns for server list -c COLUMNJIHOJU2022-04-191-0/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | In order to improve the convenient of use, columns corresponding to the "--long" option has been added so that it can be used in the filter. Currently filterable columns include the following: 'ID', 'Name', 'Status', 'Networks', 'Image', 'Flavor'. Story: 2009150 Task: 43113 Change-Id: I6760ca5da0e3707d1d746ae5eeec7d9162020d15
* | Add 'Host Status' to 'server list --long' with >= v2.16melanie witt2022-05-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the 'Host Status' field is shown only for 'server show' but not for 'server list'. The host_status can be helpful for users who are having issues with servers that show a status of ACTIVE, as it can show a hint about the compute host status when nova policy is configured to allow it. Story: 2009689 Task: 44003 Change-Id: I6209cf52044218b7b32ab2fa5712574f12ba2f5f
* | Merge "Fix typos"Zuul2022-05-161-2/+2
|\ \ | |/ |/|
| * Fix typosCyril Roelandt2021-10-261-2/+2
| | | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | compute: Add 'Security Groups' for 'server list'Thobias Salazar Trevisan2022-03-151-0/+11
| | | | | | | | | | | | | | Add a column with security groups name for --long option on server list. Change-Id: I7062f224e18c3c8ac96a06d7ce97f9fab473bdb9
* | compute: Move server migrations commands to their own fileStephen Finucane2022-03-091-463/+0
| | | | | | | | | | | | | | | | The 'openstackclient.compute.v2.server' module is getting rather large. The server migration commands don't need to be in there. Move them. Change-Id: I8b2600cfd9f8e37d3093c52c7222d85e84e7fc89 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>