This adds a new microversion and support for requesting image pre-caching
on an aggregate.
Related to blueprint image-precache-support
Change-Id: I4ab96095106b38737ed355fcad07e758f8b5a9b0
In microversion 2.80, the ``GET /os-migrations`` API will have
optional ``user_id`` and ``project_id`` query parameters for
filtering migrations by user and/or project:
* GET /os-migrations?user_id=ef9d34b4-45d0-4530-871b-3fb535988394
* GET /os-migrations?project_id=011ee9f4-8f16-4c38-8633-a254d420fd54
* GET /os-migrations?user_id=ef9d34b4-45d0-4530-871b-3fb535988394&project_id=011ee9f4-8f16-4c38-8633-a254d420fd54
And expose the ``user_id`` and ``project_id`` fields in the following APIs:
* GET /os-migrations
* GET /servers/{server_id}/migrations
* GET /servers/{server_id}/migrations/{migration_id}
Co-Authored-By: Qiu Fossen <qiujunting>
Part of blueprint add-user-id-field-to-the-migrations-table
Change-Id: I7313d6cde1a5e1dc7dd6f3c0dff9f30bbf4bee2c
This is probably the most involved of all the changes and requires a
significant expansion of the NeutronFixture to mock floating IP
interactions. All the API samples were based off responses pulled from a
DevStack configuration using openstackclient and old versions of the
novaclient (where the 'floating-ip-*' commands were still present) in
debug mode.
Change-Id: Ib2f10a51bebd10cc69b78427b485aeac19f59141
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We're going to want to use this for realistic API samples. The samples
we're using here were taken from a DevStack deployment based on pre-RC1
Train code so they should be fairly reflective of what you'd see in a
real deployment.
Note that this effectively undoes a lot of the changes first introduced
in Ibbee7fd11c1aa254e399d302adbae69126e98262, particularly around the
responses for instances in a down cell, where we previously changed
things so a 'security_groups' field was present in the response. This
is okay since we're not creating interfaces and therefore don't expect
to have security groups present.
Change-Id: I3c94b61fc323fefbd1c8790c4a2f60cada29e86f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This has been tying us to nova-network. This should be a one line change
but it has a large knock-on effect due to lots of samples using it. We
just need to suck it up and deal with it, unfortunately.
Change-Id: I09c88e0fdf3635683c56901637fc3c0a9084d482
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Another case of there being no nova-network host.
Change-Id: I51df797df4e1b77f70fe3dd87374737e650c27d9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Three tests require modification to specifically request an API that our
NeutronFixture provides. The rest just work (TM).
Change-Id: I423b7ab5c98ea9d559caefec0b49271e28a140fa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
For our immediate purposes, this should always return something so we
modify the mock to do just that. That requires some modifications to
existing tests but is otherwise pretty simple. A future change will
address the TODO contained within to properly mock the neutron API.
Change-Id: Ibbee7fd11c1aa254e399d302adbae69126e98262
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This one is long because network quotas aren't a thing when using
neutron, which means we need to remove them from all the samples.
Change-Id: I9cb2fb1b3817797a53c1331d666750399a7f5f87
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This is pretty simple - a nova-network host obviously won't be present
in nova-network is disabled.
Change-Id: I4872f0bcaabb8e1cf1aad297a1c55993f2a3fe6e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This is a partial revert of commit
9606c80402 which added the 'path' query
parameter to work with noVNC v1.1.0. This broke all other console types
using websockify server (serial, spice) because the websockify server
itself doesn't know how to handle the 'path' query parameter. It is the
noVNC vnc_lite.html file which parses the 'path' variable and uses it
as the url to the websockify server. So, all other console types should
*not* be generating a console access url with a 'path' query parameter,
only noVNC.
Closes-Bug: #1845243
TODO(melwitt): Figure out how to test serial and/or spice console in
the gate
Change-Id: I9521f21a685edc44121d75bdf534c201fa87c2d7
This is a follow up to I04bca162c3a1d4fed7056385dfdca72c07bab9a5
to make test_list_volume_attachments use two attachments for the
list response output and to update the API reference samples.
Change-Id: I6d7cee16e1eed6fa4fdb6389c6d3ff670ac5a7c3
The amount of DB and compute service stubbing in these
functional tests is pretty gross and makes it harder to
maintain/extend them for new microversions which makes
it harder for new contributors to work with these kinds
of tests.
This removes the stubs and uses the CinderFixture. The
only new stub is dealing with detaching a volume with a
device tag since the fake driver does not track device
metadata on instances.
The API reference doc samples are regenerated using:
tox -e api-samples VolumeAttachmentsSample
Change-Id: I04bca162c3a1d4fed7056385dfdca72c07bab9a5
Add the 'delete_on_termination' field to the volume attach API to support
configuring whether to delete the data volume when the instance is destroyed.
To avoid upgrade impact issues with older computes, the
'delete_on_termination' field is set in the API rather than when the BDM
is created in the compute service.
Implements: blueprint support-delete-on-termination-in-server-attach-volume
Change-Id: I55731b1822a4e32909665a2872d80895cb5b12f7
Add a new server topology API to show server NUMA information:
- GET /servers/{server_id}/topology
Add new policy to control the default behavior:
- compute:server:topology:index
- compute:server:topology:host:index
Change-Id: Ie647ef96597195b0ef00f77cece16c2bef8a78d4
Implements: blueprint show-server-numa-topology
Signed-off-by: Yongli He <yongli.he@intel.com>
This adds support, in a new microversion, for specifying an availability
zone to the unshelve server action when the server is shelved offloaded.
Note that the functional test changes are due to those tests using the
"latest" microversion where an empty dict is not allowed for unshelve
with 2.77 so the value is changed from an empty dict to None.
Implements: blueprint support-specifying-az-when-restore-shelved-server
Closes-Bug: #1723880
Change-Id: I4b13483eef42bed91d69eabf1f30762d6866f957
In a future change, the use of 'hw:cpu_policy' will require a host to
report PCPU inventory. Rather than modify the fake driver used in these
tests to report such inventory, just use a different extra spec,
'hw:numa_nodes'. This has the added bonus of being supported by both the
libvirt and Hyper-V virt drivers, unlike 'hw:cpu_policy' and
'hw:mem_page_size', which are only supported by the libvirt virt driver.
Change-Id: Id203dc07f08557b1b094ec72e1df3493ec9524b1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This patch adds a new external event called "power-update"
through which ironic will convey all (power_off and power_on)
power state changes (running -> shutdown or shutdown -> running
will be the only ones handled by nova and the rest will be ignored)
on a physical instance to nova. The database will be updated
accordingly to reflect the real vm_state and power_state of the
instance. This way nova will not be able to enforce
an incorrect power state on the physical instance during
the periodic "sync_power_states" task.
Implements blueprint nova-support-instance-power-update
Story: 2004969
Task: 29423
Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496
This microversion implements below API cleanups:
1. 400 for unknown param for query param and for request body.
2. Making server representation always consistent among all APIs
returning the complete server representation.
3. Change the default return value of ``swap`` field from the empty string
to 0 (integer) in flavor APIs.
4. Return ``servers`` field always in the response of GET
hypervisors API even there are no servers on hypervisor
Details: https://specs.openstack.org/openstack/nova-specs/specs/train/approved/api-consistency-cleanup.html
Partial-Implements: blueprint api-consistency-cleanup
Change-Id: I9d257a003d315b84b937dcef91f3cb41f3e24b53
Add a new microversion that adds two new params to create
server named 'host' and 'hypervisor_hostname'.
Part of Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server
Change-Id: I3afea20edaf738da253ede44b4a07414ededafd6
The virt driver FakeDriver used in both the functional and in the unit
test used a global state to configure the host and node names the driver
reports. This was hard to use when more then one compute service is started.
Also global state is dangerous.
It turned out that only a set of unit tests are using multiple nodes per
compute the rest of the tests can simply use host=<hostname>,
nodes=[<hostname>] setup.
So this removes the global state.
Change-Id: I2cf2fcbaebc706f897ce5dfbff47d32117064f9c
This hasn't been needed since we moved console authentication to the
database in Rocky.
Part of blueprint remove-consoleauth
Change-Id: Ie5e7d70f9d6af77edd22756128937f06d0b961a9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Starting in noVNC v1.1.0, the token query parameter is no longer
forwarded via cookie [1]. We must instead use the 'path' query
parameter to pass the token through to the websocketproxy [2].
This means that if someone deploys noVNC v1.1.0, VNC consoles will
break in nova because the code is relying on the cookie functionality
that v1.1.0 removed.
This modifies the ConsoleAuthToken.access_url property to include the
'path' query parameter as part of the returned access_url that the
client will use to call the console proxy service.
This change is backward compatible with noVNC < v1.1.0. The 'path' query
parameter is a long supported feature in noVNC.
Co-Authored-By: melanie witt <melwittt@gmail.com>
Closes-Bug: #1822676
[1] https://github.com/novnc/noVNC/commit/51f9f0098d306bbc67cc8e02ae547921b6f6585c
[2] https://github.com/novnc/noVNC/pull/1220
Change-Id: I2ddf0f4d768b698e980594dd67206464a9cea37b
This patch adds a new parameter ``locked_reason`` to
``POST /servers/{server_id}/action`` request where the
action is lock. It enables the user to specify a reason when locking
a server.
The locked_reason will be exposed through ``GET servers/{server_id}``,
``GET /servers/detail``, ``POST /servers/{server_id}/action`` where
the action is rebuild and ``PUT servers/{server_id}`` requests' responses.
The InstanceActionNotification will emit the locked_reason
along with the other instance details. This patch hence changes the
payload object to include the "locked_reason" field.
Note that "locked" will be allowed as a valid filtering/sorting parameter
for ``GET /servers/detail`` and ``GET /servers`` from this new microversion.
Implements blueprint add-locked-reason
Change-Id: I46edd595e7417c584106487123774a73c6dbe65e
Drop support for the os-cells REST APIs, which are part of the cells v1
feature which has been deprecated since Pike.
This API now returns a 410 response for all routes.
Unit tests are removed and the functional API sample tests are just
asserting the 410 response now. The latter are also expanded to cover
APIs that weren't previously tested.
The API sample docs are left intact since the API reference still builds
from those and can be considered more or less branchless, so people
looking at the API reference can apply it to older deployments of nova
before os-cells was removed.
A release note added for previous cells v1 removals is amended to note
this additional change.
Part of blueprint remove-cells-v1
Change-Id: Iddb519008515f591cf1d884872a5887afbe766f2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
A new API microversion, 2.72, is added that enables support for Neutron
ports having resource request during server create.
Note that server delete and port detach operations already handle such
ports and will clean up the allocation properly.
Change-Id: I7555914473e16782d8ba4513a09ce45679962c14
blueprint: bandwidth-resource-provider
The "availability_zone" parameter for server create in the
API reference and the availabilty zone user docs both say
that users should not use the default availability zone (nova)
yet our server create API samples use "nova" which is...bad.
This change fixes the API samples and related tests to use
a fake "us-west" availability zone. For any samples that were
requesting an AZ when creating a server, those are changed from
requesting "nova" to requesting "us-west" and a new
AvailabilityZoneFixture is added to stub out the code used to
validate the requested AZ and what is shown in server detail
responses.
Some unused samples are removed from the os-availability-zone
directory and the API reference and AZ user docs are updated for
formatting and linking to other docs for reference.
Change-Id: I3161157f15f05a3ffaaf1b48e7beb6b3e59c5513
Closes-Bug: #1817963
The down-cell microversion 2.69 just recently merged and it returns
links in the response for GET /servers/detail and GET /servers but not
for GET /servers/{server_id} which was an oversight because that API
returns links normally.
We should include the links key in the 'nova show' case as well and this
patch does exactly that.
Typically this would require a microversion change but given the code
merged recently and is not yet released we are just fixing this
oversight through this patch without a microversion bump.
Closes-Bug: #1818131
Change-Id: I2ce03df994f59c37b5ce3102c4e7165d17701798
The server-groups UUID add to response of 'GET /servers/{id}',
'PUT /servers/{server_id}" and rebuild API
'POST /servers/{server_id}/action'.
Change-Id: I4a2a584df56ece7beb8b12c0ce9b0e6b30237120
Implements: blueprint show-server-group
Co-authored-by: Gerry Kopec <Gerry.Kopec@windriver.com>
Signed-off-by: Yongli He <yongli.he@intel.com>
This patch adds the following files:
1) doc/api_samples/os-evacuate/v2.68/server-evacuate-find-host-req.json
2) doc/api_samples/os-evacuate/v2.68/server-evacuate-req.json
which were missing in https://review.openstack.org/#/c/634600/
so that the "tox -e api_samples" can run without errors.
Change-Id: I248b7e172698a9bee155e72215c231da9033540a
Closes-bug: #1817915
This change adds a new microversion to expose virtual
device tags for volumes and ports attached to a server.
Implements blueprint expose-virtual-device-tags-in-rest-api
Change-Id: I09420ff7134874dfe4dc399931c7740e81ecc2d0
This patch introduces a new API microversion which will be
used to alter the responses of ``GET /servers``, ``GET /servers/detail``,
``GET /servers/{server_id}`` and ``GET /os-services`` when a cell is
down to return minimal constructs with missing keys.
Implements blueprint handling-down-cell
Change-Id: Id9f12532897912b39093f63e9286540d9029edeb
The 2.49 microversion for the os-volume_attachments API
only changes the POST action to attach a volume with a tag.
But we should make sure 2.49 is backward compatible on the
GET, PUT and DELETE methods for the same API.
This makes VolumeAttachmentsSampleV249 extend
VolumeAttachmentsSample and also removes duplicate code
by adding the _get_vol_attachment_subs method.
In addition, VolumeAttachmentsSampleV249OldCinderFlow is
removed since it didn't really work properly (it was missing
a few stubs) and was redundant with the test_tagged_attach_volume
unit test found in nova.tests.unit.test_compute_api.
Change-Id: I757576d3474997c49c67745fb245122fc2c6decc
Add a new microversion that removes support for the aforementioned
argument, which cannot be adequately guaranteed in the new placement
world.
Change-Id: I2a395aa6eccad75a97fa49e993b0300bdcfc7258
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Implements: blueprint remove-force-flag-from-live-migrate-and-evacuate
APIImpact
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