57387 Commits

Author SHA1 Message Date
Zuul
1c102141db Merge "Fix cherry-pick check for merge patch" 2020-07-02 18:40:36 +00:00
Zuul
2a0cc70202 Merge "Limit the number of concurrent snapshots" 2020-07-01 21:56:24 +00:00
Zuul
8e2170d708 Merge "Prevent libvirt driver starting on non Linux platform" 2020-07-01 19:59:33 +00:00
Zuul
833eaff4d5 Merge "Extend is_ipv6_supported() to cover more error cases" 2020-07-01 15:47:28 +00:00
Zuul
ecb9e4271e Merge "Correct reported system memory" 2020-07-01 15:47:11 +00:00
Alexandre Arents
6bb0c4fdab Limit the number of concurrent snapshots
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
2020-06-30 06:02:05 +00:00
Zuul
d4c857dfcb Merge "objects: Add MigrationTypeField" 2020-06-29 17:38:07 +00:00
Balazs Gibizer
01e3c8778d Extend is_ipv6_supported() to cover more error cases
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
2020-06-29 15:13:55 +02:00
Zuul
d4d8ea1da3 Merge "hardware: Rework 'get_realtime_constraint'" 2020-06-27 08:57:32 +00:00
Zuul
279aa24b54 Merge "Fix aggregate placement sync issue" 2020-06-27 05:31:10 +00:00
Zuul
c6d6907651 Merge "Delete resource provider in tree by top-down traversable order" 2020-06-26 19:40:40 +00:00
Elod Illes
c7c48c6f52 Fix cherry-pick check for merge patch
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
2020-06-26 20:31:20 +02:00
Zuul
f644da10b2 Merge "Update interop repo link" 2020-06-26 17:40:35 +00:00
Zuul
4ae5b61c4f Merge "Make libvirt able to trigger a backend image copy when needed" 2020-06-26 13:42:26 +00:00
Zuul
6f62db9462 Merge "hardware: Remove handling of pre-Train compute nodes" 2020-06-26 13:12:21 +00:00
Zuul
7c8c6b809d Merge "hardware: Don't consider overhead CPUs for unpinned instances" 2020-06-26 13:12:14 +00:00
Zuul
d7f9862427 Merge "libvirt: Remove workaround for unsupported libvirt version" 2020-06-26 08:53:43 +00:00
Zuul
7f4d59a674 Merge "Remove deprecated nova.image.download hook" 2020-06-26 08:53:36 +00:00
Zuul
b1f4b303f7 Merge "Raise InstanceMappingNotFound if StaleDataError is encountered" 2020-06-26 03:32:14 +00:00
Zuul
bbb8e3a17c Merge "Plumb image import functionality through our glance module" 2020-06-25 23:23:27 +00:00
Zuul
db916926e5 Merge "Remove lxml deprecated methods" 2020-06-25 14:08:42 +00:00
Balazs Gibizer
68a5531568 Prevent libvirt driver starting on non Linux platform
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
2020-06-25 13:20:24 +01:00
Stephen Finucane
e567adf7f6 Correct reported system memory
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
2020-06-25 13:19:32 +01:00
Dan Smith
2fbe8e02d5 Remove deprecated nova.image.download hook
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
2020-06-25 08:03:31 +00:00
Zuul
6bc1352744 Merge "objects: Replace 'cpu_pinning_requested' helper" 2020-06-25 01:20:22 +00:00
melanie witt
16df22dcd5 Raise InstanceMappingNotFound if StaleDataError is encountered
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
2020-06-24 20:29:44 +00:00
Dan Smith
07025abf72 Make libvirt able to trigger a backend image copy when needed
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
2020-06-24 07:37:51 -07:00
Dan Smith
4a6a366b05 Plumb image import functionality through our glance module
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
2020-06-24 07:37:51 -07:00
Zuul
1cae0cd722 Merge "tests: Split instance NUMA object tests" 2020-06-24 03:16:28 +00:00
Zuul
13fd3e323e Merge "hardware: Add validation for 'cpu_realtime_mask'" 2020-06-24 03:16:21 +00:00
Zuul
9cdf90add4 Merge "libvirt: Add typing information" 2020-06-24 03:01:54 +00:00
Zuul
1c3dd7ce0a Merge "hardware: Update and correct typing information" 2020-06-24 03:01:42 +00:00
Zuul
173b4bed77 Merge "Guard against missing image cache directory" 2020-06-24 02:27:15 +00:00
Zuul
f612fbf088 Merge "Cap jsonschema 3.2.0 as the minimal version" 2020-06-24 01:54:33 +00:00
Hervé Beraud
385df41b70 Remove lxml deprecated methods
All our supported runtimes [1] are compatible with the recommended
alternatives.

The `getchildren` method is deprecated [2] since lxml 2.0 and will be removed
in future versions, these changes switch usages to `list(elem)` as
recommended in the official documentation [2].

[1] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-train
[2] https://lxml.de/api/lxml.etree._Element-class.html#getchildren

Change-Id: Ibdc54cdc62d84ea98d4f21bb3698e6726e56365a
2020-06-23 13:26:20 +02:00
songwenping
a45daafd31 Delete resource provider in tree by top-down traversable order
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
2020-06-23 07:20:29 +00:00
Balazs Gibizer
a85753778f Guard against missing image cache directory
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
2020-06-22 17:44:09 +02:00
Zuul
f1ebc15dfc Merge "Remove hooks" 2020-06-21 06:46:45 +00:00
Zuul
07acbe8ce7 Merge "Add missing test bindep on openssl" 2020-06-21 02:01:16 +00:00
Stephen Finucane
c88a35e8ea hardware: Rework 'get_realtime_constraint'
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>
2020-06-19 16:24:51 +01:00
Stephen Finucane
184a2cadf0 hardware: Remove handling of pre-Train compute nodes
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>
2020-06-19 14:43:12 +01:00
Stephen Finucane
0a0c174fbc hardware: Don't consider overhead CPUs for unpinned instances
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>
2020-06-19 14:43:12 +01:00
Stephen Finucane
690ce37e72 objects: Replace 'cpu_pinning_requested' helper
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>
2020-06-19 14:43:12 +01:00
Stephen Finucane
dff70b3bce tests: Split instance NUMA object tests
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>
2020-06-19 14:43:12 +01:00
Chris Friesen
b065974187 hardware: Add validation for 'cpu_realtime_mask'
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
2020-06-19 14:43:12 +01:00
Stephen Finucane
6a71981e47 libvirt: Add typing information
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>
2020-06-19 10:47:59 +01:00
Stephen Finucane
26c1567a16 hardware: Update and correct typing information
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>
2020-06-19 10:16:25 +01:00
Zuul
f5f7c25401 Merge "Remove hacking rules for python 2/3 compatibility" 2020-06-18 16:12:08 +00:00
Zuul
63a03d8481 Merge "libvirt: Mark e1000e VIF as supported" 2020-06-18 13:20:17 +00:00
Zuul
6ed556f4ad Merge "libvirt: Don't allow "reserving" file-backed memory" 2020-06-17 12:41:46 +00:00