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>
As of commit 1c9de9c777, we no longer
pass any args to the archive_deleted_rows function, so we can remove
the argument list from the function.
Change-Id: I73b2f716908088b137102631f9360939a1d7341a
As part of the cross-cell resize work, we need to be able
to tell the scheduler that it's OK to select destinations
from cells in which the instance does not currently live.
This happens via the "allow_cross_cell_move" flag in the
RequestSpec.requested_destination field, which is not set
at this time (this is just plumbing which will be used later)
and defaults to False for backward compatibility.
Part of blueprint cross-cell-resize
Change-Id: Ib29a17f7fcc3280871d5c9ba31e1374eff98cf82
This adds a new boolean field, allow_cross_cell_move, to
the Destination object used within a RequestSpec.
This will be used during a cross-cell resize when asking
the scheduler for a target host whether or not that host
should be restricted to the current cell or if the host
can come from another cell. Furthermore, it will be used
in a scheduler weigher which will prefer candidate target
hosts in the current cell rather than a different cell.
Part of blueprint cross-cell-resize
Change-Id: I6e226321348f5d64d16b0bae26ad31c52debf0bc
For a cross-cell resize, the equivalent of the "finish_resize"
method on the destination compute is going to call the
driver spawn() method rather than the finish_migration()
method and needs to pass through the power_on value, similar
to finish_migration, so that when resizing a stopped server
it remains stopped once it is resized.
The finish_migration method in the driver behaves very similar
to spawn so the semantics are the same.
This change updates the spawn method signature for all in-tree
compute drivers but only implements the logic for the libvirt
driver as that is the only driver (currently) which supports
cross-cell resize (note the can_connect_volume method is also
necessary for cross-cell resize implementation in the driver).
Part of blueprint cross-cell-resize
Change-Id: I6929c588dd2e0e805f2e30b2e30d29967469d756
This change does two things:
First is a simple refactor to allow passing a BDM to
_remove_volume_connection. The interface on the public
remove_volume_connection cannot be easily changed since
it's an RPC API call.
Second, the new private method gains a delete_attachment
kwarg which will tell the method whether or not to delete
a v3-style attachment, i.e. bdm.attachment_id is not None.
This is prep work for an upcoming change that is going
to call the new private method locally rather than over
RPC.
Change-Id: Ice6d5b4757134b7d1b36514744a8f958528a6a47
This refactors the meat from delete_image_on_error()
to nova.compute.utils so it can be re-used in other
places.
Change-Id: Idee91453289dd512eddfc4903ce00e4e20b76df8
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>
The 'ResourceRequest' object sources information from three different
attributes of an instance: the instance's image metadata properties,
the instance's flavor, this flavor's extra specs. It's possible for a
user to override resources requested via the flavor using flavor extra
specs (e.g. using the 'resources:VCPU=N' extra spec), and it's possible
to override traits requested via the flavor extra specs using image
metadata (e.g. using the 'traits_required=foo' metadata property). This
means there's an implicit hierarchy present:
- Traits: image metadata > flavor extra specs
- Resources: flavor extra specs > flavor
Previously, we pulled information from the flavor extra specs and image
metadata using two classmethods, 'from_extra_specs' and
'from_image_props', but this required a lot of glue code in between to
ensure this hierarchy was maintained. Stop doing this, preferring to
centralize everything in one location. This results in fewer LoC and a
more grokable implementation, and will make things much easier when we
start handling 'PCPU's here.
Part of blueprint cpu-resources
Change-Id: Ic0e6bc47b79711b38b2d4dabaeb5ae1dbaf2b18a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We are already running archive_deleted_rows in the gate, but we are
not verifying whether all instance records, for example, were actually
successfully removed from the databases (cell0 and cell1).
This adds the --all-cells option to our archive_deleted_rows runs and
verifies that instance records were successfully removed from all cell
databases.
It is not sufficient to check only for return code 0 because
archive_deleted_rows will still return 0 when it misses archiving
records in cell databases.
Related-Bug: #1719487
Change-Id: If133b12bf02d708c099504a88b474dce0bdb0f00
The archive_deleted_rows cmd depend on DB connection config from config
file, and when applying super-conductor mode, there are several config
files for different cells. If so, the command can only archive rows in
cell0 DB as it only reads the nova.conf
This patch added code that provides --all-cells parameter to the
command and read info for all cells from the api_db and then archive
rows across all cells.
The --all-cells parameter is passed on to the purge command when
archive_deleted_rows is called with both --all-cells and --purge.
Co-Authored-By: melanie witt <melwittt@gmail.com>
Change-Id: Id16c3d91d9ce5db9ffd125b59fffbfedf4a6843d
Closes-Bug: #1719487
N321, N328, N329, N330 hacking rules have been removed
since I9c334162fe1799e7b24563fdc11256b91bbafc9f.
However the descriptions are still in HACKING.rst.
So remove them.
The rule number N307 is missing in HACKING.rst.
So add it.
Change-Id: I868c421a0f5a3329ab36f786f8519accae623f1a
Closes-Bug: #1841400
This makes it a little easier to reason about tests and helps us better
see where the gaps are.
Change-Id: Ib59970cce77d0276a53cfee6ff07ff64347673fc
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
While reviewing the AZ in unshelve request BP,
matt found that there is no test case for passing
the AZ as integer value in create server request.
- https://review.opendev.org/#/c/663851/40
This commit adds the missing test case and make sure
code raise ValidationError.
Change-Id: I1cf628c490e8937e2e822957a1de173f02c69bbb
Version 0.35.0 of openstacksdk moved a get_endpoint call out from
_make_proxy, rebreaking all our tests that don't care about SDK adapters
beyend default mocking.
This commit stubs out that get_endpoint call.
We get to stop doing this soon, I promise.
Change-Id: I18b13609768d557f2db3b5ab70d913494933dc43
Due to bug 1802143, devstack was ignoring variables set in the
$NOVA_CPU_CONF section of local_conf. Now that that bug has been fixed
(see the Depends-On) we can put those back in their rightful place.
This patch moves the [compute]resource_provider_association_refresh
setting, introduced via [1], accordingly.
[1] https://review.opendev.org/616033
Depends-On: https://review.opendev.org/672805
Change-Id: Ifa50748b6d6e91ac954d0a7a6060505fd45716d4
Related-Bug: #1802143
get_vif_devname_with_prefix is no longer used after 54b1af686d,
so this is to remove it for code clean.
Change-Id: Iab16a15a5f141a7f7aae4172b092c50ee7964597