Commit Graph

274 Commits

Author SHA1 Message Date
Rajesh Tailor 533d5df516 Bump microversion to 2.96
This change bumps to microversion 2.96 and add
release notes.

Change-Id: I3b9775f1adecdca121a68a4caa6cd25e312dec2f
2024-03-07 17:30:06 +05:30
Artom Lifshitz 85e4f08309 Bump microversion to 2.95
There are no client-side changes for either 2.94 or 2.95, so just do
the bump and add release notes.

Change-Id: I8c2bfd48526840fc618820b9ae6a12dc98cdef45
2023-02-02 13:36:52 +00:00
whoami-rajat 94d3445e10 MV 2.93 - Add support to rebuild boot volume
This patch bumps the API microversion to 2.93 to allow
rebuilding a volume backed instance.

Implements: blueprint volume-backed-server-rebuild

Depends-On: https://review.opendev.org/c/openstack/nova/+/830883

Change-Id: Ie46df7ad76082e7631bb26243abed4dc3b1f40ac
2022-09-06 16:42:08 +05:30
Stephen Finucane c408db2dd9 Update pre-commit hook, hacking versions
This was done with 'pre-commit autoupdate'. An invalid message is
removed from the requirements.txt files as it no longer applies with
pip's new dependency resolver.

Change-Id: I01c3ece51f81d67c740e6faca6b77df7c9932435
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-04-08 17:49:08 +09:00
Stephen Finucane 8066f8c745 Microversion 2.90 - Configurable hostnames
Change-Id: Icd4362a07196e59bafcdfaff44323ce1386d4f55
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/nova/+/778550/
2021-09-02 11:01:07 +01:00
Stephen Finucane 01c7a3aa10 tests: Add missing 'nova update' unit tests
We have functional tests for the 'nova update' commands, but no unit
tests to verify e.g. that we can't set a description for the server
before microversion 2.19. Add such tests.

Change-Id: I9af89655a7e7276446a881fd28d21ddd6581048c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-09-02 10:50:52 +01:00
Lee Yarwood cfa172c4fd Microversion 2.89 - os-volume_attachments
Depends-On: https://review.opendev.org/c/openstack/nova/+/804275
Change-Id: If6275dbd3795047c111ac507a12b034e60029df8
2021-08-24 19:10:41 +01:00
Stephen Finucane 54d4da112a Add support for microversion v2.88
The key change here is that the 'GET /os-hypervisors/{id}/uptime' API
will now returns a HTTP 404 starting in 2.88. The 'GET
/os-hypervisors/{id}' will instead now include an 'uptime' value. The
'novaclient.v2.hypervisors.HypervisorManager.uptime' method is updated
to handle this.

Change-Id: Ib99fbd820a586c14527ff64b319df0b7a44e1b8b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-03-02 12:14:12 +00:00
Takashi Natsume 9b474afdb2 Deprecate agent commands and APIs
The os-agents APIs have been removed by the following change.

  I9512f605dd2b3b0e88c951ed086250d57056303d

This patch makes commands related to the APIs deprecated
in accordance with the following policy.

* https://docs.openstack.org/python-novaclient/latest/contributor/deprecation-policy.html

The API bindings related to the APIs remains as they are
because python-openstackclient depends on the API bindings.

Change-Id: I89d7877e23e8802fe77987a7b24ea247e08d5218
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2021-01-13 14:43:51 +00:00
Takashi Natsume 7ef2c28bf3 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I4d45ae17f6f84f945f5dd049a929216ce6b6b58e
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-04-26 10:12:09 +00:00
Zuul 3ef5b695ca Merge "Microversion 2.87 - Stable device boot from volume rescue" 2020-04-10 22:53:29 +00:00
Lee Yarwood 7ed265bbf5 Microversion 2.87 - Stable device boot from volume rescue
This microversion is used to request a stable device rescue for boot
from volume instances and will only succeed when the compute hosting the
instance reports the COMPUTE_RESCUE_BFV trait.

No changes are required within novaclient so this change only bumps
API_MAX_VERSION.


Depends-On: https://review.opendev.org/#/c/701430/

Change-Id: I7885b8558db7657abbfe1f45877f52e947f5f655
2020-04-10 20:15:05 +00:00
Zuul 9bd1c3d321 Merge "Microversion 2.86 - Extra spec validation" 2020-04-10 09:06:25 +00:00
zhangbailin c5f29d6833 FUP: Add volume-update CLI pre V285 tests
This commit mainly to fix some comments from [1].

[1]https://review.opendev.org/#/c/712651/19/novaclient/tests/unit/v2/test_shell.py@4001

