3217 Commits

Author SHA1 Message Date
Matt Riedemann
4bd53dc109 Fix compute service set handling for 2.53+
With compute API microversion 2.53 there is a single
PUT /os-services/{service_id} API which takes the service
id as a UUID. Since the openstack compute service set
command only takes --host and --service (binary) to identify
the service, this change checks if 2.53 or greater is being
used and if so, looks up the service by host and binary and
calls the appropriate methods in novaclient.

If the command cannot uniquely identify a compute service
with the given host and binary, an error is raised. A future
change could add an --id option to be used with 2.53+ to
pass the service id (as UUID) directly to avoid the host/binary
filtering.

Change-Id: I868e0868e8eb17e7e34eef3d2d58dceedd29c2b0
Story: 2005349
Task: 30302
2019-08-09 16:00:13 +00:00
Matt Riedemann
b52a831f6b Mention compute service set --up|--down requires 2.11 or greater
This simply updates the docs for the compute service set --up
and --down options to mention that --os-compute-api-version 2.11
or greater is required to use those options.

Change-Id: I52891fe36c84d0df3e868ab4f3c8e2357e9ba529
2019-07-24 12:03:01 -04:00
Zuul
c474319909 Merge "Add host and hypervisor_hostname to create servers" 2019-07-23 01:32:32 +00:00
Andreas Jaeger
c609b98c40 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: I1572a21632740b4d9a233a6a31c49e3bac5394ef
2019-07-22 20:55:43 +02:00
Zuul
5b97dfa427 Merge "Fix BFV server list handling with --name-lookup-one-by-one" 2019-07-19 17:27:59 +00:00
zhu.boxiang
340f25fa14 Add host and hypervisor_hostname to create servers
Adds the --host and --hypervisor-hostname options to
``openstack server create`` CLI.

Depends-On: https://review.opendev.org/670558

Change-Id: If188c3d96fa506dbe62ef256418f2f9bca1520c2
Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server
2019-07-19 15:45:18 +00:00
Matt Riedemann
879f820778 docs: clarify compute service --service option
The compute service commands emit a "Binary" in the output but
the --service filter option isn't as clear that it's the binary
(for set it is but not list) nor do the docs give an example
of a binary (typically nova-compute but could be others like
nova-conductor, nova-scheduler, etc). This simply mentions that
the --service option is the binary for "compute service list"
and gives an example value for the option in both list and set
help.

Change-Id: If87fc37352c3a251cc89041723adbe04dedf4f8a
2019-07-01 15:06:56 -04:00
melanie witt
bfc34e11b3 Fix BFV server list handling with --name-lookup-one-by-one
When the --name-lookup-one-by-one option passed to the 'server list'
command, the image and flavor names will be looked up for each
server being listed instead of fetching all image/flavor names.

The current code assumes all servers have an image attribute, but
servers booted from volumes have no image, so the following error is
raised when listing BFV servers with --name-lookup-one-by-one:

  AttributeError: ('unicode'|'str') object has no attribute 'get'

The error occurs when the code attempts server.image.get('id').

This fixes the --name-lookup-one-by-one code not to assume an image
for a server. The unit tests for 'server list' have also been
robustified to feature one BFV server to enhance our test coverage.

Story: #2006063
Task: #34777

