diff options
author | Zsolt Dudás <zdudas@cloudbasesolutions.com> | 2014-06-11 16:24:06 +0300 |
---|---|---|
committer | zsoltdudas <zdudas@cloudbasesolutions.com> | 2014-08-06 15:26:28 +0300 |
commit | 8c4049c882a9396db7bbca1190d5e1599d46617b (patch) | |
tree | f9d115dce2a6b877ed2c84eb429efef300bb0d86 | |
parent | 0e4dd1bfc4d910a7ccf7e100d4c1a30663dc06b7 (diff) | |
download | nova-8c4049c882a9396db7bbca1190d5e1599d46617b.tar.gz |
Fixes hyper-v volume attach when host is AD member
The domain name gets added to the initiator name used by the host
if it's an Active Directory member.
Currently the method which gets the initiator name does not take
this into account when retrieving the default initiator name.
Trying to use a wrong initiator name will lead to an exception when
trying to log in to the according iSCSI target.
This patch simply appends the domain name (when the host is an AD
member) to the initiator name used to log in to iSCSI targets.
Closes-Bug: #1328870
(cherry-picked from commit 0d9419f2b36561bf50bbe0f720c8dd8ad4e96660)
Change-Id: Ifbe762c685e46081059a01043431b2c4ac5473fc
-rw-r--r-- | nova/virt/hyperv/basevolumeutils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/virt/hyperv/basevolumeutils.py b/nova/virt/hyperv/basevolumeutils.py index ff8e6722f2..47cda5f118 100644 --- a/nova/virt/hyperv/basevolumeutils.py +++ b/nova/virt/hyperv/basevolumeutils.py @@ -71,8 +71,9 @@ class BaseVolumeUtils(object): except Exception: LOG.info(_("The ISCSI initiator name can't be found. " "Choosing the default one")) - computer_system = self._conn_cimv2.Win32_ComputerSystem()[0] initiator_name = "iqn.1991-05.com.microsoft:" + hostname.lower() + if computer_system.PartofDomain: + initiator_name += '.' + computer_system.Domain.lower() return initiator_name def volume_in_mapping(self, mount_device, block_device_info): |