752 Commits

Author SHA1 Message Date
Zuul
90fe18e51b Merge "Dropping the use of 'addFixedIp' server action" 2023-05-18 11:52:56 +00:00
Zuul
d0a17d48a9 Merge "compute: Fix bug with start/stop server" 2023-05-17 23:20:17 +00:00
Stephen Finucane
e91844dd0e Dropping the use of 'addFixedIp' server action
Dropping the use of 'AddFixedIp' server action entirely in favour of
creating an interface with a fixed IP using the 'os-interface' API. The
reason for doing this is because this mechanism allows us to request an
explicit fixed IP.

Adds back support for using the --fixed-ip-address argument for users
who use older nova-api versions.

Change-Id: Ieac4b0fbcb38fe7207eaaa6a79e0c6770ee11d80
2023-05-17 17:47:05 +01:00
Stephen Finucane
0a63f8603e compute: Fix bug with start/stop server
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
2023-05-17 15:59:33 +01:00
Pavlo Shchelokovskyy
417a7ad203 Allow server rebuild --wait for SHUTOFF servers
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
2023-05-17 11:38:37 +00:00
Stephen Finucane
28ffa2bf9f Blacken openstackclient.compute
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>
2023-05-10 10:51:30 +01:00
Stephen Finucane
2454636386 compute: Generate SSH keypairs ourselves
Starting with the 2.92 microversion, nova will no longer generate SSH
keys. Avoid breaking users by generating keypairs ourselves using the
cryptography library, which was already an indirect dependency through
openstacksdk.

Change-Id: I3ad2732f70854ab72da0947f00847351dda23944
Implements: blueprint keypair-generation-removal
2023-05-02 12:18:52 +01:00
Huda Irshad
737540cca0 Migrate 'server event *' commands to SDK
This one is tricky since the ServerAction resources includes a nested
ServerActionEvent resource which requires a custom formatter in order
for things to render as expected.

Change-Id: I3d24851303222af9efcee8d7e1565278b1018efd
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2023-04-20 12:09:59 +01:00
Stephen Finucane
864f51f427 compute: Migrate 'reboot server' to SDK
Change-Id: Ibad4078f680d3b2615b9ca6f6c72c4fd28030b55
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-04-04 13:40:38 +01:00
Zuul
5282bd2622 Merge ""hypervisor list --matching" showed the wrong result" 2023-04-04 08:10:09 +00:00
Zuul
5d2687bfc4 Merge "Switch server shelve, unshelve to SDK" 2023-04-03 20:36:13 +00:00
Zuul
eafe579534 Merge "compute: Switch server restore to SDK" 2023-04-03 20:36:11 +00:00
Zuul
17d03f49aa Merge "Switch server start, server stop to SDK" 2023-03-30 19:05:02 +00:00
Zuul
4e9181aa1e Merge "Switch server lock, unlock to sdk" 2023-03-30 19:05:00 +00:00
devMuscle
e74f2d94fe "hypervisor list --matching" showed the wrong result
Previously, using the "--matching" option shows empty results.
Previously, the "--matching" option called the "find_hypervisor method",
so we used to call the "hypervisor method"
like any other "--limit, --marker" options.

Depending on the nova api version, the api that is basically
called is as follows
2.53 >= : /os-hypervisors/detail?hypervisor_hostname_pattern=$HOSTNAME
2.53 < : /os-hypervisors/{pattern}/search

Hypervisor Type and Host IP are not returned
when using microversion 2.52 or lower

Co-authored-by: Jipyo Hong <hongsbien@naver.com>
Co-authored-by: Jieon Lee <dlwldjs7544@naver.com>
Co-authored-by: YoonSoo LIM <msdbtjd123@naver.com>

story: 2010670
task: 47726
Change-Id: I7b47acf48def7d4c5f4b74e4dba1c23d8ac7abf2
2023-03-26 14:06:36 +09:00
Zuul
a7e091c329 Merge "Update 'host list' and 'host show' command to use sdk" 2023-02-22 12:32:18 +00:00
Zuul
14dff075ff Merge "Fix really long help strings" 2023-02-22 12:32:16 +00:00
Zuul
861e1a8eee Merge "Finish switching server migration to sdk" 2023-02-21 13:28:47 +00:00
Zuul
dfe2bc9fbd Merge "compute: 'server volume update' -> 'server volume set'" 2023-02-21 13:28:40 +00:00
Zuul
2249d0026d Merge "Switch server volume update to sdk" 2023-02-21 13:28:37 +00:00
Zuul
fa90ad1392 Merge "Switch list server volume to sdk" 2023-02-21 13:28:35 +00:00
Harsh Mutha
ecc6aeeede Update 'host list' and 'host show' command to use sdk
Change-Id: I3813ff604ba46112ebd358509ea4f28ee38ca3ee
2022-12-20 12:11:13 +00:00
Stephen Finucane
f56f0e333e Switch server shelve, unshelve to SDK
This one is a little more complicated because we support waiting.

