These samples were unused and incorrect. We don't actually need the
sample, since v2.66 is about listing servers and filtering with
'changes-before', so responses to show a server are unnecessary. Simply
remove the sample.
Closes-Bug: #1800936
Change-Id: I12cf3ffd75098677cf5de1a5f40d783bb661fd74
The following notifications have been transformed to
the versioned notification framework.
* compute_task.build_instances
* compute_task.migrate_server
* compute_task.rebuild_server
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: Ibfb0a6db5920d921c4fc7cabf3f4d2838ea7f421
Implements: bp versioned-notification-transformation-stein
nova usage-list can return incorrect results, having resources counted
twice. This only occurs when using the 2.40 microversion or later.
This microversion introduced pagination, which doesn't work properly.
Nova API will sort the instances using the tenant id and instance uuid,
but 'os-simple-tenant-usage' will not preserve the order when returning
the results.
For this reason, subsequent API calls made by the client will use the
wrong marker (which is supposed to be the last instance id), ending
up counting the same instances twice.
Change-Id: I6c7a67b23ec49aa207c33c38580acd834bb27e3c
Closes-Bug: #1796689
Add a new microversion 2.67 to support specify ``volume_type``
when boot instances.
Part of bp boot-instance-specific-storage-backend
Change-Id: I13102243f7ce36a5d44c1790f3a633703373ebf7
In the "List Migrations" (GET /os-migrations) API,
there are the following response body examples.
* Example List Migrations: JSON response
* Example List Migrations (v2.59)
* Example List Migrations With Paging (v2.59)
In the second and third examples, the 'instance_uuid' are UUID strings.
But in the first one, the 'instance_uuid' is not UUID.
It should be a UUID string.
So replace non UUID string with a UUID string in the example.
Change-Id: I6c29c48f53838beb7da3ec0f849380e3706df422
The response parameter table for the GET /os-migrations
API reference was missing the top level "migrations"
parameter which is the list of migration objects.
While in here, fix the fake "Done" status to "done"
in the sample. There is nothing in nova that uses a
status of "Done". The evacuate operation uses "done".
Change-Id: I1e193237e9aec05395cd2760d96e70db7791409b
The hide_server_address_states config option and related
policy rule were deprecated in Queens:
I6040e8c2b3e132b0dfd09f82ae041b4786a63483
They are now removed in Stein as part of the API extension
merge effort.
Part of blueprint api-extensions-merge-stein
Change-Id: Ib3582038274dedbf524ffcaffe818ff0e751489d
This adds the changes-before filter to the servers,
os-instance-actions and os-migrations APIs 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.
Part of bp support-to-query-nova-resources-filter-by-changes-before
Change-Id: If91c179e3823c8b0da744a9363906b0f7b05c326
In the past, we only have changes-since filter, we called it as
timestamp-filter, but now we will add a changes-before filter,
the timestamp-filter is not clear anymore.
In this patch, we rename timestamp to changes-since.
Change-Id: Ieee912e197d17a5ffca7460f3b977316cd21813e
blueprint: support-to-query-nova-resources-filter-by-changes-before
There are few POST API which does not take request
body as mandatory. For example POST 'servers/%s/consoles/
For such API, functional sample tests using some empty
request sample template. And doc/api_samples dir does
not have such empty sample file.
This commit removes those empty sample files and make
_do_post() base method to make body and subs param as optional
for such API.
Also add one missing sample file(non empty) in doc/api_samples dir.
Change-Id: I163e17a4a8253594e1768ed9b118fba63d5e08f1
Nova does not support a "hw:cpu_model" flavor extra
spec. This was added as part of microversion 2.47 from
WindRiver where their Titanium Cloud product does support
a hw:cpu_model flavor extra spec. We shouldn't include
this in upstream documentation lest someone be confused
and think upstream nova supports it.
Change-Id: Ie646130731fde648ab84a423024ab59f55f5daab
The ServerMigrationSampleJsonTests functional tests set up
``self.api.microversion`` to 2.22 in its' setUp(), which use
sample files from non version dir.
For consistency, this commit makes these tests to use sample
files from versioned dir.
Change-Id: I9af2348cf7dba53e0fef4054bcedcd5b0c626f50
This patch bumped API microversion to 2.65 to add support for
abort live migrations in ``queued`` and ``preparing`` status.
Part of blueprint abort-live-migration-in-queued-status
Change-Id: I4636a8d270ce01c1831bc951c4497ad472bc9aa8
The ServerMigrationSampleJsonTestsV2_24 functional tests set up
``self.api.microversion`` to 2.24 in its' setUp(), by doing this
it will not need to add its' own sample files, as there will be
no difference anyway. But this makes Tests that inherent from this
test class impossibe to run as the microversion will always been
overriden.
This patch fix it by change the tests to use self.microversion and
adds its' own sample files.
Part of blueprint abort-live-migration-in-queued-status
Change-Id: I07222efb8d566fa1dd395ef948eae6e6c4b13678
Enable users to define the policy rules on server group policy
to meet more advanced policy requirement. This microversion
brings the following changes in server group APIs:
* Add ``policy`` and ``rules`` fields in the request of POST
``/os-server-groups``.
* The ``policy`` and ``rules`` fields will be
returned in response body of POST, GET ``/os-server-groups``
API and GET ``/os-server-groups/{server_group_id}`` API.
* The ``policies`` and ``metadata`` fields have been removed
from the response body of POST, GET ``/os-server-groups`` API
and GET ``/os-server-groups/{server_group_id}`` API.
Part of blueprint: complex-anti-affinity-policies
Change-Id: I6911e97bd7f8df92511e90518dba21c127e106a5
This change adds support for the trusted_image_certificates parameter,
which is used to define a list of trusted certificate IDs that can be
used during image signature verification and certificate validation. The
parameter may contain a list of strings, each string representing the ID
of a trusted certificate. The list is restricted to a maximum of 50 IDs.
The list of certificate IDs will be stored in the trusted_certs field of
the instance InstanceExtra and will be used to verify the validity of
the signing certificate of a signed instance image.
The trusted_image_certificates request parameter can be passed to
the server create and rebuild APIs (if allowed by policy):
* POST /servers
* POST /servers/{server_id}/action (rebuild)
The following policy rules were added to restrict the usage of the
``trusted_image_certificates`` request parameter in the server create
and rebuild APIs:
* os_compute_api:servers:create:trusted_certs
* os_compute_api:servers:rebuild:trusted_certs
The trusted_image_certificates parameter will be in the response
body of the following APIs (not restricted by policy):
* GET /servers/detail
* GET /servers/{server_id}
* PUT /servers/{server_id}
* POST /servers/{server_id}/action (rebuild)
APIImpact
Implements blueprint: nova-validate-certificates
Change-Id: Iedd3fea0e86648fae364f075915555dcb2c4f199
This patch adds a new microversion to
``GET /servers/{server_id}/os-instance-actions/{req_id}`` API to
include the ``host`` field for admin and an ``hostId`` for all users
by default. And the display of newly added ``host`` field will be
controlled by the same policy as the ``traceback`` field.
The newly added fields can be used to determine on which host a
given action event occurred.
Part of blueprint: add-host-to-instance-action-events
Change-Id: I2f8b4a12a088b9ed96b428eafde2e0c478fb1db5
Change the instance action sample to a real world action.
In Setup, we create an instance and then stop it. That would
be 2 actions(create and stop), and the stop action should have
a "compute_stop_instance" event. And then we do 2.1/2.21/2.51
test case based on these actions, like we have done in 2.58.
Change-Id: Iac23a574a05e62a99aab20ffce4265f4fb5a44d9
Exposes flavor extra_specs in the flavor representation since
microversion 2.61. Now users can see the flavor extra-specs
in flavor APIs response only and do not need to call
``GET /flavors/{flavor_id}/extra_specs`` API.
Flavor extra_specs will be included in Response body of the
following APIs:
* ``GET /flavors/detail``
* ``GET /flavors/{flavor_id}``
* ``POST /flavors``
* ``PUT /flavors/{flavor_id}``
Part of blueprint add-extra-specs-to-flavor-list
Change-Id: I048747633babf690a63c6de9773bff5547872053
This change introduces a new microversion which must be used
to create a server from a multiattach volume or attach a multiattach
volume to an existing server instance.
Attaching a multiattach volume to a shelved offloaded instance is not
supported since an instance in that state does not have a compute host
so we can't tell if the compute would support the multiattach volume
or not. This is consistent with the tagged attach validation with 2.49.
When creating a server from a multiattach volume, we'll check to see
if all computes in all cells are upgraded to the point of even supporting
the compute side changes, otherwise the server create request fails with
a 409. We do this because we don't know which compute node the scheduler
will pick and we don't have any compute capability filtering in the
scheduler for multiattach volumes (that may be a future improvement).
Similarly, when attaching a multiattach volume to an existing instance,
if the compute isn't new enough to support multiattach or the virt
driver simply doesn't support the capability, a 409 response is returned.
Presumably, operators will use AZs/aggregates to organize which hosts
support multiattach if they have a mixed hypervisor deployment, or will
simply disable multiattach support via Cinder policy.
The unit tests are covering error conditions with the new flow. A new
functional scenario test is added for happy path testing of the new boot
from multiattach volume flow and attaching a multiattach volume to more
than one instance.
Tempest integration testing for multiattach is added in change
I80c20914c03d7371e798ca3567c37307a0d54aaa.
Devstack support for multiattach is added in change
I46b7eabf6a28f230666f6933a087f73cb4408348.
Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
Implements: blueprint multi-attach-volume
Change-Id: I02120ef8767c3f9c9497bff67101e57e204ed6f4
The rescue (instance.rescue.start and instance.rescue.end) and unrescue
(instance.unrescue.start and instance.unrescue.end) notifications are
transformed to the versioned framework.
This patch also fixes the power state of the server
when unrescuing it with the fake compute driver.
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: Ib1d03c6d693e3b04886c638c956e35809fed8fc2
Implements: bp versioned-notification-transformation-queens
Closes-Bug: #1742133
This patch adds pagination support and changes-since filter
for os-migrations API.
Users can now use 'limit' and 'marker' to perform paginate
query of running migrations list. Users can also filter the
results according to the migrations' updated time.
The ``GET /os-migrations`` and server migrations APIs will now
return a uuid value in addition to the migrations id in the response,
and the query parameter schema of the ``GET /os-migrations`` API no
longer allows additional properties.
Co-Authored-By: Yikun Jiang <yikunkero@gmail.com>
Implement: blueprint add-pagination-and-change-since-for-migration-list
Change-Id: I7e01f95d7173d9217f76e838b3ea71555151ef56
This patch adds pagination support and changes-since filter
for os-instance-actions API.
Users can now use 'limit' and 'marker' to perform paginate
query of instance action list. Users can also filter the
results according to the actions' updated time.
Co-Authored-By: Yikun Jiang <yikunkero@gmail.com>
Implement: blueprint pagination-add-changes-since-for-instance-action-list
Change-Id: I1a1b39803e8d0449f21d2ab5ef96d4060e638aa8
Change Ia89eeb6725459c35369e8f790f68ad9180bd3aba added new
microversion 2.57. This microversion removed field 'personality'
from create server request. By default Nova functional api tests use
samples from '/servers' directory to create a server. But now such
requests got 400 Bad Request because of additional 'personality' field.
We must handle this case if we are testing microversions >= 2.57.
This patch will add sample for microversion 2.57+
Change-Id: I8c4e8ffc00ab53f07e7364767f4480abebd2e357
This microversion makes the following changes:
1. Deprecates personality files from POST /servers and the rebuild
server action APIs.
2. Adds the ability to pass new user_data to the rebuild server
action API.
3. Personality / file injection related limits and quota resources
are removed from the limits, os-quota-sets and os-quota-class-sets
APIs.
Implements blueprint deprecate-file-injection
Change-Id: Ia89eeb6725459c35369e8f790f68ad9180bd3aba
These are written in preparation for follow up old-style quotas code
removal that moves the logic for the 'reserved' field from the quota
internals (where it's no longer used) to the API (where it's expected
to be provided until we have a new microversion). These tests will
help catch any unintended change in behavior.
Change-Id: I1f743a8db7d032e09372587622ab64250a05e0f0
A regression was introduced in the 2.36 API microversion where the
'force' parameter was missing from the 'PUT /os-quota-sets/{tenant_id}'
API request schema so users could not force quota updates with
microversion 2.36 or later. The bug is now fixed so that the 'force'
parameter can once again be specified during quota updates. There is
no new microversion for this change since it is an admin-only API.
Change-Id: I947e927802f755ccb25a91efd82cac895779d19e
Closes-Bug: #1733886
Previously, if _ensure_resource_provider encountered any error from the
placement REST API, it would (sometimes log a message and) return None.
Furthermore, a name conflict while creating the provider was treated the
same as a UUID conflict, which would actually result in None being
returned.
With this change set, the error paths that previously returned None now
raise one of the new ResourceProviderRetrievalFailed or
ResourceProviderCreationFailed exceptions; and the name conflict path is
detected and treated as an error condition.
Note: This change set only touches the SchedulerReportClient side of
these error conditions - it makes no attempt to add error handling to
its callers. Case in point, the API samples tests needed fixing because
they were previously running into the name conflict error condition, but
not noticing. As currently implemented, the new exceptions will
percolate up to ComputeManager.update_available_resource_for_node like
any others coming from SchedulerReportClient, where they will be logged
and ignored.
Change-Id: I0c4ca6a81f213277fe7219cb905a805712f81e36
Closes-Bug: #1735430
This function enables users to specify a target host
when cold migrating a VM instance.
This patch modifies the migration API.
APIImpact
Add an optional parameter 'host' in cold migration action.
Change-Id: Iee356c4dd097c846b6ca8617ead6a061300c83f8
Implements: blueprint cold-migration-with-target-queens
This adds the new microversion to allow providing
a description when creating a flavor, returning a
flavor description when showing flavor details, and
updating the description on an existing flavor.
Implements blueprint flavor-description
Change-Id: Ib16b0de82f9f9492f5cacf646dc3165a0849d75e
This patch adds `key_name` param to instance rebuild
API. Then the user could reset the instance keypair
when rebuilding. If set key_name to None, the API
will unset the keypair of the instance.
APIImpact
Implements blueprint: rebuild-keypair-reset
Change-Id: I23886a89c25f811cfbe7e2500ce7ff52f9162966
When trying to recreate hundreds of instance action
events for scale testing with the FakeDriver, a nice
simple way to do that is by stopping those instances
and starting them again.
However, since power_off/on aren't implemented, once
you "stop" them the sync_instance_power_state periodic
task in the compute manager thinks they are still running
on the "hypervisor" and will stop them again via the API,
which records yet another instance action and set of
events.
This just toggles the power state bit on the fake instance
in the FakeDriver to make the periodic task do the right
thing.
As a result, we also have more realistic API and
notification samples.
Change-Id: Ie621686053ad774c4ae4f22bb2a455f98900b611
Fix AZ related API docs
While we have a big fat comment in the development docs explaining why it's so
terrible to use default AZ values for either booting an instance or setting
an aggregate AZ metadata, we still have confusing API docs that provide the
wrong name for the AZ...
Fixing that and trying to explain the problem within the docs, too.
This reverts commit 92ca21abd61b6df7fc8bc5ffe7502f03b3eca2dd.
Co-Authored-By: Sylvain Bauza <sbauza@redhat.com>
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ie4bfe32bbef0f8060bfc0ad4190f262d4a8bd3b2
This reverts commit 71a7eda44b6da00c05bd3e136d0465086c30e721.
This is breaking the gate due to the change in the az name.
Change-Id: Idd7d1aab113f3d4aba8b1deb6e5dc3871a75aa29
Closes-Bug: #1716247
While we have a big fat comment in the development docs explaining why it's so
terrible to use default AZ values for either booting an instance or setting
an aggregate AZ metadata, we still have confusing API docs that provide the
wrong name for the AZ...
Fixing that and trying to explain the problem within the docs, too.
Change-Id: I811d0f219142ca435b2b206e9b11ccd5ac611997
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
FilterScheduler is the only scheduler driver that properly integrated
with placement api so this patch changes the functional test environment
to use the FilterScheduler instead of the ChanceScheduler.
The amount of vcpu the SmallFakeDriver reports need to be bumped to 2
as during resize to same host the filter scheduler doubles the
allocation on the host. Simply relying on the 16.0 default allocation
ratio does not work as the max_unit of the vcpu does not use the
allocation ratio to avoid that a single server overallocates the cpu.
The only change in unit test is
test_create_instance_with_oversubscribed_cpu which also loads the
SmallFakeDriver and asserts available resources on it.
Change-Id: I12de2e195022593ea2a3e2894f2c3b5226930d4f
There are quite a few changes here as this is not only handling
uuids for the hypervisor id but it's also a refactor in several
APIs for consistency.
The main changes are detailed in the REST API Version History
doc in this change, but to summarize the changes:
* Hypervisor and service IDs are handled as the UUIDs for those
resources; this is necessary for accurately working with these
resources across multiple cells.
* The 'servers' and 'search' routes are deprecated and folded into
the index and detail methods as query parameters, validated using
json schema.
* The show method will also be able to return the list of servers
hosted on the given hypervisor using the with_servers query
parameter.
* The marker used when paging over lists of hypervisors is the
compute node UUID.
* Using the hypervisor_hostname_pattern query parameter will not
work with paging parameters.
* API reference docs are updated for the detailed changes.
* Functional and unit tests are provided for all changes.
Part of blueprint service-hyper-uuid-in-api
Change-Id: I828350c179df8bcfa4739910abeafaba2f96982b