520 Commits

Author SHA1 Message Date
Claudiu Belu
776270c4b3 Fixes port security settings caching issue
When updating the MAC spoofing for a given vswitch port, its
Msvm_EthernetSwitchPortSecuritySettingData object is removed
and a new one is created, but the original object is not
cleared from the cache. Because of this, the next update will
fail with a Not Found exception.

This patch addresses this issue.

Closes-Bug: #1744755

Change-Id: I91b9000c64d269b7d5b1db9e0c6344bbd70e37b2
2018-01-22 16:23:05 +00:00
melissaml
bbaa712277 Cleanup test-requirements
python-subunit is not used directly anywhere
and it is dependency of both testrepository
and os-testr
(probably was used by some tox wrapper script before)

Change-Id: I9e013fe5ce2abc6a9850d62a9a455c4090d200da
2018-01-03 17:24:40 +08:00
Lucian Petrut
204156f69d Remove deprecated methods and exceptions
This change cleans up some deprecated methods and an exception.

Change-Id: I02ce0624d9b0963db7b00a5098e76a33552c1b12
3.0.0
2017-12-20 16:28:47 +02:00
Zuul
4e24801719 Merge "Implement VHD attach/detach" 2017-12-19 13:38:34 +00:00
Zuul
30a6363676 Merge "Add processutils module" 2017-12-19 13:38:34 +00:00
OpenStack Proposal Bot
edbb70dcae Updated from global requirements
Change-Id: I71d64ef302586309d13e9cbfe3c95fba815efef1
2017-12-19 01:37:33 +00:00
Lucian Petrut
f913051b00 Add processutils module
This change adds a processutils module, which includes several
process/job helpers.

Associating a job with a process will allow ensuring that when a
parent process is killed, processes associated with jobs (e.g. child
processes) will be killed as well.

This is especially useful for Cinder, which will use it for the
multiple backend per service scenario.

Job objects may have resource limits. We may use jobs in order to
implement resource limit support within oslo_concurrency (currently
not available on Windows).

Related-Bug: #1734334

Change-Id: Icc2bbe9191e6db685c0fd294abc1d0eb24bc420c
2017-12-18 16:04:56 +02:00
Lucian Petrut
69ea678ad8 Implement VHD attach/detach
This change adds support for attaching/detaching VHD images, as well
as retrieving the attached disk "physical" path.

This also adds support for changing disk online/readonly status,
as well as retrieving its size.

This feature will be used by os-brick, aiming to add volume backup
support for the Windows SMB Cinder driver.

Implements: blueprint vhd-attach-detach

Change-Id: I4ed28606a7f5643a2ccfef24d198649e28c59a3b
2017-12-18 16:02:18 +02:00
Claudiu Belu
0e58eac4a6 Cleanup vmutils create_vm
The method signature and behaviour has changed. The method will no longer
set VM's memory and vCPUs, update_vm should be called for this behaviour.

In order to maintain compatiblity with the previous usage, both
behaviours were kept.

After the old usage has been updated, the old behaviour can be safely
removed.

Change-Id: Iead1e1d4597394a1bebab87b2416baada1657e94
Related: blueprint hyper-v-vnuma-enable
2017-12-15 17:46:58 +02:00
Zuul
706bb41ee5 Merge "Updated from global requirements" 2017-12-15 13:21:32 +00:00
Andreas Jaeger
4aa86b8749 Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: Icb8bcec5166dd151336455c69db8e4c4067ac8c5
2017-12-02 17:06:38 +00:00
OpenStack Proposal Bot
cf5873dcef Updated from global requirements
Change-Id: Iaa951c60574f92caf6d7ef1f54d3061333e1b696
2017-11-29 09:14:04 +00:00
Zuul
6ab9f17bfe Merge "Adds SR-IOV support" 2.6.0 2017-11-21 11:16:18 +00:00
Claudiu Belu
05bdaea97a Adds SR-IOV support
SR-IOV support has been added to Hyper-V since Windows / Hyper-V
Server 2012.

