Commit Graph

586 Commits

Author SHA1 Message Date
jacky06
ec959ea8bc Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

It's worth noting that the pep8 package has been renamed to
pycodestyle. New hacking packages no longer install the old pep8
package automatically.

Change-Id: Ibbad8b42188ade597d9a3032389e930c2f5fe2d0
2019-03-15 13:12:00 +02:00
Zuul
7ed1f4db45 Merge "Add mutex class" 2019-02-01 13:19:36 +00:00
Lucian Petrut
5c3f7cd15e Add mutex class
This will expose Windows mutexes. We usually rely on file locks
when synchronizing multiple processes, mostly for portability
reasons.

Some times, file locks may not be an option, in which case a
named mutex can be useful. We intend to use this in Glance when
ensuring that only one scrubber can run at a time.

Change-Id: I4a2a51e2164c6f5816f2af2641d41d1db7870600
2019-02-01 14:15:27 +02:00
Zuul
7fa5db4de9 Merge "Cleanup utilsfactory map" 2019-01-16 14:01:23 +00:00
Zuul
2223f3c7fa Merge "Add pipe helpers" 2019-01-16 14:01:22 +00:00
Lucian Petrut
0857a0eb81 Cleanup utilsfactory map
This change cleans up the utilsfactory map, making it easier to add
new classes.

Most classes have 6.2 as a minimum version, without having a maximum
version cap. For this reason, this change sets those versions as
defaults so that we don't have to be explicit every time.

At the same time, we're now using a list for each class type, instead
of a dict that uses the class name as a key (which is redundant). So,
something like this:

'networkutils': {
    'NetworkUtils': {
        'min_version': 6.2,
        'max_version': 6.3,
        'path': 'os_win.utils.network.networkutils.NetworkUtils'},
    'NetworkUtilsR2': {
        'min_version': 6.3,
        'max_version': None,
        'path': 'os_win.utils.network.networkutils.NetworkUtilsR2'}},

... becomes

'networkutils': [
    {'max_version': 6.3,
     'path': 'os_win.utils.network.networkutils.NetworkUtils'},
    {'min_version': 6.3,
     'path': 'os_win.utils.network.networkutils.NetworkUtilsR2'},
],

Change-Id: I7919617166b2e872f1b50c0a0f40196fc90e9a82
2019-01-16 14:41:43 +02:00
Lucian Petrut
d139d77167 Add pipe helpers
This change adds a few helpers that will allow creating and consuming
pipes. While similar functions are already provided by the built-in
os module, the handle inherit flags do not work on Windows.

We intend to use those helpers in Glance when dealing with
subprocesses.

Change-Id: I6ed456b5f95b5691da555e36846de4286ad96f15
2019-01-16 14:41:00 +02:00
Zuul
3ea0c5db1d Merge "Change openstack-dev to openstack-discuss" 2019-01-16 09:42:44 +00:00
Zuul
1ceb2bcaf5 Merge "Silently continue when disconnecting missing vhds" 2019-01-16 09:42:44 +00:00
Lucian Petrut
593152d8d8 Silently continue when disconnecting missing vhds
os-win should silently pass when requested to disconnect a vhd that's missing.
At the moment, it's erroring out, which prevents some Nova instances from being
cleaned up.

This change checks if the image to be disconnected actually exists before
attempting to open it.

Change-Id: Ic734d38e1939165a89a79842d37e98b4cbbcb3bf
Closes-Bug: #1810927
2019-01-08 13:29:31 +02:00
Andreas Jaeger
e36f81663c Use template for lower-constraints
Small cleanups:

* Use openstack-lower-constraints-jobs template, remove individual
  jobs.
* Sort list of templates

Change-Id: I3688fc5be123cff756ad8d778e6c97b2b6173c9b
Needed-By: https://review.openstack.org/623229
2018-12-20 21:13:48 +01:00
qingszhao
3bc86d6e94 Change openstack-dev to openstack-discuss
Mailinglists have been updated. Openstack-discuss replaces openstack-dev.

Change-Id: Ibeb9ec11f6724ba1164716a7dcb7b07b0777741b
2018-12-04 17:07:24 +00:00
Zuul
3bbe2e4a50 Merge "Logging multiple WMI job errors" 2018-11-22 13:55:55 +00:00
Daniel Vincze
e1c83c86bc Logging multiple WMI job errors
WMI jobs may return multiple errors, but only one of them
would be logged.

This change ensures that we're fetching all of them, calling the
Msvm_ConcreteJob.GetErrorEx method.

Change-Id: I7311e63e4f95c4e1d17357d28fdd1c7425362270
Closes-Bug: 1748208
2018-11-22 12:41:13 +00:00
Lucian Petrut
030df4e310 Disable wmi object caching by default
Due to the known issues related to WMI object caching, it's safer
if we just disable it by default.