Blueprint: destroy-instance-with-datavolume
Change-Id: Id809f22d0da2cdedf33a2c0df202f3953fd01673
2020-04-10 08:39:39 +08:00
Lee Yarwood ca1262daeb Microversion 2.86 - Extra spec validation
This microversion introduces extra spec validation within the API.

No changes are required within novaclient so this change only bumps
API_MAX_VERSION.

Depends-On: https://review.opendev.org/#/c/708436/

Change-Id: Ic8fef7ee363435e9ac728b87d494593fcc6defc0
2020-04-09 20:46:09 +09:00
zhangbailin 4d6c70d25d Microversion 2.85: Change volume-update CLI
This commit add a new CLI
``nova volume-update [--[no-]delete-on-termination]
<server> <src_volume> <dest_volume>`` to update
'delete_on_termination' for an attached volume, that the user can
decide whether to delete attached volumes when destroying the server.

Depends-On: https://review.opendev.org/#/c/711194/

Change-Id: I1fc64fb6e6611c92c6b72265e1bf4b32e9c45f0a
Blueprint: destroy-instance-with-datavolume
2020-04-09 08:52:05 +08:00
Stephen Finucane ea092b2988 Make 'server list --config-drive' a boolean option
Instead of passing through whatever the user provides and exposing this
bug in the REST API, simply make the opt a boolean one in expectation of
a day where the API issues have been resolved.

This also introduces machinery necessary to use more of these types of
opts in the future.

Change-Id: I9033540ac65ac0ee7337f16bdd002060652092ea
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-04-08 17:27:33 +01:00
zhangbailin d712c0fbc7 Microversion 2.84 - action event fault details
This patch adds support for microversion 2.84
"Expose instance action event details out of the API" [1].

[1] https://review.opendev.org/#/c/694430/

No changes are required in the novaclient side,
so just increment the microversion.

Depends-On: https://review.opendev.org/#/c/694430/

Implements blueprint action-event-fault-details
Change-Id: I1d71284de9a5f25f4554dd2ec7291d5706381de7
2020-04-08 04:10:35 +00:00
Victor Coutellier 9ee74d3ac6 Microversion 2.83 - Add more filters for the nova list command
Add these new filters, admin-only until microversion 2.82:

- availability-zone
- config-drive
- key-name
- power-state
- task-state
- vm-state
- progress

Existing user filter will be available to non admin since microversion
2.83.

Part of blueprint non-admin-filter-instance-by-az

Change-Id: Id2b5e600c0a41790830823031b20983808cb5ace
2020-04-07 18:34:13 +02:00
Takashi Natsume 0ab746b4d1 Microversion 2.82 - nova cyborg interaction
This patch adds support for microversion 2.82
"Define Cyborg ARQ binding notification event" (*).

*: I7a626544d8221dc0eeb5672986ca897ce4718be8

No changes are required in the novaclient side,
so just increment the microversion.

Change-Id: I3a8a2f8b5ced5519082f0b7609702d4f62be88ac
Implements: blueprint nova-cyborg-interaction
2020-03-12 23:49:23 +09:00
Stephen Finucane 8f50f84981 Bump to hacking 2.x
This is compatible with Python 3-only syntax.

Change-Id: I462f4242b9a5f8d8cd6b0cb3d328dfd9d93ba200
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Stephen Finucane c4c44bcb2d Remove six
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.

Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Zuul 9cae96174a Merge "Add minor version [21] to the test_versions" 2019-11-13 14:59:46 +00:00
zhangbailin c15a5a0555 Add minor version [21] to the test_versions
In v2.21, the os-instance-actions API returns information from deleted
instances. This change does not involve changes to novaclient, but
since novaclient does not add support for v2.21, it does not match
API_MAX_VERSION when executing unit tests
(novaclient.tests.unit.v2.test_shell.ShellTest.test_versions).

Closes-Bug: #1848110
Change-Id: Ib1ad244bb059bb86a9f3025d4bc16c20946433d0
2019-10-22 07:52:43 +08:00
Dan Smith 71c29a184b Add aggregate-cache-images command and client routines
This adds the ability to request image precache support for an aggregate
in support of the matching server feature.

Related to blueprint image-precache-support

Depends-On: https://review.opendev.org/#/c/687140
Change-Id: Id354ccfa99e500a598685e6b794c12160ea2a990
2019-10-18 10:50:01 -07:00
Dan Smith e1bb4378db Add images.GlanceManager.find_images() bulk query
This adds a bulk query method to GlanceManager that takes multiple
image names or ids and attempts to query glance for all of them
in fewer requests than one-per-image.