Change-Id: I312c971346c7ded93f6fcaa515098554b8580295
2019-06-28 22:06:39 +00:00
Zuul
eada2db332 Merge "Use cliff formattable columns in identity commands" 2019-06-23 04:49:33 +00:00
Zuul
f0fafec54f Merge "Use cliff formattable columns in image commands" 2019-06-23 04:30:51 +00:00
Zuul
34a92eebfa Merge "Use cliff formattable columns in object storage commands" 2019-06-23 02:31:15 +00:00
Zuul
46ef850ce9 Merge "Use cliff formattable columns in volume v2 commands" 2019-06-23 00:45:37 +00:00
Zuul
d3df7d67d7 Merge "Use cliff formattable columns in volume v1 commands" 2019-06-23 00:45:36 +00:00
Zuul
3258b9e5e3 Merge "Change default security group protocol to 'any'" 2019-06-22 21:39:31 +00:00
Akihiro Motoki
4cd614305f Use cliff formattable columns in volume v2 commands
Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: I761ccac126208927594ad0d98a3cf5ad8b44bd48
2019-06-22 14:56:10 -05:00
Akihiro Motoki
1af3056e30 Use cliff formattable columns in volume v1 commands
Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: Ib4c5798171e32a8ddc08a37ee1d416e366a71d76
2019-06-22 14:53:28 -05:00
Akihiro Motoki
c2630ae91a Use cliff formattable columns in object storage commands
Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: I65737561c9b5ef29f5878316d2ff89f3d538158f
2019-06-22 18:44:27 +00:00
Akihiro Motoki
8d63e3f0c3 Use cliff formattable columns in image commands
Related functional tests are converted into JSON format.
Otherwise, it is not easy to check results.

Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: Ib82e15738544975fede0c54cc5eaf239f4c67277
2019-06-22 13:36:46 -05:00
Zuul
1a21f02bc7 Merge "Use cliff formattable columns in network commands" 2019-06-22 18:27:00 +00:00
Akihiro Motoki
fa5046a3db Use cliff formattable columns in identity commands
Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: Ia13314a012b3a7363ffb24a13c79c6ecdff1ed7b
2019-06-22 16:18:26 +00:00
Zuul
c20421c467 Merge "Remove deprecated volume commands and args" 2019-06-22 07:17:28 +00:00
Zuul
0bc70a344f Merge "Add server add/remove volume description for microversion 2.20" 2019-06-22 00:27:31 +00:00
Zuul
1d6e24246a Merge "Remove deprecated network options" 2019-06-21 23:00:59 +00:00
Zuul
3161f87c44 Merge "Remove deprecated image commands" 2019-06-21 23:00:57 +00:00
Zuul
377c0ce0f7 Merge "Remove deprecated identity commands and args" 2019-06-21 23:00:56 +00:00
Zuul
d103b3dc88 Merge "Remove deprecated compute commands" 2019-06-21 22:58:17 +00:00
Zuul
17611a72c5 Merge "Microversion 2.73: Support adding the reason behind a server lock" 2019-06-21 20:59:49 +00:00
Zuul
e5cb150b6f Merge "Allow "server migrate" (not live) to take "--host" option" 2019-06-21 19:26:10 +00:00
Zuul
d756f70e39 Merge "Add server event command documentation for compute API 2.21" 2019-06-21 19:26:09 +00:00
Surya Seetharaman
187be0ac22 Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``--reason`` to ``openstack server lock``
command and ``--locked``, ``unlocked`` filtering parameters to
``openstack server list`` command. This can help users to provide a
reason when locking the server and to filter instances based on their
locked value from 2.73 microversion.

Implements blueprint add-locked-reason
Depends-On: https://review.opendev.org/#/c/661785/

Change-Id: Ib2714f98b24d47e570da8a6c231e765acd2ff595
2019-06-21 11:35:51 -05:00
Martin Chlumsky
1aad94349b Allow "server migrate" (not live) to take "--host" option
Currently, doing a cold migration while specifying a target host is not
possible however nova api supports it since version 2.56.

This patch allows passing "--host" when doing a cold migration.
It runs normally if --os-compute-api-version is 2.56 or greater and
returns an error otherwise.

Change-Id: I960109008096ce8bb4e4c8ca6ffb22c33aacd995
Story: 2003325
Task: 24359
2019-06-21 14:47:07 +00:00
Zuul
82823f89f0 Merge "Rename review.openstack.org to review.opendev.org" 2019-06-14 02:25:02 +00:00
Matt Riedemann
3df5f92b44 Add server add/remove volume description for microversion 2.20
The compute API 2.20 microversion allows attaching and detaching
a volume to/from a server with status SHELVED or SHELVED_OFFLOADED.
For OSC this just means the user has to specify the appropriate
minimum microversion to make that work, so this change mentions
that in the "server add volume" and "server remove volume" command
description.

Related to nova blueprint volume-ops-when-shelved

Change-Id: I4824175e5d9e124e3bd9e9a8fd5a89277efc6cff
2019-06-12 11:39:54 -04:00
Matt Riedemann
eb399c52ad Add server event command documentation for compute API 2.21
The 2.21 compute API microversion allows listing instance
action events and getting action event details for a deleted
server (which can be useful for auditing until the deleted
server is purged). As far as OSC is concerned it's just a
matter of specifying --os-compute-api-version 2.21 or higher
when listing events or showing event details, so this change
mentions 2.21 in the description of those commands.

Related to nova blueprint os-instance-actions-read-deleted-instances

Change-Id: If276c794f448b6fa5b0845499f3507a159acab85
2019-06-12 11:23:06 -04:00
Zuul
57dec524c8 Merge "Batch up minor cleanups for release" 2019-06-06 23:19:12 +00:00
Zuul
25ccca4063 Merge "Deprecate openstack server migrate --host option" 2019-06-06 19:05:46 +00:00
Zuul
86d7490f77 Merge "Add changes-before attribute to server list" 2019-06-06 17:40:48 +00:00
Zuul
95626f1acb Merge "Compute: Add description support for server" 2019-06-05 03:25:46 +00:00
zhangbailin
ef1fd38815 Add changes-before attribute to server list
Closes-Bug: #1827844
Part of bp support-to-query-nova-resources-filter-by-changes-before

