One of the coordination unit tests fails because of a mock that's
being applied twice. This affects Python 3.10 in particular.
We're addressing the issue by disabling "MOCK_TOOZ" for that
specific test.
Change-Id: If02f7ad022679d74cb88f558b85ee7d22f253c77
The "destroy_secrets" argument has been added to the "destroy" and
"cleanup" driver methods [1]. At the moment, it's only passed by the
Libvirt driver, so this interface change didn't break our driver.
At the same time, the "needs_legacy_block_device_info" property has
been removed [2].
[1] I856268b371f7ba712b02189db3c927cd762a4dc3
[2] I3895b61b436b9bb882477d2d1b3f4907f03b3b1c
Change-Id: I62b45bb8c3677e0117cbe2d86764ebb904deac90
We're no longer maintaining the Windows OVS port.
Normally, we'd go through the standard deprecation policy but
since the Neutron OVS agent no longer runs on Windows at all since
Wallaby, we're dropping it right away.
Change-Id: I54c681c29c80f1d537e38980f68717b72f6b215b
The lower constraints job is failing as Nova has bumped the
oslo.config minimum requirement. We'll do the same.
The nova conf fixture has been moved so we'll have to pick that up
as well.
Change-Id: I1907982ca8ffc81b2529af22a9a6fd4a55aecafb
Shelved instances are snapshotted and then uploaded to Glance.
Once unshelved, the Glance snapshot is removed, so there's no
reason why we should cache it. Furthermore, at the moment
unshelved instances can end up using the wrong image reference,
for example when being migrated.
This change will avoid caching the base image when the instance
is being unshelved.
Closes-Bug: #1907216
Change-Id: I09a0fccdabdc7a41211e364258ca243128784b55
Ceph 16 (Pacific) will support attaching RBD images to Windows
hosts as well as Hyper-V VMs [1].
This patch updates the Hyper-V driver so that it may be able to
consume RBD volumes.
os-brick patch: I56bf09cbd40679eefa5e378c9b36383de89e980c
[1] https://github.com/ceph/ceph/pull/33750
Implements: blueprint rbd-volumes
Change-Id: I726e426a7274d7c9c6a878afddd23a20ce222a33
The InstanceMetadata constructor has been updated by
Ie27fd6a5513e53903b9acd5d63038b3b484acbde. The "request_context"
parameters was dropped, so we have to stop passing it.
Change-Id: I80bc28f57862f420c9da01839fbfa00902f45da0
The Msvm_VirtualSystemSettingData object associated with a VM has a
field named "ChassisAssetTag". The value set in this field is reflected
in Linux VMs in /sys/class/dmi/id/chassis-asset-tag. This value is
checked by cloud-init in order to figure out if it is currently running
inside an OpenStack VM.
The verification above has been introduced in cloud-init [1] in order to
avoid costly metadata probes that aren't needed in non-OpenStack VMs.
Setting the ChassisAssetTag will allow us to pass these checks. The
value we are setting is similar to what libvirt is setting in the
LibvirtConfigGuestSysinfo.
[1] 1efa8a0a03
Partially-Fixes: #1895976
Change-Id: Ib9f605f68c79ff41d3959c7a1662a9e644fde946
Depends-On: 33e6c07dab4b46442bf0fbb838d59516112899b9
A recent patch[1] updated the 'unrescue' signature, adding a context
and dropping the 'network_info' parameter.
We'll need to pick up this change.
At the same time, we're re-adding the mock dependency. We're re-using
some of Nova's fixtures and other test helpers, which still use the
3rd party mock lib: [2].
[1] Id5e4b0f26d5a2a93db6a7d96555a2cff29d9a2cfre
[2] http://paste.openstack.org/raw/796530/
Change-Id: I0d46c4df4982e62ff81285a141c8b71bf06bcf15
Windows paths are case insensitive. Furthermore, Hyper-V even
flips the casing in some cases.
For that reason, we have to ensure that our path comparisons
are case insensitive.
Change-Id: I4cb059c6bdcb09f7e0c3217fe34654c8e197b67d
Closes-Bug: #1878579
The monotonic package was needed for monotonic time operations when
running under Python runtimes older than 3.3. Since we now only support
versions higher than this, this third party package requirement can now
be removed.
Change-Id: I0cb0339c5e681b63783828cfde9921dfd6727f50
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
As part of a bug fix, Nova is now passing resource allocations to
"finish_migration".
Change-Id: I8323ee22c1c71a9fee04701f62759c57d5182fe3
Depends-On: Ifd76289964d513e9544544e5787f5f8999589475
We can now use the standard library mock library instead of the third
party one previously needed for py27 compatibility.
Change-Id: I51f48421ac90209302de43b70ef9176195be0743
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Remove local vi check, hacking test H106 covers this now.
Remove hacking and friends from lower-constraints, they are not needed
to be installed at run-time.
Change-Id: Id87f8b2d81583a7a67ee1a81c78d3ae40c579c70
A few driver methods now accept the accel_info parameter. This
change updates our driver interface accordingly.
Change-Id: Id65cd3b8154b7aa9a6b5f4859ee0de1e53cb24d1
nova.image.glance.API should be used instead of nova.image.API,
as per this change: I7ca7d8a92dfbc7c8d0ee2f9e660eabaa7e220e2a
Change-Id: If228ed3bd7bd80d94434ff8abc387a7ea20aeaa1
Nova defines a config option that allows limitting concurrent
image operations. This behavior is disabled by default.
The threshold is enforced using a semaphore, which we're now going
to use.
As opposed to the libvirt driver, we're not applying the semaphore
when merging differencing images since that would have a larger
impact on the hyper-v driver (e.g. when resizing legacy vhd images,
when deleting temporary snapshots, etc). For now, we're using it
only when downloading or uploading glance images.
Change-Id: I74ecf4b343428c71aad77b049faa5d2382e88dc8
blueprint: io-semaphore-for-concurrent-disk-ops
This change adds the driver method required for pre-caching Glance
images.
Change-Id: I9cc5d2c4533f17261f2d7facd67531014453b122
blueprint: image-precache-support
The Neutron API class has been moved as part of the nova network
deprecation. We'll have to pick this up in compute-hyperv.
Change-Id: I19eae24317c0ccaa470d3711e943c612b36b1740
While dropping Python 2.7 support, the upstream project has been
updated, so we'll have to move the templates in-tree.
While at it, we're updating the supported Python versions.
Some Nova fixtures have been moved to oslo.test, so in order to be
able to unblock the gate, we'll have to squash those fixes as well.
For the same reason, we'll have to remove nova-network checks, which
has been completely dropped.
A few options have been moved to a separate config group, which
we'll have to take into account.
Change-Id: Ibce6b062a81200611bcaac3f2cb90b14b559375b
This method now accepts a mapping between port ids and resource
providers as per I220fa02ee916728e241503084b14984bab4b0c3b.
We'll need to figure how exactly should this dict look like.
Meanwhile, we'll just pass "None", which Nova seems to accept
for backwards compatibility reasons.
This is a temporary workaround meant to unblock the gate. It will
have to be properly handled by the time we release Ussuri, otherwise
we won't be able to support port QoS.
Change-Id: I878eab9615a76edab0f8ae5bb0d16652baae473a
Partial-Bug: #1845480
We log a warning when detecting a failover for which the destination
host matches the one that's already set in the Nova db. Some times
this means that instance bounced between hosts but most of the times
this is just a migration initiated by Nova, which already updated
the DB.
While at it, when the driver initializes, we'll log the list of
detected failovers before asynchronously handling them.
Change-Id: I808c8cb63ac0011be8d6824a2f8e9292fe39004f
At the moment, the "init_host" method initializes the distributed
lock mechanism, yet the driver may try to use distributed locks
before that.
For example, the method that reclaims failed over instances is
called by the driver init method, before init_host. While we
can fix this particular call, it's safer that we initialize the
lock mechanism as early as possible.
Change-Id: If361c0f754d3680726762e3126286227bea6f3f3
Related-Bug: #1841777
At the moment, the driver won't handle instances that were failed
over while the service was down. This is due to a regression,
the method doing this isn't called properly.
Closes-Bug: #1841777
Change-Id: I4ecf916b1d3323077646a38b9491785accb3c87c
OVS ports can become invalid after the instances are failed over.
If an instance lands back on the initial host and the ports are
not cleaned up, it will be left with those stale ports.
This change adds a config option, allowing those ports to be recreated.
It will be enabled by default. Deployers may consider disabling it
if the remaining ports are cleaned up when rebooting nodes or if the
network backend is not affected by this issue.
Closes-Bug: #1841778
Change-Id: I58aba53b7bc0a5e8954cf31adac6e7e106944b7e
Most users expect that if a live migration fails but the instance
is fully recovered, it shouldn't enter 'error' state. Setting
the migration status to 'error' should be enough. This simplifies
debugging, making it clear that the instance dosn't have to be
manually recovered.
This patch changed this behavior, indirectly affecting the Hyper-V
driver: Idfdce9e7dd8106af01db0358ada15737cb846395
We'll stop propagating exceptions when managing to recover the
instance, which matches the reference driver (libvirt) behavior.
Change-Id: I4b667c06e008b03457d35ce9c920b916d21c255f
Closes-Bug: 1841411
Allocations committed against the destination host are not reverted
during live migration rollbacks. The reason is that we're not passing
the migrate data object properly.
At some point, the rollback callback signature has changed. We picked
it up but only for the main (non-cluster) driver:
I5f247d733642464f4ede0430d4dfc8a27a02e7fd
This change addresses the cluster driver as well.
Change-Id: I8c509d411b8fdf7e65622f1fbb2095fe9c3b98b5
Closes-Bug: #1841068
spawn() now accepts the "power_on" flag, allowing instances to be
created without being turned on. This is part of the cross-cell
migration workflow.
Change-Id: Ifd18a69f476ebbfb4ee6ec34abb03da0d2e30ceb
finish_revert_migration() now accepts a migration object and
estimate_instance_overhead() has been dropped.
Change-Id: Iddd6c2cad1e6f94b1904e1f1196f6c7dee1b2f99
VHD and VHDX are the only image formats currently supported by the
Hyper-V driver.
This change updates the driver capabilities accordingly, which will
then be advertised through traits.
Related to blueprint request-filter-image-types
(cherry-picked from I193a3e32c6d99493fe76608ef0b1b9fe1bbd5422)
Change-Id: If4c8db2d51dbdc85a4d8b6782354a9f68987e7cc
For now, we'll just set the available ram, disk and vcpus.
This will allow allocation ratios to be set at the placement
inventory level. At the same time, driver capabilities will be
exposed through traits.
Once #1784020 is addressed, we may skip reporting shared storage
capacity.
We're also skipping CPU features for a couple of reasons:
* there are just a few features defined by os-traits, yet even
fewer exposed by Windows APIs. One option would be to call cpuid
to get a more exhaustive list of features but that would require
a C Python extension or separate executable.
* we can't tell for sure which CPU features will actually be exposed
to the guest, especially when limiting guest CPU features in order
to support live migration in heterogeneous deployments.
Change-Id: Ibfb879751bba038054ba7852dc49f6d9e67027d6
The 'move_disks_on_cold_migration' config option is currently
defined in migrationops.py instead of conf.py, for which reason
it's not included in the generated documentation.
This simple change will move it next to the rest of compute-hyperv
config options. While at it, we're adding a help string.
Change-Id: I762156dea8d32bdc13716b88821ed7495e705607
* driver.get_info received a new argument, which we don't use.
The good news is that the manager expects a TypeError
* driver.extend_volume now accepts the new volume size
* the driver shouldn't set the 'is_public' image property when
taking snapshots. This is already handled outside the driver
* missing whitespace between words in log message
* avoid using utils.execute, use processutils.execute
* update os_win utils "auto-spec" helper (we're relying a bit too
much on os-win internals, which meanwhile have changed)
* nova dropped the helper method that was merging allocations so
we'll have to include it in compute_hyperv. Note that we only
use it for the cluster driver.
Change-Id: I0b59a118764421ec9daba3f3732f45ec9cb7287b
When reverting resizes, the manager will request instance files
cleanup to be skipped if the hosts use shared storage, in which
case we'd leak files if multiple CSVs are used.
It's safe to cleanup the instance files when reverting resizes
as long as we preserve the "*_revert" dir.
Closes-Bug: #1805833
Change-Id: I09428c2e25bed41f99b51c08a677d7152d9680ee
When taking instance snapshots, the image format is always set to
"vhd", but it may as well be vhdx. This happens because of legacy
reasons, as Glance used to reject vhdx images.
Cinder started to validate the image formats a few releases ago for
security reasons, so it will reject creating volumes from Glance
images that have incorrect image formats.
This change ensures that we'll set the right image format when taking
snapshots.
Closes-Bug: #1805442
Change-Id: Ie151ed15bc806e0c16a363734d0c078fe358b899
We can now pass request ids and consumer generation ids, which
can detect race conditions that affect allocation updates.
Change-Id: Idccf7aeeecc619871b27e16c68f0706c1514c63b