When one resizes a pinned instance, the instance claims host CPUs for
pinning purposes on the destination. However, the host CPUs on the
source are not immediately relinquished. Rather, they are held by the
migration record, to handle the event that the resize is reverted. It is
only when one confirms this resize that the old cores are finally
relinquished.
It appears there is a potential race between the resource tracker's
periodic task and the freeing of these resources, resulting in attempts
to unpin host cores that have already been unpinned. This test
highlights that bug pending a fix.
Change-Id: Ie092628ac71eb87c9dfa7220255a2953ada9e04d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-Bug: #1879878
It's unnecessary, particularly when nothing of the other service
fixtures use it.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: If849f80c0372872b2de57b20e8b63c069a54ccff
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The '_check_api_endpoint' function only had a single caller and was far
more complicated that necessary. Move it to that caller and simplify.
Change-Id: I535886dbac4e41677285a14c010ec45a54e77c79
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
These tests would would rely on the version of libvirt reported by
FakeLibvirt being older than MIN_LIBVIRT_BETTER_SIGKILL_HANDLING instead
of ensuring that was the case to exercise certain destroy behaviours.
Change-Id: I3571efde0061d9337d6c544d093976ccdd2762e8
This would previously result in
nova.virt.libvirt.host.Host.has_min_version not being correctly mocked
and would instead rely on the versions of libvirt and QEMU being
reported by FakeLibvirt being lower than
MIN_LIBVIRT_VIDEO_MODEL_VERSIONS['none'] aka libvirt v4.6.0.
Change-Id: I4624ff7dd1e71c8a9656e4ce2118fd04941a4086
When rebuilding, we should only allow detaching
the volume with 'in-use' status, volume in status
such as 'retyping' should not allowed.
Change-Id: I7f93cfd18f948134c9cb429dea55740d2cf97994
Closes-Bug: #1489304
I7eb86edc130d186a66c04b229d46347ec5c0b625 introduced
VIR_ERR_DEVICE_MISSING into the hot unplug libvirt error code list
within detach_device_with_retry. While the change correctly referenced
that the error code was introduced in v4.1.0 it made no attempt to
handle versions prior to this. With MIN_LIBVIRT_VERSION currently pinned
to v4.0.0 we need to handle libvirt < v4.1.0 to avoid referencing the
non-existent error code within the libvirt module.
Closes-Bug: #1891547
Change-Id: I32908b77c18f8ec08211dd67be49bbf903611c34
The old job name is still available as an alias for a while,
but it is time to switch away from it.
Change-Id: I93c35b386e1b1cbcff74fe0a2388f0eda5dea3b9
Currently if target is not passed in context.can(),
it use defauls target which is context.user_id, context.project_id.
These defaults target are not useful as it pass the
context's user_id and project_id only which means we tell
oslo policy to verify the context data with context data.
This commit pass the actual target for networks policies
which is context.project_id itself as nova cannot verify the owner of
FIP. Neutron will return the authorise error is requester is not
owner of FIP.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: I13d37d36bdc294960306271204c83bbdebaeb7b7
This adds new defaults roles in FIP API policies.
These policies are made granular and default to
PROJECT_READER_OR_SYSTEM_READER and PROJECT_MEMBER_OR_SYSTEM_ADMIN.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: I6dcc8db9178aef59017968a3172ab463cd74754d
Currently if target is not passed in context.can(),
it use defauls target which is context.user_id, context.project_id.
These defaults target are not useful as it pass the
context's user_id and project_id only which means we tell
oslo policy to verify the context data with context data.
This commit pass the actual target for networks policies
which is context.project_id itself as nova cannot verify the owner of
network. Neutron will return the authorise error is requester is not
owner of network.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: I76bbb570996612c1366b6b6c52772f04a9953080
This adds new defaults roles in networks API policies.
These policies are made granular and default to
PROJECT_READER_OR_SYSTEM_READER.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: Idcccdf6b3a1638cf140b5c4f887abbed85c5d7dc
This adds scope_type and new defaults roles in extensions
API policies. These policies are for extensions API which are
kept only for backward compatibility of v2.0 but nova does not
have extensions concept now and return only hard-coded info. So
these policies are not made granular.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: I062e556feb5cc85d179fed9b675e4ab33ca3365a
Currently if target is not passed in context.can(),
it use defauls target which is context.user_id, context.project_id.
These defaults target are not useful as it pass the
context's user_id and project_id only which means we tell
oslo policy to verify the context data with context data.
This commit pass the actual target for baremetal nodes policies
which is empty dict because policy rule is system scoped rather
than project, so the token scope check deals with the required
target checking.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: I176b273d66c870303a86f4df11cc5fc37c36d943
This adds new defaults roles in baremetal nodes API policies.
These policies are default to SYSTEM_READER and made more
granular to adopt the new defaults.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: Ieaad388d31fdabf0854bf7e2ed9fddf11f86bf8c
The tests previously mocked eventlet.greenthread.sleep directly but
I62e9f1a7cde8846be368fbec58b8e0825ce02079 removed this call from
LoopingCallBase._sleep in oslo.service 1.32.1. Just mock the _sleep
method directly to avoid us ever spinning in tests on this again.
Closes-Bug: #1891898
Change-Id: I0872ee16e9fc49c988fe588f029ab71f429790f5
Remove six.PY2 and six.PY3.
Subsequent patches will replace other six usages.
Change-Id: Iccce0ab50eee515e533ab36c8e7adc10cb3f7019
Implements: blueprint six-removal
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Current tests do not have good test coverage of existing policies.
Either tests for policies do not exist or if they exist then they
do not cover the actual negative and positive testing.
To adopt the keystone's scope_type and new defaults in deprecated
API policies, we need to first write test coverage for the same to
know the complete effect of policies changes.
Partial implement blueprint policy-defaults-refresh-deprecated-apis
Change-Id: Ib89d65f93363f36de15a5a722fe8991c16ad6235