Commit Graph

465 Commits

Author SHA1 Message Date
Tony Breeds cc877dec6d Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: Ied3613a9c0bcd2394825d18fdfc92dd8b7b0431b
2017-09-12 16:09:15 -06:00
Jenkins aced6a97f9 Merge "Update log translation hacking rule" 2017-07-21 11:35:57 +00:00
Jenkins e5be121297 Merge "clusterutils: Adds clustering configuration options" 2017-07-21 11:33:35 +00:00
OpenStack Proposal Bot 2cfbe1f1d1 Updated from global requirements
Change-Id: Icaffd99c8d7ac08cb83d2e45bb266bdf836df638
2017-07-14 15:48:21 +00:00
Claudiu Belu 55ffa25b7a clusterutils: Adds clustering configuration options
Adds the following arguments to the add_vm_to_cluster method:

* max_failover_count - the maximum number of failovers that can occur
in the given failover_period. Once a VM's number of failovers reaches
this number, the VM will simply end up in a Failed state.

* failover_period - the number of hours in which the given max_failover_count
failovers can occur.

* auto_failback - allow the VM to failback to its original host once it is
available.

Change-Id: I2af82c8ecf3bee2e2f2161976d75123f8a0c89e9
2017-07-14 14:37:22 +00:00
Claudiu Belu 2fc52c6143 Adds releasenotes configuration
Adds the necessary bits for the reno support.

Change-Id: I1017ff4a10da2279f2c49f9563f537e664121fe2
2017-07-14 03:04:52 -07:00
Ngo Quoc Cuong 7b30162965 Update log translation hacking rule
Starting with the Pike series, OpenStack no longer supports log
translation.
Update hacking rule to prevent log translation in all log level instead
of only debug level.

Since all log translations are invalidated, check_explicit_underscore_import
can be simplified.

Change-Id: I5bd3a155c685821cfddf17f741083a267a8f7114
2017-07-05 00:39:00 -04:00
Jenkins 88db49ebf8 Merge "vmutils: Planned VMs separation" 2017-07-04 11:08:45 +00:00
Claudiu Belu 6772315353 vmutils: Planned VMs separation
A Planned VM and a Realized VM cannot exist at the time on the
same host, The 2 types must be treated separately.

vm_exists will only check if the Realized VM exists.
planned_vm_exists will only check if the Planned VM exists.
destroy_planned_vm will only destroy the planned VM, if it exists.

Related-Bug: #1604078

Change-Id: I91636a82b057f566eab9887c422911163668f556
2017-07-03 11:14:53 +03:00
Adrian Vladu c6e3c9ef63 Fixed all typos in comments
Change-Id: I37ae75a438f6fd326101c7b8a855c1f39dd2f644
2017-07-02 19:12:14 +03:00
Jenkins b5ee321a09 Merge "Adds config option for caching WMI objects" 2017-06-29 10:47:55 +00:00
Claudiu Belu a8b12dc93d Adds config option for caching WMI objects
networkutils currently caches WMI objects for performance reasons,
but it should be optional.

Adds cache_temporary_wmi_objects config option (default is True), which
enables or disables caching in networkutils.

Closes-Bug: #1693321

Change-Id: Id3aad3837d13a9c58c8a2898d594d412a42cd00c
2017-06-29 09:27:55 +00:00
Lucian Petrut 986c45dfe3 Retry changing VM state in case of exceptions
We're getting a considerable amount of transient errors when
attempting to change a VM state (e.g. when pausing it).

Since this operation is idempotent, it's safe to just attempt some
retries.

Change-Id: Ic24fd282c897594fb67a45124e31b374e4e2dd4b
Closes-Bug: #1694661
2017-06-29 09:15:32 +00:00
Jenkins 94cf307c1d Merge "Improve WMI job check method" 2017-06-29 09:07:24 +00:00
Lucian Petrut c4e5823205 Improve WMI job check method
At the moment, we're raising a HyperVException when a WMI job fails.
The issue is that this doesn't include the job status or error code
as attributes, which is troublesome when we need to have exception
handling logic relying on that.

This change adds a new exception that will include those fields,
also simplifying the WMI job status check method.

Note that although WMI jobs are not necessarily Hyper-V related,
we're inheriting HyperVException as that's what Nova expects at the
moment.

Also, we're now following the same logic as the HyperV PowerShell
module in terms of checking a WMI job state. States such as
"CompletedWithWarnings" (32768) will now be gracefully handled,
instead of throwing an exception.

Another thing to note is that we're now always treating the
'Exception' job state as a final state.

Partial-Bug: #1694661

Change-Id: I498281d3af673e4e6ac3adc2fb1a566efaba9d4e
2017-06-28 22:01:03 +03:00
Jenkins 94222ff769 Merge "Wrap "WMI not found" exception" 2017-06-28 16:48:21 +00:00
Lucian Petrut 6411f25f5a Wrap "WMI not found" exception
There are situations in which a VM unexpectedly disappears while
we're trying to perform an operation on it. Raising an appropriate
os-win exception in such cases helps os-win consumers perform
appropriate error handling.

