Commit Graph

58200 Commits

Author SHA1 Message Date
Dan Smith cbe3cd9dc3 Restart glance after updating policy in job
When we write out the glance policy for the multistore job, we do
so after glance has already started. After the json->yaml change,
we will decide too early in g-api lifetime that the legacy file
isn't present and thus never honor it later. So, create it and then
restart glance services.

Change-Id: Ic1c01366dbfdcfb85750b85f960b76aea934db59
2021-01-29 16:16:24 -08:00
Zuul b9c48afd15 Merge "Docs: correct cpu_thread_policy explanation" 2021-01-20 17:55:32 +00:00
Zuul 6517c56429 Merge "api-ref: Add notes about volume attach and detach being async" 2021-01-20 17:54:42 +00:00
Zuul 9b7247deb0 Merge "Make PCI claim NUMA aware during live migration" 2021-01-20 17:53:50 +00:00
Zuul 561183f47f Merge "libvirt: Remove support for '[libvirt] use_usb_tablet'" 2021-01-20 17:53:13 +00:00
Zuul 17c00fe9fd Merge "libvirt: Only add a USB controller if it's necessary" 2021-01-20 17:29:56 +00:00
Zuul cd794aa538 Merge "doc: require openstack client change for every new API microversion" 2021-01-20 17:04:42 +00:00
Zuul d00af5dc17 Merge "tox: Stop linting as part of docs target" 2021-01-20 17:04:07 +00:00
Zuul 8023067395 Merge "libvirt: Mock get_arch during some stable rescue unit tests" 2021-01-20 13:32:14 +00:00
Zuul 5b65812ef2 Merge "Add an online migration for PciDevice.uuid" 2021-01-17 14:30:57 +00:00
Zuul b8860c1e8b Merge "Modify PciDevice.uuid generation code" 2021-01-17 14:30:14 +00:00
Zuul 941f462463 Merge "Cyborg shelve/unshelve support" 2021-01-16 12:13:37 +00:00
Zuul c31f0e7c56 Merge "api-ref: Clarify 'all_tenants' command" 2021-01-16 05:49:01 +00:00
Zuul 16c25c4575 Merge "Reuse code from oslo lib for JSON policy migration" 2021-01-15 22:44:00 +00:00
Zuul f11aa5ee62 Merge "Fix typo in warning message" 2021-01-15 17:06:15 +00:00
Stephen Finucane 40e0578683 api-ref: Clarify 'all_tenants' command
An empty value for the 'all_tenants' query parameter of '/servers' and
'/servers/detail' means the value defaults to 'True', i.e. requesting
'/servers?all_tenants' is the same as '/servers?all_tenants=1'. Clarify
this, since the current wording is confusing.

Change-Id: Ib5fdd3b73aa5179e0379ee8f465e4118107786be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #1909745
2021-01-15 15:21:08 +00:00
zhangbailin 7fbd787b1b Cyborg shelve/unshelve support
This change extends the conductor manager to append the cyborg
resource request to the request spec when performing an unshelve.

On shelve offload an instance will be deleted the instance's ARQs
binding info to free up the bound ARQs in Cyborg service.
And this change passes the ARQs to spawn during unshelve an instance.

This change extends the ``shelve_instance``, ``shelve_offload_instance``
and ``unshelve_instance`` rpcapi function to carry the arq_uuids.

Co-Authored-By: Wenping Song <songwenping@inspur.com>

Implements: blueprint cyborg-shelve-and-unshelve
Change-Id: I258df4d77f6d86df1d867a8fe27360731c21d237
2021-01-15 03:21:17 +00:00
Ghanshyam Mann a72ace1c6c Reuse code from oslo lib for JSON policy migration
In Victoria cycle, we migrated the JSON formatted policy file to YAML
- https://review.opendev.org/#/c/748059/

Which added the upgrade check and policy fallback logic to select
the default JSON file if exist.

In Wallaby cycle, this work is defined as community wide goal
- https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

and common part of 1. upgrade check 2. policy fallback logic is moved
from nova to oslo.upgradechecks and oslo.policy respectively.

- oslo.upgradechecks(1.3.0): https://review.opendev.org/#/c/763484/
- oslo.policy(3.6.0): https://review.opendev.org/#/c/763261/

This commit make use these code form oslo lib.