Change-Id: I5bd65b44c23bfee1e0144dbd060563ecc3cfb942
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-19 17:25:23 +00:00
Stephen Finucane
004b2ab2fb compute: Switch server restore to SDK
Change-Id: I8df9711b736991c01136988aa06c8540d640f52f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/868108
2022-12-19 17:02:48 +00:00
Thrivikram Mudunuri
9241514137 Switch server start, server stop to SDK
Switch the server start and server stop commands from novaclient to SDK.

Change-Id: I5ebfa6b2468d5f20b99ea0eab1aea9377be09b8c
2022-12-19 16:56:20 +00:00
suneethravi
ce8171bad9 Switch server lock, unlock to sdk
Switch server lock commands from novaclient to SDK.

Change-Id: I042db99c9d7a0d8d207f8cdf69d786bd4fe904e7
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/867890
2022-12-19 16:55:46 +00:00
Zuul
b2c9a4cd40 Merge "Switch server dump create to using sdk" 2022-12-15 20:14:43 +00:00
Stephen Finucane
e0577e7ebe compute: 'server volume update' -> 'server volume set'
We use 'set', not 'update', in command names. An alias is provided.

Change-Id: I7864599e06df055999b975aabf101611cd482753
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-15 18:22:08 +00:00
Zuul
e00400eff5 Merge "Use the SDK in server migration list" 2022-12-15 18:05:11 +00:00
Ritvik Vinodkumar
25b4714f1c Switch server volume update to sdk
Switch the server volume update command from novaclient to SDK.

Change-Id: Ib9876775bcf8268344da1a58ab0dd1695cb83ece
2022-12-15 17:54:06 +00:00
Zuul
a103b6ca34 Merge "Use the SDK for server show" 2022-12-15 17:45:29 +00:00
Zuul
3f7663a00e Merge "Fix parameter handling in server add fixed ip cmd" 2022-12-15 17:45:27 +00:00
Zuul
3aff444386 Merge "Migrate hypervisor stats commands to SDK" 2022-12-15 17:45:23 +00:00
Ritvik Vinodkumar
d47e432005 Switch list server volume to sdk
Switch the server volume list command from novaclient to SDK.
Modified functional test for server add/remove volume.

Change-Id: I5b4ab7d0275aec2e02451c5371319ac350af6a5f
2022-12-15 17:39:16 +00:00
Diwei Zhu
c47998c59a Switch server dump create to using sdk
Change-Id: I8e2a4651bff1f739fa98533cd47074b143b2e3d6
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2022-12-15 17:19:44 +00:00
Violet Kurtz
d1c1c36af1 Finish switching server migration to sdk
Change-Id: Ic0e6dfdc986989599bfc73b8c274631232161c25
2022-12-14 22:07:47 +00:00
Thobias Salazar Trevisan
794334ec24 Fix server list error with --long and -c options
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
2022-12-14 15:19:08 -03:00
Stephen Finucane
b52ae93cd2 Fix functional-tips job
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>
2022-12-14 10:39:44 +00:00
Ariel-Berkowicz
992cfdfb57 Migrate hypervisor stats commands to SDK
Change-Id: I43b2071f5108c28f6881c8e99d4b06e87c83ddfa
2022-12-12 18:58:16 -05:00
Stephen Finucane
5afe48040c Fix really long help strings
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>
2022-12-12 18:04:01 +00:00
Dr. Jens Harbott
f23322c5ef Fix parameter handling in server add fixed ip cmd
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
2022-12-12 12:27:48 -05:00
Daniel Wilson
70dbb01ea3 Use the SDK for server show
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
2022-12-11 18:04:29 -05:00
Zuul
8248efa8d9 Merge "compute: Allow users to manually specify bootable volumes" 2022-12-05 12:59:46 +00:00
Zuul
70f05a6610 Merge "Use the compute SDK in server list" 2022-12-02 14:21:38 +00:00
Stephen Finucane
91277e7e51 compute: Allow users to manually specify bootable volumes
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
2022-12-01 15:24:08 +00:00
Daniel Wilson
86c5470134 Use the SDK in server migration list
Update server migration list to use the OpenStack SDK instead of
directly using the nova interface.

Change-Id: I40dc95ee47e7c33ebf596f8ad437228b4bb0ab33
2022-11-30 12:18:31 +00:00
Daniel Wilson
c97f73ce2a Use the compute SDK in server list
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
2022-11-29 20:24:45 -05:00
Zuul
0a9533709f Merge "Improve server dump create helptext" 2022-11-29 20:52:23 +00:00
Zuul
6413b25dec Merge "Add note about microversion 2.87 in server rescue help" 2022-11-29 20:49:50 +00:00
Zuul
e708ddc2a3 Merge "Moved hypervisor to the SDK" 2022-11-16 11:18:32 +00:00