This change introduces new [DEFAULT]/max_concurrent_snapshots parameter
in order to limit by default compute resource overuse related
to snapshot.
Implements: blueprint max-concurrent-snapshots
Change-Id: I40b8caf06ed525e97e871cf381776164208461fb
It seems that with certain host configuration the ipv6 wsgi tests are
failing as the test only skipped if no ipv6 interface is available but
it does not check if the test will be able to bind to a port on that
interface. So this patch extends the skip criteria by checking if
binding is possible.
Change-Id: Iffea0586f02e8d4020cadc8c513bafe984e07a6e
Closes-Bug: #1883885
Cherry-pick check script validates the proposed patch's commit message.
If a patch is not on top of the given branch then Zuul rebases it to
the top and the patch becomes a merge patch. In this case the script
validates the merge patch's commit message instead of the original
patch's commit message and fails.
This fix selects the parent of the patch if it is a merge patch.
Change-Id: I8e4e5afc773d53dee9c1c24951bb07a45ddc2f1a
The libvirt driver reads under /proc and /sys and depends on os.stat to
detect if two directories are on the same device. So the driver is
heavily Linux dependent. This patch makes sure that the nova-compute
service refuse to start with the libvirt driver on a non Linux platform.
Change-Id: I29c5a678efec4fbc4bd7958ebe6d454ae30701cd
In Python 3.3+, 'sys.platform' no longer includes a major version [1]:
issue 12326: On Linux, sys.platform doesn't contain the major version
anymore. It is now always 'linux', instead of 'linux2' or 'linux3'
depending on the Linux version used to build Python. Replace
sys.platform == 'linux2' with sys.platform.startswith('linux'), or
directly sys.platform == 'linux' if you don't need to support older
Python versions.
Since we only care about Python 3.6 or greater, we could simply check
for 'linux'. However, the libvirt driver isn't supported on non-Linux
hosts so this was always a dumb check. Simply remove it instead.
[1] https://docs.python.org/3.3/whatsnew/3.3.html#porting-python-code
Change-Id: I207a6c8c8cf562477792c69e353ba99b3ec4cb5e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #1882233
In Queens we deprecated the nova.image.download hook, which provided a
mechanism to inject custom code into the download path of our glance
module. This can now be removed.
The one known potential user of this is was a direct-rbd download
proposal, which needs further modification of the base glance client
in order to work. Thus, this removes the hook point, but not the
config option to allow specifying location schemes that should be
considered direct by the glance module. This provides a path forward
to integrate the direct-rbd code as a proper feature to our glance
module, which will mean un-deprecating that config option, but also
providing a stable list of potential options for it.
Change-Id: I7463af2ba9b74a73ffbb0a6b5fa12dff3fa5cac6
We have a race where if a user issues a delete request while an
instance is in the middle of booting, we could fail to update the
'queued_for_delete' field on the instance mapping with:
sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table
'instance_mappings' expected to update 1 row(s); 0 were matched.
This happens if we've retrieved the instance mapping record from the
database and then it gets deleted by nova-conductor before we attempt
to save() it.
This handles the situation by adding try-except around the update call
to catch StaleDataError and raise InstanceMappingNotFound instead,
which the caller does know how to handle.
Closes-Bug: #1882608
Change-Id: I2cdcad7226312ed81f4242c8d9ac919715524b48
This teaches libvirt's RBD image backend about the outside world, that
other ceph clusters may exist, and how to use Glance's multi-store image
import-via-copy mechanism.
The basic theory is that when we go to do the normal CoW clone for RBD,
we do the "does this image have a location that matches my RBD backend?"
check. If that check does not pass, if configured, we avoid failing
and ask Glance to copy it to our store instead. After that has completed,
we just recurse (once) and re-try our existing logic to see if the image
is now in a reachable location. If so, we pass like we would have
originally, and if not, we fail in the same way we would have.
The copy-to-store logic sets up a looping poll to check for copy completion
every N seconds according to a tunable, with a total timeout value in
case it never completes. If the timeout expires or Glance reports failure,
we will treat that the same as unreachable-due-to-location.
Related to blueprint rbd-glance-multistore
Change-Id: Ia839ad418b0f2887cb8e8f5ee3e660a0751db9ce
This just provides minimal support for calling the import API in Glance.
That API can do more things, but it is unlikely Nova would ever need to
call them, so this is rather opinionated and could be extended later if
needed.
Related to blueprint rbd-glance-multistore
Change-Id: Icf78fcabad8b966b6b5c289e1b660c01c928272d
When delete nova service by "nova service-delete <id>", this will delete the
compute node's resource provider in Placement. But if there are child resource
provider, Placement will throw exception(CannotDeleteParentResourceProvider)
and don't delete the resource provider. When we add the host service again,
Placement cannot insert new compute node resource provider, and we cannot use
the compute node any more. So we should delete sub resource provider in tree
when delete resource provider.
Modify unit test.
Change-Id: Ide8732be6c047ad1b141b89df676783b2fa2f25a
Closes-Bug: #1872385
The original fix of bug 1878024 missed an edge case where on a fresh
hypervisor the image cache directory hasn't been created yet. That
directory is only created when the first image is downloaded.
This patch makes sure that if the cache dir hasn't been created yet then
0 disk is reserved for the cache usage instead of raising and logging an
exception.
Change-Id: Id1bbc955a9099de1abc11b9063fe177896646d03
Related-Bug: #1878024
Closes-Bug: #1884214
Rework 'get_realtime_constraint' so that it can do the work previously
split between this and 'vcpus_realtime_topology', eliminating the need
for the latter. This provides a model for how we can parse the
'hw:cpu_dedicated_mask' extra spec in the future.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: I3a2132db258202afe5cfa0eb95e6905030314f98
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Now that we're into Ussuri, we no longer need to worry about receiving
objects from pre-Train compute nodes. Remove the code that was handling
this along with a couple of other TODOs that have either been resolved
or will never be resolved.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: I771117f18bfab7d73de8e431168c964a96d419e8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The 'cpuset_reserved' argument for the '_numa_fit_instance_cell'
function is only ever non-zero if the 'isolate' CPU thread policy is in
effect, and this thread policy can only be used if using the 'dedicated'
CPU policy is used. As such, we don't need to worry about overhead if
either the 'share' CPU thread policy or the 'shared' CPU policy is in
effect.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: Ib863b6a8d3bd3d2848fabd777fc1ac3387a7dd42
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This helper avoided a slightly long-winded check for what was
essentially a binary condition before. With the future introduction of a
'mixed' policy, this isn't always going to be suitable going forward.
Replace it with explicit checks for types.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: If7512c998bca770889d81012a17a1a2978cae68e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Do what we did for the InstanceNUMA objects as we did for (host) NUMA
objects in change Ib59970cce77d0276a53cfee6ff07ff64347673fc.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: I93254c6960ac5116af8f5202d05b859a656a8acf
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
It's possible to specify some strange values for the cpu realtime mask
and the code won't currently complain, so let's make it a bit more
strict.
Change-Id: I0ba06529affe5b48af5ac37bc24242dffdac77d3
Closes-Bug: #1884231
As with the 'nova.virt.hardware' module, add typing information here now
so that we can use it during development of later features. This
requires some minor tweaks of code that mypy found confusing.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: Icc7b3d250bb9dd3d162731959185d9e962727247
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is going to be used extensively in forthcoming patches. Lay the
groundwork now. This requires some minor tweaks of code that mypy found
confusing along with unit tests for coverage gaps it exposed.
Part of blueprint use-pcpu-and-vcpu-in-one-instance
Change-Id: Ied35762c353a084398ab8032a8efe6eada69dd9b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>