In order to properly use SR-IOV, the host must support it, and have it
enabled, and it must have SR-IOV capable NICs.

The Hyper-V vSwitches will have to be configured to enable SR-IOV.

vmutils: create_nic - mac_address can now be None. If None,
a dynamic address will be used instead.
hostuils: added get_nic_sriov_vfs - returns a list of dictionaries,
containing available vSwitch VFs.
networkutils: added set_vswitch_port_sriov - enables / disables SR-IOV
on the given switch port.

Implements: blueprint os-win-sriov

Change-Id: Ied27bb4e1b36e743b33c6b65351c2ee942ef535e
2017-11-21 12:37:42 +02:00
Zuul
a60e0e75ac Merge "Updated from global requirements" 2017-11-20 19:42:20 +00:00
Andreas Jaeger
de3f36d18e Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I16981e37c2e641c05fa65d5151b3dadf1e951482
2017-11-16 22:01:03 +01:00
OpenStack Proposal Bot
35a046207f Updated from global requirements
Change-Id: I0500fe112f55ca19e9df767939ed08882175cd29
2017-11-16 11:20:33 +00:00
Lucian Petrut
0ca03208a1 doc: Switch to openstackdocstheme
The oslosphinx theme has been deprecated. Besides, we're currently
inconsistent with the other project docs themes.

Change-Id: I6a7a105d8b689ff5e5ca2f7829ce06d166e8db2e
2017-11-13 19:03:37 +00:00
Zuul
59e34ac9fc Merge "Add config sample to os-win docs" 2017-11-13 18:08:49 +00:00
Zuul
eda1a642de Merge "[Trivial] Add HyperVvSwitchNotFound exception" 2017-11-13 17:59:38 +00:00
Lucian Petrut
e27e1831f9 Add config sample to os-win docs
This change adds an automatically generated config sample to the
os-win docs.

The config sample is generated each time the docs are built, using
the oslo.config sphinxconfiggen extension.

Related-Bug: #1709648

Change-Id: I01f44bf02c92ecfced6d5266caa40683a0a9248e
2017-11-13 17:53:39 +00:00
Zuul
91c7fee4f4 Merge "Add oslo.config entry point" 2017-11-13 16:02:25 +00:00
OpenStack Proposal Bot
f9acdd1fb2 Updated from global requirements
Change-Id: Ifa4d7f5349d65a0f1ace0e7605d9e8f3c1abdc61
2017-11-13 10:26:18 +00:00
Lucian Petrut
2f808ecb10 Add oslo.config entry point
This change will allow generating a config sample using the
oslo.config generator.

Generating an os_win config sample may be requested by using:
oslo-config-generator --namespace os_win

Closes-Bug: #1709648

Change-Id: Icc39a472cb05bfd0bcb673959b40b0d2e6e89077
2017-11-10 15:59:49 +02:00
Lucian Petrut
11c92505d6 [Trivial] Add HyperVvSwitchNotFound exception
At the moment, we're raising a generic HyperVException when
attempting to retrieve a non-existent vSwitch.

This change adds a 'HyperVvSwitchNotFound' exception, which will
allow callers to better handle such situations.

Change-Id: I221622bc050cf634f86edde49e26c09ee30b177e
2017-11-09 15:02:09 +02:00
Zuul
c5ce9a6cf6 Merge "Add SAN policy setter/getter" 2.5.0 2017-10-27 09:23:09 +00:00
Zuul
44320ca5f0 Merge "Add method returning vswitch extensions" 2017-10-27 09:22:11 +00:00
Lucian Petrut
340abb4009 Silently continue when destroying missing vNIC
At the moment, if requested to destroy an inexistent VM NIC,
os-win will raise an IndexError, which is not really helpful.

In quite a few other cases, we're silently continuing when dealing
with missing resources. We'll do the same here as well.