This change adapts the decorator translating such exceptions,
using it for the 'get_vm_summary_info' method. This will help Nova
properly handle the case in which an instance is deleted while an
instance lifecycle event is checked.

Related-Bug: #1653862

Change-Id: I6930ed9df9a79e4f8f01bb96ce6dd942fd4760f8
2017-06-28 16:38:22 +03:00
OpenStack Proposal Bot d79b7b60e9 Updated from global requirements
Change-Id: I92703c94947c9ad7237af062ee937d6cb9e8337c
2017-06-27 12:19:46 +00:00
Jenkins 5d4165583a Merge "Add hacking rules for ctypes libraries" 2017-06-23 16:13:08 +00:00
Lucian Petrut f854fc1402 Add hacking rules for ctypes libraries
We enforce any dll used via ctypes to have an according module
defined in os_win.utils.winapi.libs.<lib_name>, containing
definitions for the argument and return value types of each
function used throughout os-win.

Some of the hacking rule unit tests boilerplate was *borrowed*
from Nova.

Related-Bug: #1693258

Change-Id: Ia8d014a2b4a93cb74024233823bf33335e529e43
2017-06-23 17:17:21 +03:00
Claudiu Belu 8b0babf131 tests: Sets baseutils.BaseUtilsVirt._old_wmi
There is a race condition between tests, and because
the _old_wmi is not set, it will try to load it, but since it
is mocked, it cannot, and it shouldn't.

Change-Id: Id029baf2e72f7b67eb6af3b3e66f998b902fd412
2017-06-23 02:52:11 -07:00
Jenkins ff86810181 Merge "Refactor Windows API usage" 2017-06-22 11:33:14 +00:00
Lucian Petrut 235309573a Refactor Windows API usage
This change moves all the constants and structures extracted from
Windows headers to a separate module. We're adding one submodule
for each foreign library that we're using, which will also contain
the according structure definitions.

This change also ensures that we set the ctypes functions argument/return
value types for the foreign functions used throughout os-win. For this
reason, some structures were updated, also having any initialization logic
being pulled out. Some function call arguments changed in order to match
the function definitions.

Closes-Bug: #1693258

Change-Id: If355ad2c33aa085388c052de6082359e144e517d
2017-06-22 13:04:43 +03:00
Jenkins f48f01f47b Merge "raises exceptions.NotFound instead of x_wmi: Not Found" 2017-06-20 14:45:26 +00:00
OpenStack Proposal Bot 6cd0d4a6a4 Updated from global requirements
Change-Id: I6fd933b721c0576420b9558915426f6685f5af3f
2017-06-19 05:45:24 +00:00
Jenkins 9669e0720d Merge "Fixes cached old WMI service objects issue" 2017-06-16 13:32:13 +00:00
Jenkins 1585ed9766 Merge "Add 'rm -f .testrepository/times.dbm' command in testenv" 2017-06-14 10:31:57 +00:00
Claudiu Belu 49a012e83c Fixes cached old WMI service objects issue
When using WMI, the resources passed to the
Msvm_VirtualSystemManagementService are not cleaned up
by the garbage collector if the Service object is still
referenced (cached as a property in BaseUtilsVirt).

PyMI doesn't have this issue, so the Service objects can be
safely cached.

This issue only affects Windows / Hyper-V Server 2012.

Change-Id: If8df0bf0a2f13a9e94993dde8b2a18943f2e9f83
Closes-Bug: #1697389
2017-06-14 02:19:39 -07:00
Claudiu Belu 4f6176ae31 raises exceptions.NotFound instead of x_wmi: Not Found
When an instance is being rebuilt, or shelved and unshelved, the VM gets
destroyed and recreated, keeping the same neutron port. If a reference to
a non-existent object is passed to a WMI method (or no longer exists), an
x_wmi: Not Found exception is raised.

Adds decorators to the jobutils methods, which will reraise
os_win.exceptions.NotFound exceptions instead of the x_wmi: Not found
exceptions.

Change-Id: Ic371cd1e2c2a54c4f386c02557bc9cdd9518bc9b
Closes-Bug: #1694432
2017-06-13 06:28:49 -07:00
OpenStack Proposal Bot ad2be4739c Updated from global requirements
Change-Id: I7c72ed56bf6bfdc135693fabf7e38af613e2011a
2017-06-10 13:35:01 +00:00
OpenStack Proposal Bot c53d28735a Updated from global requirements
Change-Id: I3835f605c89adeb9c1acb5278c99ccab46f62ef7
2017-06-02 02:34:37 +00:00
OpenStack Proposal Bot 960cfbd25f Updated from global requirements
Change-Id: If98c38073678b9aced1010cbd9f96bbd9b9109e9
2017-05-15 00:52:30 +00:00
rajat29 1eb9cc77ae Add 'rm -f .testrepository/times.dbm' command in testenv
Running py2* post py3* tests results in error. Add
'rm -f .testrepository/times.dbm' command in testenv to
resolve this.