Change-Id: I1c6ce27b65920356df6b7001c581a2922765ce0c
2019-10-18 10:49:53 -07:00
zhangbailin 8744bea0e3 Microversion 2.80: Add user_id/project_id to migration-list API
Add ``user_id`` and ``project_id`` to the ``GET /os-migrations``
API, and it can called ``--user-id <user_id>`` and/or
``--project-id <project_id>`` by ``nova migration-list`` CLI.

Showing the ``user_id`` and ``project_id`` when using api_version>=2.80
with the server-migration-list or server-migration-show APIs.

Depends-On: https://review.opendev.org/#/c/674243/
Part of blueprint add-user-id-field-to-the-migrations-table

Change-Id: I11343ca265ab2b6b6f46877897d8223ef340c258
2019-10-16 14:07:28 +00:00
Takashi NATSUME 364cad4191 Remove cells v1 and extension commands and APIs
The following CLIs and their backing API bindings
which have been deprecated since 20.0.0 Train release
have now been removed.

- list-extensions
- cell-capacities
- cell-show

Change-Id: I8e6edf1e4c1bf12d51ed993363129b4f4c3aa36c
2019-10-04 10:09:31 +09:00
Stephen Finucane 6954aacd54 Stop silently ignoring invalid 'nova boot --hint' options
The '--hint' option for 'nova boot' expects a key-value pair like so:

  nova boot --hint group=245e1dfe-2d0e-4139-80a9-fce124948896 ...

However, the command doesn't complain if this isn't the case, meaning
typos like the below aren't indicated to the user:

  nova boot --hint 245e1dfe-2d0e-4139-80a9-fce124948896

Due to how we'd implemented this here, this ultimately results in us
POSTing the following as part of the body to 'os-servers':

  {
    ...
    "OS-SCH-HNT:scheduler_hints": {
      "245e1dfe-2d0e-4139-80a9-fce124948896": null
    }
    ...
  }

Which is unfortunately allowed and ignored by nova due to the use of
'additionalProperties' in the schema [1]

Do what we do for loads of other options and explicitly fail on invalid
values.

[1] https://github.com/openstack/nova/blob/19.0.0/nova/api/openstack/compute/schemas/servers.py#L142-L146

Change-Id: I0f9f75cba68e7582d32d4aab2f8f077b4360d386
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1845322
2019-09-27 12:06:23 +00:00
Takashi NATSUME d1c5dc61d6 Add a check for --config-drive option on nova boot
A value of the '--config-drive' option must be a boolean value
on the 'nova boot' command because nova accepts a boolean value
only for the 'config_drive' parameter.
So add a check for the '--config-drive' option on the 'nova boot'
command.

Fix a description for 'config_drive' parameter
in the 'create' method of the novaclient.v2.ServerManager class.

Change-Id: Ic6e65139302fbb662fb6ba60e73633dad8ffb72e
Closes-Bug: #1825061
2019-09-18 23:08:28 +00:00
zhangbailin cd396b8b61 Microversion 2.79: Add delete_on_termination to volume-attach API
Support add 'delete_on_termination' field to the voume attach API to
support configuring whether to delete the data volume when the server
is destroyed.

* Updating the ``nova volume-attachments`` command to show the
  ``delete_on_termination`` value if 2.79 or greater is used.
* The '--delete-on-termination' option is added to the `nova volume-attach`
  CLI.

Depends-On: https://review.opendev.org/#/c/673133/
Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I8dcf2fd21a2fd99ca4e05bd953fbbe026be3a619
2019-09-09 12:43:42 -04:00
Yongli He aae95dcc7a Microversion 2.78 - show server topology
Add support microversion 2.78 which adds server topology
information in the output of the following new command:

  nova server-topology

Depends-on: https://review.opendev.org/#/c/621476/
Change-Id: I6467d52d2528a37348458baf4842b571a97f3ed2
Implements: blueprint show-server-numa-topology
2019-09-06 17:24:17 -04:00
zhangbailin ecfa521b21 Microversion 2.77: Support Specifying AZ to unshelve
This patch adds a new parameter ``--availability-zone`` to ``nova
unshelve`` command. This can help users to specify an ``availability_zone``
to unshelve a shelve offloaded server from 2.77 microversion.

Depends-On: https://review.opendev.org/#/c/663851/
Implements: blueprint support-specifying-az-when-restore-shelved-server

Change-Id: I8bce8f430bc54f03bacc105e37fc8b3bbf2432c2
2019-08-28 17:43:22 -04:00
Surya Seetharaman a3e44e8b39 API microversion 2.76: Add 'power-update' external event
The 2.76 microversion adds the 'power-update' server
external event to the os-server-external-events API.