Change-Id: Ibe290ba2521a808f3dba150de33f9be0b3519e7c
Related-Bug: #1724282
2017-10-25 12:35:12 +03:00
Lucian Petrut
edb4e17131 Add SAN policy setter/getter
This change adds a setter and getter for the SAN policy, controlling
the way in which new disks will be handled (brought online or not).

Validating this policy will help prevent common vm disk attachment
issues when dealing with passthrough disks.

Related-Bug: #1727257

Change-Id: I25033c15b77f494a417c9cd01d194a8bfb3cfe13
2017-10-25 09:33:01 +00:00
Lucian Petrut
152b0dac96 Add method returning vswitch extensions
This change adds a new method returning available extensions for
a given vswitch. It returns a list of dicts that include vswitch
extension information.

This method is required by the Neutron Hyper-V agent in order to
validate a configured vSwitch.

Note that this change also adds the CIM enabled state constants
(which are re-used for various type of resources).

Related-Bug: #1592777

Change-Id: I0856a23030480d435fd0582fc6b4bc688c98ae93
2017-10-25 12:23:21 +03:00
Lucian Petrut
8eea07d9dc Include disk ctrl addr in attachment info
os-win allows retrieving information regarding VM disk attachments.

This change ensures that the disk controller address is included as
well in the returned dict. This will allow building full disk paths,
as exposed to Hyper-V guests.

Change-Id: I6f2c6ecf71d3254d64bc24574619c18184d3d055
Related-Bug: #1723431
2017-10-16 13:43:11 +03:00
Lucian Petrut
7af8caeb5e Fix fetching vm boot sources
When setting the VM disk boot order, we're passing Msvm_DiskDrive
WMI object paths in case of passthrough disks and the actual image
file paths in case of vhd/x images.

In order to determine the disk type, os-win checks if the path is
an existing file path (using os.path.exist), which is extremely
inefficient. The call can take up to a minute in case of a
passthrough disk.

This patch updates the logic so that we're checking if the provided
path resembles a Msvm_DiskDrive WMI object path. The
'_is_drive_physical' method is removed due to its limited scope.

Change-Id: I0fc7a8b5f1feabe07fc1707d8469b929b3739a1d
Closes-Bug: #1723448
2017-10-16 12:43:23 +03:00
Lucian Petrut
181a5f089a Allow fetching disk attachment info by tag
At the moment, we allow tagging passthrough VM disk attachments.

In order to avoid fetching the actual disk path, which can be a
time consuming operation, this change will allow fetching disk
attachment info by serial tag as well (which is assumed to be
unique).

Change-Id: I7a4c242c80b5b3562bf9513deb89071b5bb5bf28
Related-Bug: #1723431
2017-10-13 17:17:13 +03:00
OpenStack Proposal Bot
c57491918f Updated from global requirements
Change-Id: I98d6f651c888bcd31999ee4cbe4b331ad803ef95
2017-10-04 13:43:06 +00:00
Claudiu Belu
2f76a020ac vmutils: Fixes setting disk QoS on Hyper-V 6.2
Hyper-V disk QoS is supported on Windows / Hyper-V Server 2012 R2
(OS version 6.3) or newer. It cannot be set on earlier versions.

If the set_disk_qos_specs method is called on Windows / Hyper-V Server
2012 with non-zero values, an os_win.exceptions.UnsupportedOperation
exception will be raised.

If the given min_iops and max_iops arguments are None or zero, the
method will be no-op: QoS doesn't need to be enabled, nor disabled
(0 means that QoS is disabled).

Change-Id: Ia3b47477ba6814153bf0ab74ec9737a01bb11678
Closes-Bug: #1716891
2017-09-14 15:25:24 +00:00
OpenStack Proposal Bot
c87bcd4178 Updated from global requirements
Change-Id: I9f1c86ca544130825c5126ba0c771965f84f4f8b
2017-08-24 05:58:14 +00:00
OpenStack Proposal Bot
606d91316d Updated from global requirements
Change-Id: I66a7c87b28a185b91cf0c24c0b496e29aa583b16
2017-08-18 11:39:39 +00:00
Claudiu Belu
e0d7032dfb check minimum VM version when setting VM snapshots
Some Hyper-V operations require a minimum VM version in order to succeed.
For example, Production Checkpoints are supported on VM Versions 6.2 and
newer.

