Skip creating the formatted log message
if the message is not going to be emitted
because of the log level.
TrivialFix
Change-Id: Iba9f47163a0ac3aca612818272db6d536b238975
Hyper-V / Windows related constants have been moved into os_win.constants
and they should be used instead.
SMB related utils have been moved from pathutils into smbutils.
Metrics related utils have been refactored into metricsutils.
Change-Id: I7007f77f51755cf3f8ab85402d39f10d7af749b1
Add options from 'virt.driver'. These options are part of the
'DEFAULT' group but are included in the "nova.conf.virt" file in hope
that they can eventually be moved to their own group.
Change-Id: Icf6084c156c4990ac60c778c28a48ae5ab97273a
Implements: bp centralize-config-options
Adds os-win to requirements.txt.
Replaces the current usage of *Utils classes in the
Hyper-V Driver with the equivalent *Utils classes
from os-win.
Adds decorators to the HyperVDriver methods that prevent
os-win specific exceptions to leak outside the driver.
Depends-On: Id5cd1dce195b38611f4f8c74857087620048b13f
Co-Authored-By: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Partially Implements: blueprint add-os-win-library
Change-Id: I04509843210dcedf98a0cd9e08fa07865c8a76de
The exceptions raised in the HyperVDriver are too generic.
This commit addresses this issue.
Partially Implements: blueprint add-os-win-library
Change-Id: I05f1fa21540dad36bb4b04c8eebe8cc0b8585c1f
Neutron events have been added to nova. If the event
"network-vif-unplugged" is received, the nova compute manager
will proceed to call the compute driver's detach_interface method.
The mentioned method is not implemented in the HyperVDriver,
causing errors.
On Windows Hyper-V / Server Threshold (kernel version 10.0), vNICs
can be attached / detached while the VM are running, if the VM
is generation 2.
Adds attach_interface and detach_interface method implementations.
Co-Authored-By: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
Closes-Bug: #1486410
Change-Id: I6e0f6a8373810560ae2fadc99b7dd57c06391c96
Instance destroy and Instance snapshot are locking operations, meaning
that they can only occur sequentially. This is the result of the commit
6d8903b5d9
The problem is that the destroy instance can occur before snapshoting,
resulting in a VM NotFound exception being raised while snapshoting, as
the VM no longer exists. In the logs it can be observed that the lock was
being held by "do_terminate_instance", which was then aquired by
"instance_synchronized_snapshot".
Nova ComputeManager expects an InstanceNotFound exception during the
snapshot operation.
Changes exception raised by VMUtils._check_lookup_vm to InstanceNotFound.
Change-Id: I3e4d4f1874c6ee4b410e8bda7412d49f079b5b8f
Closes-Bug: #1486458
Convert the hyperv driver and related files to make use of
the nova.objects.ImageMeta object. Where an image_meta
dict is passed in via the virt API, it is converted to
object form before being used.
Change-Id: I673cb728b57419f68c6369c5f0f3351cbe5f65bf
When trying to delete an instance that has a pending operation,
i.e. creating a snapshot, Hyper-V will raise the following excention:
HyperVException: Operation failed with return value: 32775
Code 32775 means "Invalid state for this operation". This means
that the delete operation cannot be performed while there is
another operation pending.
This patch fixes this problem by requesting all the instance jobs
and killing them right before the delete operation.
Closes Bug: #1461970
Change-Id: I0e3fca20981e1080814224b8cee7cea5b8c6a53f
Instance boot from volume fails in Hyper-V if the flavor has ephemeral
disk.
This happens because Hyper-V tries to attach both the ephemeral disk and
the boot volume to the same slot on the IDE controller.
This fixes the bug by making sure that the ephemeral disk will always
attach to the second slot.
Change-Id: Id6772b75683528db765241d21e25fba55358afb7
Closes-Bug: #1479129
fileutils is graduated in the oslo.utils library.
Remove old implementation of the read_cached_file function
in the nova.utils and move from the fileutils the read_cached_file
and delete_cached_file functions to the nova.utils module and
the unit tests for these functions.
Implements: blueprint graduate-fileutils[1]
[1] https://blueprints.launchpad.net/oslo-incubator/+spec/graduate-fileutils
Depends-On: I51ba9076e1fbc16145ee2311f47b7768c16dcb20 (requirements)
Change-Id: I849f1c74ec811dbe82ba6270569a008a49eab465
This reverts commit def785a23d.
As discussed at the nova liberty mid-cycle, we still have concerns about
how this was implemented. We've also talked through an alternative
implementation (generate the config drive to a directory and then just map
that directory into the container).
I will work on the changes needed on the config drive site to implement
that now, and will help the PCS guys integrate that with their code.
Change-Id: I7106e9bf367e0d392566cf5271ae52fc1595284e
At the moment, the only way the Hyper-V handles unexpected power
state changes is via the manager periodic task. The issue is that
unexpected instance reboots are not handled at all.
After an instance is stopped, suspended or paused, the console log
workers are stopped as well as the serial console pipe is closed.
Those workers are never restarted unless a power change is triggered
by the manager.
This patch proposes an instance state event listener, emiting events
that can be handled by the manager, similar to the Libvirt driver
workflow.
Change-Id: Ia0a875707a7a37224efb333feab1503e83449cc4
Closes-Bug: #1428505
Modules eventlet_backdoor, loopingcall, periodic_task,
service, sslutils, systemd, threadgroup were removed
from nova. These modules were imported from oslo.service
library.
Co-Authored-By: Marian Horban <mhorban@mirantis.com>
Depends-On: I305cf53bad6213c151395e93d656b53a8a28e1db
Change-Id: Iaef67e16af3d69f845742f7bdcb43667bf1576ee
With this change, we're defining new setup methodology
for container based virt (parallels now, and in future LXC too).
In such environments the *host* container technology will be
responsible for mounting the config drive image inside the guest
filesystem. So when the guest image boots, it will see the config
drive data immediately at the location defined by cloud-init.
The only demand for existing images is having cloud-init turned on.
To support config drive in Virtuozzo (former PCS) containers,
we use ploop block device. Actions with ploop device are performed
via ploop CLI tool and newly created device is mounted into
/var/lib/cloud/seed/config_drive on container's filesystem.
This destination recognised by cloud-init as a source of data.
(Ploop device description: https://openvz.org/Ploop)
Co-Authored-By: Maxim Nestratov <mnestratov@parallels.com>
Change-Id: Ib21ab954a08027fb1f2aec13c2d95b5f080eccce
Implements: blueprint config-drive-support-for-virtuozzo
Hyper-V exports VM serial ports via named pipes. At the moment,
the Hyper-V driver uses workers running in separate threads in
order to consume those named pipes.
This patch set ensures that there is only one worker spawned for
each instance. This is required as the depending patch introduces
an event listener which spawns a log writer when an instance is
powered on or rebooted.
Change-Id: I52cae85b6b79256e7e28813ca2f43976fa301798
Sets the path for the instance's ConfigurationDataRoot,
LogDataRoot, SnapshotDataRoot, SuspendDataRoot and
SwapFileDataRoot for vmutilsv2 instances and
ExternalDataRoot and SnapshotDataRoot for vmutils
to the instance's location.
Closes-Bug: #1430239
Change-Id: I3c9e2dece00df06cafdcd164ece6269337feda71
This bug was introduced due to an oversight when fixing
https://launchpad.net/bugs/1322096 . In that fix, we use the
"config_drive_cdrom" value from the conf to determine if a
there is a iso configdrive attached to the instance. This
approach is wrong due to the fact that that config value can be
modified by the user. If that happens, instances that still have
iso configdrives will be ommitted.
This path fixes this problem by checking the instance itself if
it has any iso attached to it.
Closes-Bug: #1427467
Change-Id: Ia64389b4405109d7db6fbf9c000a0136e9862298
Fix modules under nova/virt/hyperv to use instance objects
with the field access dot notation everywhere. Essentially we use
instance.key instead of instance['key']. Needed to rework some of
the test cases to get them working.
Co-Authored-By: Mike Durnosvistov <mdurnosvistov@mirantis.com>
Change-Id: I6c500513d9ec95cc03235d3848e93a169a11b29c
Convert the use of the incubated version of the log module
to the new oslo.log library.
Sync oslo-incubator modules to update their imports as well.
Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: Ic4932e3f58191869c30bd07a010a6e9fdcb2a12c
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
This commit includes:
- using oslo_utils instead of oslo.utils
- using oslo_serialization instead of oslo.serialization
- using oslo_db instead of oslo.db
- using oslo_i18n instead of oslo.i18n
- using oslo_middleware instead of oslo.middleware
- using oslo_config instead of oslo.config
- using oslo_messaging instead of "from oslo import messaging"
- using oslo_vmware instead of oslo.vmware
Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
The Hyper-V driver is not properly handling static IP configuration
injection when flat_injected is true and networks don't have DHCP
enabled. This commit fixes the issue.
Change-Id: Ie54f1c892f1db53b1807661acacbae5bd45c0777
Closes-Bug: #1400069
Introduces Hyper-V generation 2 VMs support in the Nova Hyper-V
compute driver.
Hyper-V Server 2012 R2 introduces a new feature for virtual machines
named "generation 2", consisting mainly in a new virtual firmware
and better support for synthetic devices.
Operating systems supporting generation 2:
* Windows Server 2012 / Windows 8 and above
* Newer Linux kernels
Co-Authored-By: Simona Iuliana Toader <itoader@cloudbasesolutions.com>
Partially implements: blueprint hyper-v-generation-2-vms
Change-Id: I3a56be74fd49ac845ef8f05d2a3dac93edf8ac78
Due to a small nit, the VM console log files are not copied properly
during live migration.
This patch fixes the issue, removing as well two unused arguments.
Closes-Bug: #1399127
Change-Id: I530e18adc0794873de45e6232abdd093f82f82fe
Currently, the Hyper-V driver supports attaching volumes only via
iSCSI. This patch adds support for attaching volumes using VHD or
VHDX images hosted on SMB shares.
Note that the according Cinder drivers which allow exporting
images through SMB shares have been already merged.
The workflow is simple: using the connection info, the driver
chooses the right volume driver, mounts the according SMB share
using the according credentials. The only thing that needs to be
done next is actually attach the volume to an instance using its
UNC path.
Change-Id: Id5de0e6843c1035235598a4d72a00b7555187fb4
Implements: blueprint hyper-v-smbfs-volume-support
oslo.concurrency-0.3.0 has moved its path to oslo_concurrency,
the old path oslo.concurrency can still work but is deprecated now.
Change-Id: I1538dad5cbacf1e6041c571d5bc55994689c08b0
Closes-Bug: #1398656
Hyper-V Server 2012 R2 introduces a new feature for virtual
machines named "generation 2".
Generation 2 VMs don't support IDE devices, meaning that VHDs
and DVD Drives must be attached as SCSI, instead of IDE.
Since the Virtual Hard Disks and Virtual CD/DVD Disks can be
attached to IDE controllers or SCSI controllers (generation 2
only), some constants, variables and methods have been
improperly named, having the IDE prefix.
Partially implements: blueprint hyper-v-generation-2-vms
Change-Id: Ic281d7548dfe6b2f65290f687ea0ca694db1a4d0
oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack
There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages
Added a hacking rule for the log exception about checking
translation for it.
Change-Id: If80ea6f177bb65afcdffce71550bb38fedcc54eb
oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack
There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages
Added a hacking rule for the log info about checking
translation for it.
Change-Id: I96766d723b01082339876ed94bbaa77783322b8c
When using differencing vhdx images, one will be created pointing
to the base image when a VM is spawned. This image will be created
having the according flavor size.
In this case, due to a Win32 API issue, the image is not generated
properly.
Simply creating the root image with no size specified and resizing
it afterwards fixes the issue.
Change-Id: I7bb46a63d4c2a06ed6f63c839461cbbc1abffa65
Closes-Bug: #1370531
This ensures that all drivers and the compute manager make use of
the instance info object and do not pass around random dictionaries.
Complete the blueprint instance-info-objects
Change-Id: Idab57d33e8612fcf40f54f73d5f73d813629bddf
Let's switch to the newly released oslo library for the
processutils and lockutils. We use the config fixture(s) to
specify disable_process_locking and lock_path in the CONF
variable of oslo.concurrency library for correctly setting the
flags.
The previous attempt at updating nova to use oslo.concurrency
was reverted as it stopped running any tests. lockutils-wrapper
should have been used in ini/shell scripts
instead of lockutils.py module as the the module is
no longer runnable (__main__ has been removed). In this
review we use lockutils-wrapper correctly. The test harness
has since been updated to bail out if 0 tests are run as
well for additional insurance.
Change-Id: I14c75ef2196fd08c9465d648e5cd53777bd9c7d1
Co-Authored-By: Nikola Dipanov <ndipanov@redhat.com>
Co-Authored-By: Corey Wright <corey.wright@rackspace.com>
This patch made unit tests stop running (always runs 0 unit tests) we
should revert and put a check in place to prevent that from happening
so that we don't regress the rest of Nova trying to figure out the
oslo.concurrency issue.
This reverts commit 382294762b.
Change-Id: I98b04ac2a0ba67ba8af44867799317fdf95b8aff
As most of the Cinder volume drivers that use iSCSI export one LUN
per iSCSI target, the Hyper-V driver was logging out the according
target each time a volume was disconnected.
This causes issues with some volume drivers that use multiple LUNs
per iSCSI target and may disconnect in-use targets.
This patch fixes the issue by checking if there are other LUNs
being used, disconnecting the iSCSI targets otherwise.
Change-Id: Ida08e7129a7b7940ddea488488cccc7571a43b76
Closes-Bug: #1372815