Block Storage API v2 was deprecated during Pike cycle and is being
removed during Xena cycle, and current v3 API should be used instead.
Change-Id: I4b4c08d65e642866d81d7fd12a7c82162a0b979e
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>
The os-agents APIs have been removed by the following change.
I9512f605dd2b3b0e88c951ed086250d57056303d
This patch fixes a gate failure.
A subsequent patch will make things related to
the os-agents APIs deprecated.
Change-Id: I9dab95fda5902bf9619393eb2c4a22d9f395d65a
Closes-Bug: #1909899
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
A VM instance is created in the following functional test.
* novaclient.tests.functional.v2.test_instance_action.
TestInstanceActionCLIV262.test_show_actions_with_host
However the VM instance is not deleted after the functional test.
Add a cleanup for the server in the functional test.
Change-Id: I8c2a6f91739d50baa283b37b16de67c542ea691b
Closes-Bug: #1889283
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Replace the 'novaclient-dsvm-functional' legacy Zuul job with
the 'python-novaclient-functional' native Zuul v3 job.
See
https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html
for more details.
Change-Id: I35b5699b8b0814f2d17a37e024286cd440047ec8
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
User data is a blob of data that the user can specify when they launch
an instance. It's generally binary data, which means it's not something
we should show by default on the CLI. Stop doing that.
Change-Id: If8f6cc040d0077a7902a5fd425e67d74d7925a46
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1669140
This is compatible with Python 3-only syntax.
Change-Id: I462f4242b9a5f8d8cd6b0cb3d328dfd9d93ba200
Signed-off-by: Stephen Finucane <sfinucan@redhat.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>
It looks like nova is using 'repr()' in some validation error logging.
On Python 2.7, this would result in unicode strings (which most web apps
use) being output as "u'foo'", while in Python 3 these would just be
"'foo'". Since nova only supports Python 3 now, we only have to support
the Python 3 string formatting variant in our tests too.
Change-Id: I546c06a3251e86f39e2e7db48e04ec382c8da854
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
In microversion 2.80 add the functional test for the `nova migration-list`
CLI.
part of bp add-user-id-field-to-the-migrations-table
Change-Id: I3cfe37b412971dfff4b217fc7cc6cfdf1b118ce0
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
This is a follow-up for microversion 2.75 -
Multiple API cleanup changes.
The base class of the TestFlavorNovaClientV274 class is
the TenantTestBase class.
And the base class of the TenantTestBase class is
the ClientTestBase class.
It is not necessary to use the TenantTestBase class
as the base class. So specify the ClientTestBase class
directly.
TrivialFix
Change-Id: I2cb971f46ba697d9386ca61b7f51169f02b605ab
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
The GET /os-migrations API take a migration_type and source_compute
filter parameter on the request since the v2.0 API. This adds support
for specifying those parameters in the "nova migration-list" CLI
and related MigrationManager.list() python API binding methods.
A functional test is added which will cover the new options on all
three of the decorated do_migration_list shell methods with lower
bounds on 2.1, 2.59 and 2.66. Since the only type of migration we
can safely generate in a single-node CI job is a resize the test
does a resize. As such, _pick_alternate_flavor is moved into the
base test class for re-use.
Implements blueprint more-migration-list-filters
Change-Id: I4be9a06df3e0d40d3990d067ce112247a81b45b4
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
The 2.53 microversion allows listing hypervisors with
details and filtering on a hypervisor_hostname substring
pattern match.
This makes the python API binding HypervisorManager.search
method allow that as well by adding a new 'detailed' boolean
kwarg which defaults to False for backward compatibility for
the /search and /servers routes before 2.53, but allows
searching and getting detailed results back as well.
Change-Id: I81fa4520af3cc7f1298c262f4fdc4e15fbc6d7ba
In some DBMSs (e.g. MySQL 5.7 (*1)), fractions (millisecond and
microsecond) of DateTime column is not stored by default.
*1: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html
Fix specifying the 'changes-before' values
in the functional test for the 'instance-action-list' command.
Change-Id: I79e80088bcbf559a58aa90a831b54017af310a26
Closes-Bug: #1817064
Add output of a result in the 'nova interface-attach'
command when it is successful.
Make the following methods return a 'NetworkInterface'
object instead of a 'Server' object.
* The 'interface_attach' method
in the 'novaclient.v2.Server' class
* The 'interface_attach' method
in the 'novaclient.v2.ServerManager' class
Remove unnecessary code in the 'nova interface-detach'
command because the response body is not returned.
Change-Id: Id5316d8ad4a4b67e8399b51e602aafc83bc128c6
Closes-Bug: #1816511
Fix an intermittent failure of
test_list_instance_action_with_changes_before method
of the TestInstanceActionCLIV266 class.
Change-Id: Ie898d9590e1701476eadf4895bce7874d989175a
Closes-Bug: #1795392
This adds the changes-before filter to the servers,
os-instance-actions and os-migrations list for
filtering resources which were last updated before
or equal to the given time. The changes-before filter,
like the changes-since filter, will return deleted
server resources.
Depends-On: https://review.openstack.org/599276/
Part of bp support-to-query-nova-resources-filter-by-changes-before
Change-Id: I7c6ea00303374d605bda8ef1b62c5de1b4567696
Since now os-client-config has been superceded by openstacksdk[1].
So need to replace the os-client-config.
[1]:https://docs.openstack.org/os-client-config/latest/
Change-Id: Ia0e0671720de4713098e9d0faa1d7dc0c4ae6147
Both standard json library and jsonutils of oslo.serialization are used.
Replace standard json library with jsonutils for consistency.
Change-Id: Id6cbb4d78817ff4993b73538935cc4cc61b64a72
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
The ``--endpoint-override`` command line argument has been deprecated.
It is renamed to ``--os-endpoint-override`` to avoid misinterpreting
command line arguments.
It defaults to the ``OS_ENDPOINT_OVERRIDE`` environment variable.
The deprecated ``--bypass-url`` command line argument has been removed.
Change-Id: Ic8a6559cd62d46b837fa9c04b482a46ceba829db
Closes-Bug: #1778536
This adds a simple assertion that when microversion < 2.62, the
"nova instance-action" CLI does not show host or hostId output.
Related to blueprint add-host-to-instance-action-events
Change-Id: I6e0866d9daff75046a5e82f57ff745d494b4b5ed
Adds support for microversion 2.62 which adds ``host``
(hostname) and ``hostId`` (an obfuscated hashed host id string)
fields to the instance action
``GET /servers/{server_id}/os-instance-actions/{req_id}`` API.
The event column is already included in the result of
"nova instance-action <server> <request-id>" command, therefore
does not have any CLI or python API binding impacts in the
client.
Related nova API change: I2f8b4a12a088b9ed96b428eafde2e0c478fb1db5
Part of blueprint: add-host-to-instance-action-events
Change-Id: Iee7e1a3a22249c98873aa96694fd4885916cd097
There are 2 known issues which breaks token auth method in CLI:
* The wrong check of flag (the check should be for --os-token since
arguments are not parsed at that moment) is performed in CLI inner method
`_append_global_identity_args`. It led to usage of "password" auth
type by default[1] even if `--os-token` cli argument is specified.
If `--os-auth-type` is specified to token, keystoneauth1 library makes
the right decision[2].
* Based on an auth type, keystoneauth library registers different CLI
arguments[3]. It means that `--os-username` argument is available only
in password auth type, `--os-token` is available only in token auth
type, etc.
It also affects the way in which the python code should access such
arguments. The arguments which are unrelated to the selected auth type
are omitted from the parsed arguments object.
That sounds reasonable, but unfortunately the code assumes the
unrelated arguments are always present which leads to an
AttributeError.
Combination of these 2 issues made token auth type broken in CLI layer.
[1] ee2221f052/novaclient/shell.py (L255-L257)
[2] 14dd37b34c/keystoneauth1/loading/cli.py (L51-L52)
[3] 14dd37b34c/keystoneauth1/loading/cli.py (L65-L73)
Closes-Bug: #1659015
Change-Id: Ibc861d396b71fe105288d8336623cc22cf92523e
In documents and comments, 'GB' (gigabyte) is used.
Strictly 'GiB' (gibibyte) should be used.
So replace 'GB' with 'GiB'.
Change-Id: Ic03f202d4fe357bc6400275abdccd4b37521f4a3
Closes-Bug: #1521791
In the 'wait_for_resource_delete' method of the 'ClientTestBase' class,
the following statement is executed when timeout.
self.fail("The resource '%s' still exists." % resource.id)
The 'resource' variable is passed in the argument of
the 'wait_for_resource_delete' method.
It is sometimes a string which is a resource ID.
When it is a string (a resource ID), AttributeError is raised
at the statement.
This patch fixes the issue.
Change-Id: I558026de54a5cc75359225b50054934a220f3e5c
Closes-Bug: #1704132
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 services CLI 'binary' arg was deprecated in Pike
via change Idd0d2be960ca0ed59097c10c931da47a1a3e66fb
because with cells v2 support in the API, the binary
argument for the enable/disable CLIs doesn't make sense
as the only binary those work with is 'nova-compute'.
So this removes the deprecated argument and hard-codes
the value to be 'nova-compute'.
Change-Id: I60490f3d74212bb172dccc1c7d337198e1021236
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
Random names of resources makes the task impossible to find a test which
doesn't clean resources after a launch.
This patch changes name_generate method to generate names including a name
of the test, which can be really helpful.
Also, the simple script that prints resources after test run is added.
Change-Id: Id3a743afb624dd4bf8ed3523a1916455fd93655a
The base test class for functionl tests has an unified helper method for
booting VM and waiting for active status. This method can be easily
extended with one new argumen `flavor` to cover the case required by
`TestServersResize` test case.
This patch ports `TestServersResize` to use generic helper method.
Change-Id: I9a53066dbb8907ed87a70f207b1e41b5b8a66908
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
Starting from microversion 2.11,
the 'force_down' parameter is returned in the response of
the "List Compute Services" API (GET /os-services).
But the service-list command does not show the 'forced_down' parameter
in the result table.
So add the 'Forced down' column in the table.
Change-Id: I79e3ba37bdf054604eab40452628dbf30014f6f1
Closes-Bug: #1706486
Change I9269ffa2b80e48db96c622d0dc0817738854f602 in the Nova
server removes the need for reservations, which means that
once the server is resized in nova-compute and the vcpus and
memory_mb are changed on the instances record, the usage count
will also change, before the resize is confirmed. This means
we need to adjust the usage assertions in the resize down test.
Usage changes once the server is in VERIFY_RESIZE state, and
the usage will change again if the resize is reverted.
Note that if we were getting usage without the 'reserved'
query paramter to the 'limits' API, the behavior would have
been the same regardless of the change to Nova for counting
quotas.
Depends-On: I9269ffa2b80e48db96c622d0dc0817738854f602
Related to blueprint cells-count-resources-to-check-quota-in-api
Change-Id: I91ca0d204454987dcce1c68d9bf0f532b469df6d