This is an admin-only API by default and this event is
currently only used by Ironic as part of updating the
power-state of a physical instance, and therefore does not
have any CLI or python API binding impacts in the client.

Depends-On: https://review.opendev.org/#/c/645611/
Part of blueprint nova-support-instance-power-update
Story: 2004969
Task: 34271

Change-Id: I1f5de90e19b7b13c7746fea8bbdf8e09bcb92cff
2019-08-20 11:32:51 -04:00
Ghanshyam Mann 0e873a2d5a Microversion 2.75 - Multiple API cleanup changes
Add support microversion 2.75 which implement
multiple API cleanup changes.

1. Making server representation always consistent among all APIs
   returning the complete server representation.
 - Test cases added.

2. Change the default return value of ``swap`` field from the empty string
   to 0 (integer) in flavor APIs.
 - Test cases added.

Nova side path: https://review.opendev.org/#/c/666889/

Change-Id: Iec2cfc629dffd53178ef88a31fcd16a3f32e2e27
Partial-Implements: blueprint api-consistency-cleanup
2019-08-20 13:08:16 +00:00
Zuul d354c76bd2 Merge "Deprecate cells v1 and extension commands and APIs" 2019-07-15 13:24:14 +00:00
Takashi NATSUME 3ac90a5273 Deprecate cells v1 and extension commands and APIs
The API extension has been deprecated since 12.0.0 Liberty release (*1)
and the cells v1 has been deprecated since 16.0.0 Pike release (*2)
in the nova side.
The API extension has already been removed (merged into main
controllers and schema) since 19.0.0 Stein release (*3) and
the cells v1 APIs has already been removed since
Iddb519008515f591cf1d884872a5887afbe766f2.

In the python-novaclient side,
deprecate commands and API bindings related to
the API extension and the cells v1 at first.
Then the CLIs and API bindings will be removed in the first major
release after Nova 20.0.0 Train is released.

*1: I084444b11dceda7cf8f88c157aa67d36490fce49
*2: I1a173f7ce0715e684850e030c358e8175fa8724c
*3: https://review.opendev.org/#/q/topic:bp/api-extensions-merge-stein

Change-Id: I8dc4df95ac7f6974c5280e4107e449d04cd1402e
Closes-Bug: #1835699
2019-07-10 08:54:36 +09:00
zhu.boxiang 41c25881e6 Add host and hypervisor_hostname to create servers
Adds the --host and --hypervisor-hostname options to
the nova boot command and related python API bindings.

Depends-On: https://review.opendev.org/#/c/645520/

Change-Id: If16d00b75f4d5f2b96aa6e3f32a973108049d928
Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server
2019-07-08 19:26:01 +00:00
zhangbailin 7b9d300089 Set the lower limit of api_version for volume_type
In boot server API, the volume_type is supported by microversion 2.67.
Therefore, the lower limit of the volume_type should be added to the CLI
command, otherwise an exception will occur.

Co-Authored-By: Eric Xie <eric_xiett@163.com>

Closes-Bug: #1829854
Change-Id: Ie909c16568b017ca0acc802194140da7bece76c5
2019-05-23 08:18:04 +08:00
Surya Seetharaman a1ac69c69a Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``--reason`` to ``nova lock``
command and ``--locked`` filtering/sorting parameter to
``nova list`` command. This can help users to provide a reason
when locking the server and to filter/sort instances based on their
locked or value from 2.73 microversion.

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

Change-Id: I438e6db2dd5000ba388d0a0f1c8ab74b96b47a71
2019-05-13 14:37:43 +02:00
Takashi NATSUME fe4138aea4 Updates for OpenDev transition
Replace 'git.openstack.org' with 'opendev.org'
in contributor/index.rst.
Update URLs in other places as well though there are redirects.

See the following URLs for more details:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Change-Id: Ifb9f4274d2fd0fa81e7501fe176eeead3acd0e3e
2019-04-23 01:18:31 +00:00
Matt Riedemann e8f7aaf909 Add test for console-log and docs for bug 1746534
We had no unit test coverage for the console-log command
so this adds a simple test. It unfortunately does not
recreate the original UnicodeEncodeError bug though, but
it gives us some test coverage anyway.

This change also adds docs on how to resolve bug 1746534
by configuring the environment for UTF-8 as noted in
the revert change Iaeec1e74262a35f3de3c81f7013835a6aa6f9029.

The documentation added here is shamelessly copied from
Click [1] which was found via the PEP 538 docs [2].

