This patch is a follow-up for
I03570d0a49b73021de91dc50b65b1bbf5d4b878b.
The following file is for shell (CLI) tests,
so it does not need to be changed anymore.
* novaclient/tests/unit/v2/fakes.py
Change-Id: I3b1cf5d402b04854177265f2ba429956edb73203
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Now, when creating a keypair, the 'public_key' parameter is now mandatory.
Depends-On: https://review.opendev.org/c/openstack/nova/+/849133
Implements: blueprint keypair-generation-removal
Change-Id: I03570d0a49b73021de91dc50b65b1bbf5d4b878b
This patch adds ``host`` to novaclient api.
This can help administrators to specify a ``host``
to unshelve a shelve offloaded server from 2.91 microversion.
Depends-On: https://review.opendev.org/c/openstack/nova/+/831507
Implements: blueprint unshelve-to-host
Change-Id: I7efc8f0b0ef159e16cefee761bff5d7e90d0c427
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>
The code has not been used
since If0161a89877f19f24e91d780cf227fdc48e7e860 .
Change-Id: I106404f9d12814fec2ec2bf16cdd100834085912
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
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>
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>
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
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
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
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
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
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
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
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
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
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
If you pass unicode multi-byte character to 'hypervisor-list'
and 'instance-usage-audit-log' commands using --matching
and --before options respectively, it returns keyerror.
This patch fixes these issues by encoding the host name and
date passed to the --matching and --before options
respectively.
Closes-Bug: #1804156
Change-Id: I9587af7e0fdd921fcaebe3e5c6c5bb40a9393e01
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
Added support for microversion 2.64, which includes the
following changes:
- The ``--rule`` option is added to the
``nova server-group-create`` CLI that enables user to create
server group with specific policy rules.
- Remove ``metadata`` column in the output of
``nova server-group-create``, ``nova server-group-get``,
``nova server-group-list``.
- Remove ``policies`` column, , add ``policy`` and ``rules``
columns in the output of ``nova server-group-create``,
``nova server-group-get``, ``nova server-group-list``.
Depends-On: 3cd26f1e68b09ba7925e794ac8912566c239b6df
blueprint: complex-anti-affinity-policies
Change-Id: I903f4b5544806b9d3c8bac529448abbc9dd3cee9
This reverts commit eff607ccef.
There was no apparent need for the change being reverted since
user can list all servers by specifying --limit=1 when running
the nova list command.
The change introduced a problem whereby the first pass to
list instances from the server would get up to
[api]/max_limit (default 1000) results and then call again
with a marker. If the last instance in the list (the marker)
is corrupted in the instance_mappings table in the API DB
by not having an associated cell mapping, listing instances
will always fail with a MarkerNotFound error even though
the CLI user is not passing a marker nor specifying
--limit=-1. The corrupted instance mapping record resulting
in the MarkerNotFound error is something else that should
be fixed on the server side (and likely result in a 500) but
the change in behavior of the CLI makes it always fail
if you hit this even if you're not passing a marker.
Change-Id: Ibb43f500a74733b85bd3242592d36985bfb45856
Closes-Bug: #1773945
Starting from microversion 2.61, the responses of the 'Flavor' APIs
include the 'extra_specs' parameter. Therefore 'Flavors extra-specs'
(os-extra_specs) API calls have been removed in the following commands
since microversion 2.61.
* nova flavor-list
* nova flavor-show
Change-Id: I10d621d9b62764114d55cb368e720d182eaffd11
Implements: blueprint add-extra-specs-to-flavor-list
Output of `nova list` command contained only `max_limit` entries even
when there were more. The list needs to be obtained in multiple
requests and the paging loop was terminated prematurely.
Change-Id: I4194e6d5e34ecc0ac704851c08bb895e223aa850
Closes-Bug: 1743532
When starting cold migration with nova command "nova host-
servers-migrate compute-1", the migration started from all
compute hosts starting with name "compute-1", not only from
compute-1 host. The same thing happens to "nova host-meta",
"nova host-evacuate", "nova host-evacuate-live" as well.
With the "--strict" option added to these nova commands, the
action will be applied to a single compute with the exact
hostname string match, but not to the computes with hostname
substring match. Error handling is also added to these nova
commands such that when specified hostname name does not exist,
"NotFound" will be returned.
Closes-Bug: #1667794
Change-Id: I5610efa160864b0d91cd67961883a6bec5bb8dd0
Currently we can get instance usage audit logs via Nova API,
and the docs also update for it. It is necessary to add that
to our client and CLI.
This patch adds the following command.
nova instance-usage-audit-log [--before <before>]
Co-Authored-by: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I4ef8e40c322f1768ee1b5e01e9681cab0e2804bd
Add optional parameters 'limit', 'marker' and 'changes-since' to the
os-instance-actions endpoints for pagination.
Implement: blueprint pagination-add-changes-since-for-instance-action-list
Change-Id: Ie66d9b00c90236fdcc01aed7649dc7f163aa323e
With the 2.57 microversion, we:
* Deprecate the --file option from the nova boot and
nova rebuild CLIs and API bindings.
* Add --user-data and --user-data-unset to the nova rebuild
CLI and API bindings.
* Deprecate the maxPersonality and maxPersonalitySize fields
from the nova limits and nova absolute-limits CLIs and API
bindings.
* Deprecate injected_files, injected_file_content_bytes, and
injected_file_path_bytes from the nova quota-show,
nova quota-update, nova quota-defaults, nova quota-class-show,
and nova quota-class-update CLIs and API bindings.
Part of blueprint deprecate-file-injection
Change-Id: Id13e3eac3ef87d429454042ac7046e865774ff8e
The add-fixed-ip, remove-fixed-ip, floating-ip-associate,
floating-ip-disassociate, and virtual-interface-list CLIs
and related python API bindings were deprecated in the 9.0.0
release in Pike via change Ie76283962c375b735f30ccb3053db07cf2330de2.
This removes the CLIs and related python API bindings and will go
into the 10.0.0 release.
Change-Id: Icb667973c65d26395db660b1c7b919550db66d08
These were all deprecated in the 9.0.0 release in Pike
via change I79091edf5a2569e49e79deba312456fdcdee09e1 and
can now be removed. This will go into the 10.0.0 release.
Change-Id: I85a287ff2666c2dcdcbbc8fd6c2e285176f7a67a
These were all deprecated in the 9.0.0 release in Pike
via change I329ee0e5fcf068ea7e54b99fbaf94a524647f660
and we can remove them now. This will go into 10.0.0.
Change-Id: Ia90a49112847e365fcdaf581dc9ee32f9a20fd85
This adds the support for microversion 2.55 which allows creating
a flavor with a description, showing the description in flavor details,
and updating the description on an existing flavor. Related python API
bindings are added, and the new "nova flavor-update <description>" CLI
is added.
Implements blueprint flavor-description
Change-Id: I0a09c0a63d2e91ef5aa31a8e43e28f8745faae14
Adds support for the 2.53 microversion which changes the
os-services and os-hypervisors APIs to use a UUID for the ID
value on the resource.
Also, the PUT and GET API methods have changed a bit for
both resources in this microversion, so the pythong API
bindings and command lines have been adjusted accordingly.
Part of blueprint service-hyper-uuid-in-api
Change-Id: Ic721143cc154d91e74a8a9dd2c1e991045c94305
This adds support for the 2.50 microversion which does the following:
* Adds the server_groups and server_groups_members resources to the output
for the 'nova quota-class-show' and 'nova quota-class-update' CLIs.
* Removes the ability to show or update network-related resource quota class
values, specifically floating_ips, fixed_ips, security_groups and
security_group_members.
* Defines explicit kwargs for the update() method in the python API binding.
This also fixes a problem where the 'nova quota-class-update' CLI was
incorrectly capped at the 2.35 microversion for updating network-related
resources. That was true for the os-quota-sets API which is tenant-specific,
but not for the os-quota-class-sets API which is global.
Functional tests are added for the 2.1 and 2.50 microversion behavior for
both commands.
Part of blueprint fix-quota-classes-api
Change-Id: I2531f9094d92e1b9ed36ab03bc43ae1be5290790
This adds support for microversion 2.45 which changes the response
on the createImage and createBackup server action APIs to return
the image_id for the created snapshot image in a json dict in the
response body rather than in a Location header (which is gone in
microversion >= 2.45).
Since the 'nova backup' command was not printing out the created
image ID before, that is also added in this microversion.
Part of blueprint remove-create-image-location-header-response
Change-Id: Id48aa7b14e2d25008287549b04db437ca9c3f548
The user needs to query the specific server's migration history. The
'os-migrations' support 'instance_uuid' as query filter, but that isn't
enabled in the migration-list command. This patch enable that filter.
Change-Id: I137b94f4d73836bcc163b66ab20ee2987042a40f
These were deprecated in Newton:
aaebeb05a0
The 'find network' convenience helper when
booting a server only works with neutron now,
and assumes the 'network' endpoint is in the
service catalog.
The functional tests are changed to use
python-neutronclient for listing and finding
the network to use. At this point, we don't
have any nova-network CI jobs that will work
with novaclient, so the non-voting mitaka
nova-network job is also being removed in change
I63b36fb8acc5c9a273e6adcb271df16d0f71031e.
As noted in the release note, the only remaining
pure nova-network CLI/API that will work is for
listing virtual interfaces, which is only implemented
for nova-network within Nova. The functional tests
for this API are removed since we don't have any
nova-network CI jobs that will test it besides
unit tests. Long-term we'll likely deprecate the
os-virtual-interfaces API as well and replace it with
the os-interface API.
Change-Id: I8c520100a0016eed3959619c71dae037ebd72939
These were deprecated in Newton:
aaebeb05a0
The floating IP fixtures and GET API methods in the
manager are still used for testing the addFloatingIP
and removeFloatingIP server operations, so the manager
is moved to the test_servers module.
Change-Id: I2138e43160772c7c896bc5e93195a8169ebfe6c3
These were deprecated in Newton:
aaebeb05a0
The SecurityGroup resource object is left
since the list-secgroup command and
list_security_group servers API code
still uses that object. The
/servers/{server_id}/os-security-groups API
is a proxy to Neutron but was not deprecated
in microversion 2.36 so it's not yet deprecated
here in the client.
Change-Id: I6fa14f43d48f1e035ef54bd2d0078506f0c6d6e0