Change-Id: I7bede2ca96cc4ca0b36460b8aeac3e5540d91751
2017-04-25 10:28:58 +05:30
Claudiu Belu aa3fbc7512 networkutils: specializes the exception raised by _get_vnic_settings
VMs can be destroyed before their vNICs had a chance to be bound.
When trying to bind a vNIC of an already-destroyed VM, os-win will
raise a HyperVException.

This patch specializes the exception raised in this case, allowing
consumers to treat this case differently.

Change-Id: I8fabe8799d0e57dcc5627d67b3962c4f11f08f1e
Closes-Bug: #1684045
2017-04-20 13:24:26 +03:00
OpenStack Proposal Bot 38287d5d70 Updated from global requirements
Change-Id: I8cb05099d481bf7488c7f21affa8791032b63cac
2017-04-13 20:26:45 +00:00
Lucian Petrut acbcb555bc Add cluster vm owner change listener
At the moment, we expose a method which will fetch cluster vm owner
changes one by one. One issue is that this relies on a PyMI event
listener that's setup when instantiating a ClusterUtils object,
so we're ending up running multiple unused event listeners.

We're now adding an event listener similar to the one used for
VM power state change events, while preserving backwards compatibility.

The goal is to improve the event handling workflow, considering that
the compute-hyperv Nova driver is currently waiting unnecessary time
between those events.

Change-Id: Iceabc3636b5ceb37b20bfe55330ad996e3546113
2017-04-13 14:08:17 +03:00
Jenkins a38faf547e Merge "Remove log translations" 2017-04-12 12:54:46 +00:00
Claudiu Belu f9787c804e pep8: fixes indentation issues
pep9 can fail because of the wrong indentation of some
closing brackets in test_clusapi_utils. This fixes the issue.

Change-Id: Ib52883642b019f68b88dcf3c07ea4c9dab2e5817
2017-04-12 03:34:42 -07:00
D G Lee 64c2518a7a Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Icf0c6173e81bddc42f33796e89607e8dab985f52
2017-04-11 16:02:14 +08:00
M V P Nitesh 5ff09ffff6 Optimize the link address
Use https instead of http to ensure the safety

Change-Id: I54cecdf86d435bbeb7aedf194597579a72253951
2017-04-10 12:15:09 +05:30
Jenkins 662b1c2c38 Merge "Replacing six.iteritems() with .items()" 2017-04-07 12:50:40 +00:00
rajat29 a959a4b8f3 Replacing six.iteritems() with .items()
We should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will be more readable.

Change-Id: I9a94f54f5f86e8f2de9a439e64bdcd8ece6c82db
2017-04-07 15:02:59 +05:30
OpenStack Proposal Bot 1c7e2e84c9 Updated from global requirements
Change-Id: Ifff29affc1fe7c148033054baaf051616e18e519
2017-04-07 06:14:27 +00:00
Lucian Petrut 54d97f2477 Fix share local address check
We're resolving share addresses to determine if those point to a
local address. The issue is that we fetch the local ips resolving
the local hostname, which won't include '127.0.0.1' or '::1'.

For this reason, a share such as '\\localhost\share' won't be
reported as being local.

This change handles this case.

Closes-Bug: #1680029

Change-Id: I36df4aa79bb7af548b6e39f9f9e7c4f979ae0a77
2017-04-05 14:29:10 +03:00
Jenkins 033bba1c52 Merge "pathutils: Adds copy_folder_files method" 2017-04-04 13:41:23 +00:00
Claudiu Belu b6a22be259 pathutils: Adds copy_folder_files method
copy_folder_files will copy all the given source folder's files to the
destination (only files, folders are ignored).

Change-Id: I5af94f110b4a6d7672416212f97cb0387cd0cd06
2017-04-04 11:24:13 +00:00
Jenkins 272f1dfffb Merge "Uses _compat_conn where WMI objects need to be updated or added" 2017-04-04 09:37:08 +00:00
Jenkins 46cd7105d7 Merge "py35: fixes exception.message reference issues" 2017-04-04 07:57:49 +00:00
Claudiu Belu 973f50ff1d Uses _compat_conn where WMI objects need to be updated or added
This patch only affects Windows / Hyper-V Server 2012.

On Windows / Hyper-V Server 2012_compat_conn represents the old WMI
connection, in order to ensure that the add / update operations work
properly, since PyMI's and WMI's GetText_(1) outputs are different,
causing an issue on 2012.

Closes-Bug: #1678968

Change-Id: I5542046375114c24387cbcfba0aa8528f8e0dd6d
2017-04-03 14:41:57 +00:00
Claudiu Belu 746d1dc5bd py35: fixes exception.message reference issues
Python 3.5's Exception class no longer contains the
'message' attribute.

Change-Id: Ibc39befa02b4612c95a2b09475e400345aa1ee83
Closes-Bug: #1679183
2017-04-03 14:41:47 +00:00