Change-Id: If859917af9a185fc612231002d252c9e0ac6ddd3
Related-Bug: #1801701
2018-11-09 09:25:28 +00:00
Lucian Petrut
21a2fe8758 Trivial: Fix flaky unit test
One cluster listener daemon isn't properly mocked, for which reason
it's running in a separate thread and calling mocked methods,
affecting other test cases and their assertions.

http://paste.openstack.org/raw/734339/

This change mocks it properly, ensuring that other test cases will
not be affected by it.

Change-Id: I2e9d2b98457bac280bf7a19afc12dc822a83eb0f
2018-11-07 10:14:20 +02:00
Zuul
728ddeb4f4 Merge "Limit Failover Cluster WMI provider usage" 2018-10-26 10:56:48 +00:00
Lucian Petrut
6c6955f9f2 Limit Failover Cluster WMI provider usage
The Failover Cluster WMI provider is quite unreliable, especially
in recent Windows Server 2016 versions.

After failovers, some valid WMI queries fail with "Invalid Property"
errors, which really looks like a WMI provider bug. Event listeners
are affected as well, for which reason we're missing VM failover events.

This change refactors "clusterutils", switching to the underlying
C library.

The new failover event listener cannot provide the source of the
migrated instances, so we're keeping the old one as well for backwards
compatibility, for now.

The only other places in which we're still using WMI are the methods
that add or destroy VM cluster roles.