Change-Id: I1a8bc19b77abdcb6867eb61fe6ea1945142b32d2
2021-01-14 22:41:33 +00:00
Zuul 7527fdf6ea Merge "tests: Clean up 'test_hypervisors'" 2021-01-14 14:18:13 +00:00
Zuul e6f5e81405 Merge "api: Drop statistics-style fields from os-hypervisors" 2021-01-11 22:19:14 +00:00
Zuul 362fbaa236 Merge "api: Normalize exception handling for os-hypervisors" 2021-01-11 17:37:02 +00:00
Manik Sidana 5f93b680e7 Fix typo in warning message
Change-Id: Idcc1671f3c584064469052b1cbe044f146af45ee
Closes-Bug: #1910960
2021-01-11 14:05:15 +05:30
Zuul ce49cda424 Merge "only wait for plugtime events in pre-live-migration" 2021-01-10 06:54:17 +00:00
Zuul ab797d5db1 Merge "Remove dead code from SchedulerReportClient" 2021-01-10 03:15:43 +00:00
Lee Yarwood dc09bcd311 libvirt: Mock get_arch during some stable rescue unit tests
This needs to be mocked to ensure the bus used for cdrom devices remains
consistent when the unit tests are ran on hosts with non-x86_64
architectures.

Closes-Bug: #1909969
Change-Id: Iccdbbb8cf2a9c0e01f0f32ed6d78a267486824af
2021-01-08 12:55:19 +00:00
Stephen Finucane 7aa7fb94fd tests: Clean up 'test_hypervisors'
This is a bit of a mess. Make it a little easier to parse.

Change-Id: I0c02299955a22a86fbb6b99d56050c8a21bef35b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-08 10:10:21 +00:00
Stephen Finucane 1f67ce2496 api: Drop statistics-style fields from os-hypervisors
Introduce API microversion 2.88, which makes the following changes to
a number of 'os-hypervisors'. Specifically, the following fields are
dropped from both the '/os-hypervisors/detail' (detailed list) and
'/os-hypervisors/{hypervisor_id}' (show) APIs:

- current_workload
- cpu_info
- vcpus
- vcpus_used
- free_disk_gb
- local_gb
- local_gb_used
- disk_available_least
- free_ram_mb
- memory_mb
- memory_mb_used
- running_vms

In addition, the '/os-hypervisors/statistics' API, which provided a
summary of the above stats but for all hypervisors in the deployment, is
dropped entirely.

Finally, the '/os-hypervisors/{hypervisor}/uptime' API, which provided a
similar response to the '/os-hypervisors/{hypervisor}' API but with an
additional 'uptime' field, has been removed in favour of including this
field in the primary '/os-hypervisors/{hypervisor}' API.

A small tweak to 'tox.ini' that allows us to share some venvs is
included.

Part of blueprint modernize-os-hypervisors-api

Change-Id: I515e484ade6c6455f82a3067940a418a0d7d965a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-08 10:10:21 +00:00
Stephen Finucane ef7598ac28 api: Normalize exception handling for os-hypervisors
Many of the functions implementing the various 'os-hypervisors'
endpoints share common code. In particular any of these functions
contain calls to both the 'instance_get_all_by_host' and
'service_get_by_compute_host' APIs of 'nova.compute.api.HostAPI' so we
can include instance and service information in the responses. All of
these calls are guarded with exception handlers, but the exceptions
handled differ between resources.

There is one exception we need to care about for
'instance_get_all_by_host': 'HostMappingNotFound', which is raised
because the API is decorated with the 'target_cell' decorator. The
'service_get_by_compute_host' API is also decorated by the
'target_host_cell' decorator, however, it can also raise
'ComputeHostNotFound'. This exception is possible because the
'service_get_by_compute_host' API calls
'nova.objects.Service.get_by_compute_host', which in turns calls
'nova.db.sqlalchemy.api.service_get_by_compute_host', via the
'_db_service_get_by_compute_host' helper. Not all of the functions that
called 'service_get_by_compute_host' were correctly guarding against
'ComputeHostNotFound'.

In addition to this, the call to the 'get_host_uptime' API used by the
'/os-hypervisors/uptime' API can raise 'HostNotFound' if the service has
been deleted but the compute node still has to be manually cleaned up.
Conversely, a number of functions were handling 'ValueError' even though
this couldn't realistically be raised by the test.

Resolve all of the above.

Change-Id: Iacabaea31311ae14084b55341608e16e531e6bd5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-Bug: #1646255
2021-01-07 16:52:39 +00:00
Zuul 4689996861 Merge "tests: Remove 'test_extended_hypervisors'" 2021-01-06 19:46:08 +00:00
Stephen Finucane f86bf703e5 tests: Remove 'test_extended_hypervisors'
This is a hangover from the days of API extensions. Everything that's
covered here is covered in 'test_hypervisors' now.