Change-Id: I4f28168188973730247bcbcb70ba0e70eb81e3be
2019-05-31 05:39:29 +00:00
Matt Riedemann
3057989714 Deprecate openstack server migrate --host option
Per the discussion at the Train Forum [1] this deprecates
the problematic --live option on the server migrate command
which, depending on the compute API version used, forcefully
bypasses the scheduler and also does not allow you to live
migrate a server and let the scheduler pick a host.

The --live option is replaced here with two new options:

* --live-migration: this simply tells the command you want to
  perform a live rather than cold migration; if specified with
  --live the --live-migration option takes priority.

* --host: when specified, this will request a target host for
  the live migration and will be validated by the scheduler;
  if not specified, the scheduler will pick a host. This option
  is mutually exclusive with --live.

We can build on the --host option by supporting cold migrations
with a specified host when using compute API version 2.56 or
greater but that will come in a separate change.

If the --live option is ever used we log a warning.

Note there are several related changes for this issue:

- https://review.openstack.org/#/c/628334/
- https://review.openstack.org/#/c/626949/
- https://review.openstack.org/#/c/627801/
- https://review.openstack.org/#/c/589012/
- https://review.openstack.org/#/c/460059/

This change allows us to deprecate the --live option and provide
a replacement which is backward compatible without having to use
something potentially error-prone like nargs='?'.

Closes-Bug: #1411190

[1] https://etherpad.openstack.org/p/DEN-osc-compute-api-gaps

Change-Id: I95d3d588e4abeb6848bdccf6915f7b5da40b5d4f
2019-05-24 15:57:54 -04:00
Sean McGinnis
e76e10c0ba Remove deprecated volume commands and args
The following were deprecated over two years ago and can now be removed:

* Remove ``backup`` commands in favor of ``volume backup``
* Remove ``snapshot`` commands in favor of ``volume snapshot``
* Remove ``volume create`` options ``--project``, ``--user`` and ``--multi-attach``
* Use of an auth-key positional argument in volume transfers
* ``volume transfer request`` no longer accepts 'auth_key' as a positional arg,
  ``--auth-key`` is now required

Internal (non-user-visible)
* Rename backup.py to volume_backup.py for Volume v1 and v2, update tests

These are backwards incompatible changes and will require a major
version bump after they are merged.

Change-Id: I94aa7a9824e44f9585ffb45e5e7637b9588539b4
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-20 14:05:18 -05:00
Dean Troyer
6f1f44d422 Batch up minor cleanups for release
Change-Id: Id45788e17c5388cee54e79cab1c120cfcc8f9f62
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-20 08:41:28 -05:00
Sean McGinnis
5a0fc68a87 Remove deprecated network options
The following were deprecated for several releases and can now be
removed:

* Remove ``port create|set`` options ``--device-id`` and ``--port-id``
* Remove ``router set`` option ``--clear-routes``
* Remove ``security group rule create`` options ``--src-group`` and ``--src-ip``

These are backwards incompatible changes and will require a major
version bump after they are merged.

Change-Id: Ieae74c14f6b3e263721a3146cf76f94a9ab792f6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-19 18:22:26 -05:00
Dean Troyer
67dadda746 Remove deprecated image commands
* Remove ``image create|set`` option ``--owner``

Change-Id: I1fabab98c8660eba6d0dd75e74544c6c9d432b9e
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-19 17:06:19 -05:00
Sean McGinnis
f9fdc296bc Remove deprecated identity commands and args
The following were deprecated over two years ago and can now be
removed/changed:

* Remove ``service create`` option ``--type``
* Remove ``role list`` options ``--project`` and ``--user``
* Remove ``user role list`` command

These are backwards incompatible changes and will require a major
version bump after they are merged.

Change-Id: I29e2fc9516dffbfd83eef0bc91e834dde99b4105
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-19 12:54:33 -05:00
Sean McGinnis
b7742b5937 Remove deprecated compute commands
The following were deprecated over two years ago and can now be removed:

* ``ip fixed add|remove`` in favor of ``server add|remove fixed ip``
* ``ip floating add|remove`` in favor of ``server add|remove floating ip``

These are backwards incompatible changes and will require a major
version bump after they are merged.

Change-Id: I10c4d32a3c0b55ad41a02afd3b14249bafcb55a9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-19 12:54:24 -05:00
Zuul
91bc0f35de Merge "Remove code migrated to osc-lib long ago" 2019-05-18 18:47:43 +00:00
Zuul
875335b610 Merge "Serialize more aggregate functional tests" 2019-05-18 18:06:03 +00:00
Dean Troyer
99c3be93c8 Serialize more aggregate functional tests
These tests are showing signs of problems running in parallel
so serialse the create/delete/list/set/unset tests.  They all
used two aggregates each anyway...

Change-Id: Iba4b52c179e6914eaeefea1da0f7eaefcdcf1f87
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-17 19:15:28 -05:00
Zuul
e90b79be4c Merge "Fix RuntimeError when showing project which has extra properties" 2019-05-17 23:07:57 +00:00