The reason is that we'd have to explicitly create the the cluster
resources and group, probably set some resource dependencies and
properties. For now, it's easier/safer to just stick with the WMI
method (which really shouldn't fail).

Also, destroying VM cluster groups using clusapi's DestroyClusterGroup
function behaves strange. VMs get recreated asyncronuously and put in
suspended state, breaking everything. We're avoiding it for now.

Closes-Bug: #1798069

Change-Id: I63d1aa3a6f9fb12d08478eb41fe973b1582b540c
2018-10-25 11:49:55 +03:00
Zuul
5d7c91e627 Merge "Ignore events for unnamed VM vNICs" 2018-10-03 10:32:05 +00:00
Zuul
68d763f4c3 Merge "Allow enabling metrics per virtual disk" 2018-10-01 09:41:13 +00:00
Zuul
d0acdadf4b Merge "Add method for retrieving VM nics" 2018-10-01 09:41:08 +00:00
Zuul
617cab6735 Merge "Fix port metrics" 2018-10-01 09:41:08 +00:00
Lucian Petrut
42cfab1081 Ignore events for unnamed VM vNICs
VM vNIC names are mandatory. Still, we'll getting events for unnamed ports,
breaking os-win consumers.

We'll ignore those events, logging a warning.

Change-Id: I58a408b33a590b9c1ca3d8f32fa3c4d027f43381
Closes-Bug: #1761748
2018-09-28 16:08:27 +03:00
maaktweluit
91eb56c8ac Add getter for MemorySettingsData
This will allow fetching various VM memory information, such as
dynamic memory limits and reserved amount.

Change-Id: Ifa9649e490a851090cdf3f8a0390e4ab7d5a6373
2018-09-28 13:41:02 +03:00
Lucian Petrut
a0b64b6544 Allow enabling metrics per virtual disk
This change will allow enabling metrics for individual virtual disks.
The Nova Hyper-V driver will use it when attaching Cinder volumes.

Note that Hyper-V does not support collecting metrics for passthrough
disks at the moment.

Change-Id: Iaba32ca94b2c09661f150fa4b12b2c7eb83ff6d9
Partial-Bug: #1794456
2018-09-27 19:40:48 +03:00
Lucian Petrut
c73b074042 Add method for retrieving VM nics
We need a way to retrieve VM nic names. This will allow the Nova
Hyper-V driver to enable port metrics when receiving instance power
on events.

It's safer to query Hyper-V directly rather than relying on Nova's port
cache.

Change-Id: Ibe7409b392b91204f0cea2bdd32c86ec03d06b67
Partial-Bug: #1794456
2018-09-27 18:59:59 +03:00
Lucian Petrut
865c1cfaa0 Fix port metrics
At the moment, port metrics are not enabled. The reason is that we're
using the wrong switch port WMI class.

This issue went more or less unnoticed, especially due to the fact that
we're currently ignoring the according WMI method return code.

This change ensures that port metrics are properly enabled and that an
exception will be raised when failing to do so.

Closes-Bug: #1794291

Change-Id: I8086e7dd9e134749760b05469f5b2c8bcfdcdbde
2018-09-26 16:05:20 +03:00
Lucian Petrut
1f8200ef79 Fix incorrect numeric comparisons
In a few places, we're using "is" or "is not", when comparing
numeric variables.

This is incorrect and will give unexpected results when the types
do not match (for example, if one of the variables is a long int):
http://paste.openstack.org/raw/730618/

This change fixes those comparisons.

Closes-Bug: #1794068

Change-Id: Ibf28778879050cfdfa82ef4f9b587170dde6203f
2018-09-24 14:09:16 +03:00
Zuul
c29ff8bf92 Merge "Add wmi job terminate timeout cfg opt" 2018-09-10 09:11:49 +00:00
Lucian Petrut
11e28563d4 Add wmi job terminate timeout cfg opt
We're using a hardcoded 15 seconds timeout when canceling WMI jobs.

Some jobs may not be cancelable, some may take longer to stop. For
example, Nova instances may end up in error state after attempting
to delete them as this hardcoded timeout gets exceeded.

That being considered, we're now adding a config option for this,
also increasing the default timeout to 2 minutes.

Ideally, Nova should pass a timeout here. Still, by adding a config
option at the os-win level, it's easier to backport this to older
releases, also providing a default for any kind of WMI job.

Change-Id: I797366c40a3a4bb74fe925bd10697f227e22915c
Closes-Bug: #1790890
2018-09-06 09:56:14 +03:00
98k
8cec9d5de2 add python 3.6 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I1f177271d3598e3616e6259370436977ebd0b32c
Story: #2002586
Task: #24345
2018-08-24 06:31:41 +00:00
98k
49e5da001d switch documentation job to new PTI
This is a mechanically generated patch to switch the documentation
jobs to use the new PTI versions of the jobs as part of the
python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I03acea5710dc85938d1b77bdc81c3f8704f64659
Story: #2002586
Task: #24345
2018-08-24 06:31:39 +00:00
98k
c0bc89255a import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I3683d6634b8973ef63f467fb6466bf57f984b3e9
Story: #2002586
Task: #24345
2018-08-24 06:31:31 +00:00
OpenStack Proposal Bot
d8ea451009 Updated from global requirements
Change-Id: I9bc41e9d5bf04dd78816f26ed5cad1555f729eae
2018-08-02 06:57:19 -07:00
Zuul
8a4e47c2af Merge "Update reno for stable/rocky" 2018-08-01 13:24:45 +00:00
Zuul
5a90f2e3d4 Merge "fix tox python3 overrides" 2018-08-01 13:22:53 +00:00
a064ccaf87 Update reno for stable/rocky
Change-Id: I09925cac3ac164c696844d533bd158146465c8a1
2018-07-26 12:36:17 +00:00
qingszhao
011df42a9d Add release note link in README
Change-Id: I67c8834db06218b651bd3bbd0345feaef524e8ed
2018-06-27 23:29:54 +08:00
Doug Hellmann
89833d36e1 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Ieb432c391d3dcc798a30516ed96528a15f526d48
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Doug Hellmann
f9dc56f5bf uncap eventlet
We will manage the eventlet version using constraints now. See the
thread starting at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129096.html
for more details.

Change-Id: Ia247dbd9cad49d590b8e0338079a94fe5c71f823
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-11 11:52:27 -04:00
Doug Hellmann
90b359d103 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: Ia95aa8f003151cbce870acc54f2053cbcfc6effb
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-05 07:21:46 -04:00
Zuul
be3f73cb29 Merge "Removing pypy" 2018-03-21 10:39:37 +00:00
Zuul
50f95c6817 Merge "Update links in README" 2018-03-21 10:39:36 +00:00
OpenStack Proposal Bot
51cc7eb1ed Updated from global requirements
Change-Id: I939f98e5ece79821959b6c6ff921c0732b669c5f
2018-03-15 07:46:04 +00:00
melissaml
068d1b5ec7 Update links in README
Change the outdated links to the latest links in README

Change-Id: Ie32a28cce8f8a629ab6dceaf460868f67f7ff91c
2018-03-09 11:38:52 +08:00
Hoang Trung Hieu
c9285bdc0a Removing pypy
Pypy is not checked at gate.

Change-Id: I00706a22109c3c5b03ad1696b2cdad78b8e78f73
2018-02-23 13:09:33 +07:00
Zuul
6a5325be76 Merge "Remove deprecated methods" 2018-02-22 14:03:34 +00:00
Zuul
225832f215 Merge "Improve WMI jobs logging" 2018-02-14 14:17:39 +00:00
Lucian Petrut
58509209b9 Improve WMI jobs logging
This change provides additional log information when handling WMI
jobs. This allows us to get a better picture of the job states.

This will be extremely helpful for debugging purposes, as currently
we don't get much information about pending jobs or errors that
occur when stopping jobs.

Closes-Bug: #1748208

Change-Id: Ibb4d5969eea13a0b11a6d5b46b797482a6d2a20b
2018-02-08 17:26:03 +02:00
Claudiu Belu
ea65d0a510 Ensures that all classes have the same interface as their parents
VMUtils10 has a few extra methods when compared to VMUtils. This
patch adds those methods to VMUtils (raising NotImplementedError).

Adds unit test that checks for future inconsistentcies.

ISCSIInitiatorCLIUtils has been deprecated and removed, but it was
not removed from utilsfactory.utils_map. This patch addresses this
issue.

Closes-Bug: #1746986

Change-Id: I2a963304fc67595bc18e719e6b4420f553519c41
2018-01-31 01:57:45 -08:00