Change-Id: Ie824b972c9f63af7c38d63ade1d293c3acc7538b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-06 11:16:00 +00:00
Balazs Gibizer 6c6bca0326 Remove dead code from SchedulerReportClient
The commit fd351903a1 removed the last
real user of get_allocations_for_consumer_by_provider() so this function
is now removed.

Change-Id: I7b883348bb610a435ee1b79e921da0e698037534
2021-01-06 09:14:11 +01:00
Zuul ccb2e11129 Merge "Improving the description for unshelve request body" 2021-01-05 23:59:15 +00:00
zhangbailin b4f560d4e1 Improving the description for unshelve request body
The 'availability_zone' description in unshelve api-ref is confusing,
adding NOTE for unshelve request body:

Since microversion 2.77, allowed request body schema are {"unshelve":
null} or {"unshelve": {"availability_zone": <string>}}. A request body
of {"unshelve":{}} is not allowed.

Closes-Bug: #1908336
Change-Id: I66c209baf11c37ffebca52764263daae9e1dd50b
2021-01-05 12:21:01 +00:00
Zuul b0f241e542 Merge "Run the db migration tests in the same test worker" 2021-01-04 10:55:58 +00:00
Zuul 991d37ac3c Merge "tests: Merge 'test_hypervisor_status' into 'test_hypervisors'" 2021-01-04 10:33:12 +00:00
Zuul 96e9124ad7 Merge "Ignore PCI devices with 32bit domain" 2020-12-23 13:26:43 +00:00
Zuul d41bcf9d91 Merge "Revert "nova-multi-cell: Skip test_cold_migrate_unshelved_instance"" 2020-12-22 19:20:20 +00:00
Zuul 73f28e6e53 Merge "stabilize set_host libvirt driver unit test" 2020-12-22 12:49:35 +00:00
Zuul c33e32ba94 Merge "stabilize unit test asserting log" 2020-12-22 12:49:11 +00:00
Zuul 261416aeb0 Merge "Remove six.text_type (2/2)" 2020-12-22 00:46:32 +00:00
Zuul 34c5df7b2b Merge "Remove six.text_type (1/2)" 2020-12-22 00:45:56 +00:00
Zuul c5b9380277 Merge "Bump the lowest eventlet version to 0.26.1" 2020-12-21 16:57:42 +00:00
Lee Yarwood 606a5dfecc api-ref: Add notes about volume attach and detach being async
This change adds some basic notes in the api-ref for a wrinkle in the
current os-volume_attachments API in that both attach and detach actions
are async, returning to the caller *before* the underlying action is
complete. As such callers need to make seperate calls to ensure these
actions complete successfully.

There are also currently two different ways of polling for completion
when attaching and detaching.

- When attaching callers should use the volume status and list of
  attachments as reported by the volume API.

- When detaching callers should instead use the list of volume attachments
  reported by the os-volume_attachments API.

This is due to the way in which Nova currently completes the attachment
via c-api last during attachment and deletes the bdm record last during
detachment.

It would be useful to one day centralise on just using the
os-volume_attachments API to poll both actions but to do that we would
need to start tracking our own state within the BDMs.

Change-Id: Id367ee53ef1458b6a90fc107ab14f5b3cbba7a86
2020-12-21 16:22:57 +00:00
Zuul 06c0a4e6bc Merge "Fallback to same-cell resize with qos ports" 2020-12-21 14:58:36 +00:00
Zuul 282299eced Merge "Reproduce bug 1907522 in functional test" 2020-12-21 14:55:48 +00:00
Zuul b7e43b8b77 Merge "Remove six.binary_type/integer_types/string_types" 2020-12-21 13:37:37 +00:00
Balazs Gibizer 800254c0bc Run the db migration tests in the same test worker
In a heavily IO deprived CI VM the db migration tests could take a
significant amount of time and eventually time out. This patch moves the
tests into the same test executor worker process to spread the load
generated by these test in time until a final solution is found. For
example we hope that [1] will help eventually to decrease the load.

[1] https://review.opendev.org/q/topic:bp/compact-db-migrations-wallaby

Change-Id: I6ce930fa86c82da1008089791942b1fff7d04c18
Related-Bug: #1823251
2020-12-18 13:42:34 +01:00
songwenping 0be00cd58a Trival Change: Remove redundant code in instance delete
Change-Id: I92e57aefeb909297cf3d4f566a3308aa9312bb02
2020-12-18 11:15:52 +00:00
Zuul 0e5aa1b5e1 Merge "functional: Expand SR-IOV live migration tests with NUMA" 2020-12-17 16:13:22 +00:00
Zuul 8297147290 Merge "functional: Add live migration tests for PCI, SR-IOV servers" 2020-12-17 16:05:28 +00:00