[1] https://click.palletsprojects.com/en/5.x/python3/#python-3-surrogate-handling
[2] https://www.python.org/dev/peps/pep-0538/

Change-Id: Ic7059260dfc031ea1b08d2b8a7cec684bbe7dfa5
Related-Bug: #1823287
Related-Bug: #1746534
2019-04-11 12:03:30 -04:00
Lajos Katona 62bf8809c6 Add support for microversion v2.72
This microversion in Nova is added to support Neutron ports having
resource request during server create to guarantee minimum bandwidth
QoS. This is a behavior-only change in the compute API, there are no
changes to the server create request or response schema.

Change-Id: I1a39390015acd8703e8bab55af13f5c75ae226db
Depends-On: https://review.openstack.org/636360
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2019-03-06 20:44:49 -05:00
Takashi NATSUME b2cd7e12cc Microversion 2.71 - show server group
Add support microversion 2.71 which adds server group
information in the output of the following commands.

* nova show
* nova rebuild

The 'nova update' command does not output its result
when it is successful.
So there is no change for the command.

The patch for microversion 2.71 in the nova side is
I4a2a584df56ece7beb8b12c0ce9b0e6b30237120.

Change-Id: Id324486b5ef32615881085cd46772aa55c245ac6
Implements: blueprint show-server-group
2019-03-04 12:00:22 -05:00
Matt Riedemann de22cdd3c8 Add support for microversion 2.70 - expose device tags
This adds support for microversion 2.70 which exposes
the 'tag' field in the following APIs:

* GET /servers/{server_id}/os-volume_attachments
* GET /servers/{server_id}/os-volume_attachments/{volume_id}
* POST /servers/{server_id}/os-volume_attachments
* GET /servers/{server_id}/os-interface
* GET /servers/{server_id}/os-interface/{port_id}
* POST /servers/{server_id}/os-interface

Which corresponds to showing the tag in the output of
the following commands:

* nova volume-attachments
* nova volume-attach
* nova interface-list
* nova interface-attach

Depends-On: https://review.openstack.org/631948/

Part of blueprint expose-virtual-device-tags-in-rest-api

Change-Id: I5e9d7e0219605503a56d2cf745b95c6e05d01101
2019-02-28 12:07:25 -05:00
Surya Seetharaman 14a45183ee API microversion 2.69: Handles Down Cells
This patch explicitly points out the change needed while
forming the detailed lists for embedded flavor information.
In those cases where the server response for nova list
has the flavor key missing for the instances in the down cell,
the servers will be skipped.

Depends-On: https://review.openstack.org/591657/

Related to blueprint handling-down-cell

Change-Id: I007d9a68309b0d3aa85a4edf5026043154d4f42a
2019-02-20 11:58:39 -05:00
Stephen Finucane 162f4769b8 Microversion 2.68: Remove 'forced' live migrations, evacuations
Update the commands and Python API bindings to reflect the new
microversion. The various evacuate microversion functions are DRY'd up
along the way.

Change-Id: Ibfc905292258ffde05800387e5d6bbad4823085c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.openstack.org/#/c/634600/
Implements: blueprint remove-force-flag-from-live-migrate-and-evacuate
2019-02-13 21:15:23 +00:00
zhaolihui b13ba0138f Fix flavor keyerror when nova boot vm
When creating a server (the 'nova boot' command),
it calls 'POST /servers' API.

The response does not have 'addresses' and 'flavor' attributes.
When accessing 'networks' attribute in the '_print_server' function,
it calls 'GET /servers/{server_id}' and get the 'addresses' and
'flavor' attributes.

If 'GET /servers/{server_id}' fails, the server object does not have
the 'flavor' attribute, then KeyError is raised when accessing it.

Fix the issue by making it raise a CommandError
when the 'GET /servers/{server_id}' fails.

Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I3ef096c61b0e05a637ab0c4a1027338fa87e4f09
Closes-Bug: #1781368
2018-12-13 07:50:37 +00:00
Takashi NATSUME 80b4286981 Replace MB with MiB
Change-Id: Ie5bd325d8e0f7e9af76c1ddae1d679b0e797c84b
2018-10-22 07:11:25 +00:00
Matt Riedemann 4fef02de71 Add support for microversion 2.67: BDMv2 volume_type
This adds the nova boot command and python API binding
support for creating a server with block device mappings
defined using a specific volume type.

Depends-On: https://review.openstack.org/606398/
Depends-On: https://review.openstack.org/#/c/610349/

Part of blueprint boot-instance-specific-storage-backend

Change-Id: I484ee065119b5783db212ea64efa60e87c40338c
2018-10-14 05:34:24 -04:00