Clustering Hyper-V compute nodes may change the list of supported VM
versions list and the default VM version on that host.

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/deploy/upgrade-virtual-machine-version-in-hyper-v-on-windows-or-windows-server

Partial-Bug: #1707605
Change-Id: Iac795f570649ce28847b88c5a21e575daefefc49
2017-08-09 01:32:49 -07:00
Jenkins
742c6d1bbb Merge "Allow aggregating disk rescan requests" 2017-08-08 07:44:57 +00:00
Jenkins
774e1ce4f7 Merge "Include FCP lun when returning mappings" 2017-08-08 07:30:07 +00:00
Jenkins
65b14a0880 Merge "Add methods for retrieving disks" 2017-08-08 07:30:02 +00:00
Jenkins
40dfe2bfd6 Merge "FC: add support for retrieving FC LUN UIDs" 2017-08-08 07:22:31 +00:00
Lucian Petrut
f7ab8424fe Allow aggregating disk rescan requests
Disk rescans are time consuming operations. We're trying to reduce
the amount of rescan calls by aggregating them. Basically, if a
rescan is already in proggress, we're waiting for it to complete
without issuing a new request.

This behavior is disabled by default and can be enabled using the
'merge_requests' argument.

Change-Id: I6132d05c6ca7725226348f9fa8237e1810e65a7d
2017-08-07 18:01:31 +03:00
Lucian Petrut
763a07de84 Include FCP lun when returning mappings
The FCP logical unit number can be used in order to identify a LU
on the target side. This allows sending SCSI commands targetting
a specific LU.

For this reason, we're now including it when returning the FC target
mappings.

Related-Bug: #1694671

Change-Id: Id8139c4ceb0f195199f7284efe12263eb5e597dc
2017-08-07 18:01:31 +03:00
Lucian Petrut
01f804f428 Add methods for retrieving disks
This change adds two new public methods that will allow retrieving
disks by device number or unique id.

Related-Bug: #1694671

Change-Id: I7c7bbbf422e4f55dde11b90ffc29c1b34901e2e2
2017-08-07 18:01:31 +03:00
Lucian Petrut
6a6fc77b96 FC: add support for retrieving FC LUN UIDs
This change allows retrieving SCSI Unique IDs for FibreChannel LUNs.

We're sending a SCSI INQUIRY request on the specified LUN, parsing
the retrieved VPD page. We're also selecting the identifiers based
on Windows support and order of precedence.

This will allow discovering FibreChannel disks in a more efficient
way.

Related-Bug: #1694671
Change-Id: I86d953d000e6d0244e8e8f2aaf2cbd76305cb63b
2017-08-07 18:00:51 +03:00
Jenkins
246192fc51 Merge "FC: cleanup WWN usage" 2017-08-07 12:38:14 +00:00
Jenkins
38aa661b2d Merge "iSCSI: add checks for MPIO disks" 2017-08-07 12:37:06 +00:00
Jenkins
faafc84aed Merge "[Trivial] Add method checking if a disk is claimed by MPIO" 2017-08-07 12:34:45 +00:00
Lucian Petrut
7618208a7f FC: cleanup WWN usage
At the moment, we're using WWNs represented either as byte arrays,
hex strings or ctypes structures. Needless to say, this is quite
confusing as the fc_utils methods accept multiple formats.

As per this change, we're accepting WWNs represented as hex strings
in case of the public methods (just as before), while for private
methods we're using ctypes WWN structures (containing 8 byte arrays),
which in turn are passed to hbaapi.dll functions.

Some arguments are renamed/documented accordingly. Note that the
helper methods converting those WWNs are moved to the '_utils'
module, as those will be reused by a subsequent change.

Change-Id: I43daf4ad943d0097c951c2ad4ccb856a2fe9e1bc
2017-08-04 19:33:00 +03:00