Change in vdsm[ovirt-3.5]: hotunplug: Supporting lun and cinder disks fix.
by aaviram@redhat.com
Hello Allon Mureinik, Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/47926
to review the following change.
Change subject: hotunplug: Supporting lun and cinder disks fix.
......................................................................
hotunplug: Supporting lun and cinder disks fix.
While hotunplugging, VDSM queries libvirt for the unplugged disk to
verify it was removed. This check is in _isDriveAttached, which verifies
that the disk's serial is no longer among the VM's disks. As LUN disks
and Cinder disks currently do not have a serial specified in VDSM flows,
after unplugging, _isDriveAttached queries for empty disk serial to
detect whether the disk is still there, and returns true in case there
are disks with empty serials- such as CD-ROM disks.
This patch fixes _isDriveAttached to check the disk's presence by
verifying that the disk's path no longer exists in the xml, rather
than the serial- to make it return the right value when unplugging
LUN and Cinder disks.
Change-Id: I826eba42903167988da1d02b916feb8fcd19258e
Bug-Url: https://bugzilla.redhat.com/1270834
Signed-off-by: Amit Aviram <aaviram(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47795
Continuous-Integration: Jenkins CI
Reviewed-by: Daniel Erez <derez(a)redhat.com>
Tested-by: Daniel Erez <derez(a)redhat.com>
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47846
Reviewed-by: Allon Mureinik <amureini(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/47926/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 18bc228..72287fd 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4150,7 +4150,9 @@
def _isDriveAttached(self, drive):
root = ET.fromstring(self._dom.XMLDesc(0))
- return bool(root.findall("./devices/disk[serial='%s']" % drive.serial))
+ source_key = 'dev' if drive.blockDev else 'file'
+ return bool(root.findall("./devices/disk/source[@%s='%s']" %
+ (source_key, drive.path)))
def _readPauseCode(self, timeout):
# libvirt does not not export yet the I/O error reason code.
--
To view, visit https://gerrit.ovirt.org/47926
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I826eba42903167988da1d02b916feb8fcd19258e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Amit Aviram <aaviram(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: tests: v2v: add test for commit f8127d8
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: tests: v2v: add test for commit f8127d8
......................................................................
tests: v2v: add test for commit f8127d8
This patch adds a test to exercise the fix introduced in f8127d8
Change-Id: I38bd3c06df263bc208e1a8c8aa6c0081ebdc218d
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/v2vTests.py
1 file changed, 33 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/47367/1
diff --git a/tests/v2vTests.py b/tests/v2vTests.py
index a4d929b..1311ce5 100644
--- a/tests/v2vTests.py
+++ b/tests/v2vTests.py
@@ -38,9 +38,11 @@
class VmMock(object):
def __init__(self, name="RHEL",
- vmid="564d7cb4-8e3d-06ec-ce82-7b2b13c6a611"):
+ vmid="564d7cb4-8e3d-06ec-ce82-7b2b13c6a611",
+ xmldesc_fail=False):
self._name = name
self._vmid = vmid
+ self._xmldesc_fail = xmldesc_fail
self._mac_address = _mac_from_uuid(vmid)
def name(self):
@@ -50,6 +52,8 @@
return [5, 0]
def XMLDesc(self, flags=0):
+ if self._xmldesc_fail:
+ raise fake.Error(libvirt.VIR_ERR_INTERNAL_ERROR)
return """
<domain type='vmware' id='15'>
<name>{name}</name>
@@ -145,7 +149,7 @@
</Envelope>"""
-VmSpec = namedtuple('VmSpec', ['name', 'vmid'])
+VmSpec = namedtuple('VmSpec', ['name', 'vmid', 'xmldesc_fail'])
class v2vTests(TestCaseBase):
@@ -157,7 +161,7 @@
raise SkipTest('v2v is not supported current os version')
vmspecs = tuple(
- VmSpec("RHEL_%i" % i, str(uuid.uuid4()))
+ VmSpec("RHEL_%i" % i, str(uuid.uuid4()), False)
for i in range(self.NUM_VMS)
)
@@ -174,6 +178,32 @@
for vm, spec in zip(vms, vmspecs):
self._assertVmMatchesSpec(vm, spec)
+ def testGetExternalVMsWithXMLDescFailure(self):
+ if not v2v.supported():
+ raise SkipTest('v2v is not supported current os version')
+
+ vmspecs = (
+ VmSpec("RHEL_0", str(uuid.uuid4()), False),
+ VmSpec("RHEL_1", str(uuid.uuid4()), True),
+ VmSpec("RHEL_2", str(uuid.uuid4()), False),
+ )
+
+ def _connect(uri, username, passwd):
+ return LibvirtMock(vms=vmspecs)
+
+ with MonkeyPatchScope([(libvirtconnection, 'open_connection',
+ _connect)]):
+ vms = v2v.get_external_vms('esx://mydomain', 'user',
+ ProtectedPassword('password'))['vmList']
+
+ self.assertEqual(len(vms),
+ sum(int(not spec.xmldesc_fail) for spec in vmspecs))
+
+ for vm, spec in zip(vms,
+ (spec for spec in vmspecs
+ if not spec.xmldesc_fail)):
+ self._assertVmMatchesSpec(vm, spec)
+
def testOutputParser(self):
output = ''.join(['[ 0.0] Opening the source -i libvirt ://roo...\n',
'[ 1.0] Creating an overlay to protect the f...\n',
--
To view, visit https://gerrit.ovirt.org/47367
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I38bd3c06df263bc208e1a8c8aa6c0081ebdc218d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: hsm: prepareForShutdown - operations order
by laravot@redhat.com
Liron Aravot has uploaded a new change for review.
Change subject: hsm: prepareForShutdown - operations order
......................................................................
hsm: prepareForShutdown - operations order
Currently cleanupMasterMount() is executed before
taskMgr.prepareForShutdown() and before the domain monitor is stopped,
that causes to errors during the tasks abortion (becasue of failure to
access the path) and to erros when stopping the domain monitoring
thread on that domain.
The solution introduced in that patch is to change the order of the
operations - so that the cleanupMasterMount() will be executed only
after the other operations are executed.
Change-Id: I9edd84317b08a17db80e265053edaf69582c2a51
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1161934
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/36162/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index c8aaf93..8f71d71 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3433,7 +3433,6 @@
# stop spm tasks if spm etc.)
try:
self._connectionMonitor.stopMonitoring()
- sp.StoragePool.cleanupMasterMount()
self.__releaseLocks()
for spUUID in self.pools:
@@ -3454,6 +3453,7 @@
exc_info=True)
self.taskMng.prepareForShutdown()
+ sp.StoragePool.cleanupMasterMount()
except:
pass
--
To view, visit http://gerrit.ovirt.org/36162
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9edd84317b08a17db80e265053edaf69582c2a51
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: net: tests: test_rollback
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: net: tests: test_rollback
......................................................................
net: tests: test_rollback
A simple rollback test. Created mainly for OVS testing.
Change-Id: I71bc067c5f9f828a0a8899005be51c3695d81c20
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M tests/functional/networkTests.py
1 file changed, 37 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/46875/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 674c479..21565db 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -2775,3 +2775,40 @@
self.assertEqual(status, SUCCESS, msg)
self.assertNetworkDoesntExist(NETWORK_NAME)
self.assertBondDoesntExist(BONDING_NAME, nics)
+
+ @cleanupNet
+ @ValidateRunningAsRoot
+ def test_rollback(self):
+ with dummyIf(3) as nics:
+ NET1 = NETWORK_NAME + '1'
+ NET2 = NETWORK_NAME + '2'
+
+ # setup initial network
+ status, msg = self.setupNetworks(
+ {NET1:
+ {'bonding': BONDING_NAME, 'bridged': True}},
+ {BONDING_NAME: {'nics': nics[:2]}}, NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkExists(NET1)
+ self.assertBondExists(BONDING_NAME, nics[:2])
+
+ # setup network with invalid IP, expecting failture
+ status, msg = self.setupNetworks(
+ {NET2:
+ {'nic': nics[2], 'bridged': True, 'vlan': VLAN_ID,
+ 'netmask': '300.300.300.300', 'ipaddr': '300.300.300.300'}},
+ {}, NOCHK)
+ self.assertNotEqual(status, SUCCESS, msg)
+ self.assertNetworkDoesntExist(NET2)
+
+ # test if initial network is still there
+ self.assertNetworkExists(NET1)
+ self.assertBondExists(BONDING_NAME, nics[:2])
+
+ # cleanup
+ status, msg = self.vdsm_net.setupNetworks(
+ {NET1: {'remove': True}},
+ {BONDING_NAME: {'remove': True}}, NOCHK)
+ self.assertEqual(status, SUCCESS, msg)
+ self.assertNetworkDoesntExist(NET1)
+ self.assertBondDoesntExist(BONDING_NAME, nics)
--
To view, visit https://gerrit.ovirt.org/46875
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71bc067c5f9f828a0a8899005be51c3695d81c20
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: oop: close ioprocesses on vdsmd stop
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: oop: close ioprocesses on vdsmd stop
......................................................................
oop: close ioprocesses on vdsmd stop
Send SIGTERM only to main vdsm service.
All child processes will be closed as part of
prepareForShutdown.
Change-Id: I5a7554609e5b43d6fce3dd3c4c1817cc98372b6c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1189200
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M init/systemd/vdsmd.service.in
M vdsm/storage/hsm.py
M vdsm/storage/outOfProcess.py
3 files changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/45038/1
diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index d7d025f..471905e 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -21,6 +21,7 @@
Group=@VDSMGROUP@
PermissionsStartOnly=true
TimeoutStopSec=@SERVICE_STOP_TIMEOUT@
+KillMode=process
[Install]
WantedBy=multi-user.target
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 0806abb..b424088 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3452,6 +3452,8 @@
exc_info=True)
self.taskMng.prepareForShutdown()
+
+ oop.closeAllIOProcesses()
except:
pass
diff --git a/vdsm/storage/outOfProcess.py b/vdsm/storage/outOfProcess.py
index 19eb546..5cb99b2 100644
--- a/vdsm/storage/outOfProcess.py
+++ b/vdsm/storage/outOfProcess.py
@@ -75,6 +75,9 @@
if (eol < now and name != clientName):
del _procPool[name]
+def closeAllIOProcesses():
+ for name, (eol, proc) in _procPool.items():
+ proc.close()
def _getRfhPool(clientName):
with _procPoolLock:
--
To view, visit https://gerrit.ovirt.org/45038
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a7554609e5b43d6fce3dd3c4c1817cc98372b6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: vdsm: added functionality to teardownImage when disk has bee...
by cshereme@redhat.com
Candace Sheremeta has uploaded a new change for review.
Change subject: vdsm: added functionality to teardownImage when disk has been deleted
......................................................................
vdsm: added functionality to teardownImage when disk has been deleted
added code to teardownImage in hsm.py so that teardownImage reports
"Volume does not exist" for a previously deleted disk, where it
previously simply reported "OK" - teardownImage now checks to see
if volume exists before attempting to delete it
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1184718
Change-Id: Ia929dfdc78ccaa736033e41a77bce861d5a27769
Signed-off-by: Candace Sheremeta <cshereme(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/38241/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 8c75277..45e6634 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3271,6 +3271,13 @@
vars.task.getSharedLock(STORAGE, sdUUID)
dom = sdCache.produce(sdUUID)
+ allVols = dom.getAllVolumes()
+ # Filter volumes related to this image
+ imgVolumes = sd.getVolsOfImage(allVols, imgUUID).keys()
+
+ if volUUID not in imgVolumes:
+ raise se.VolumeDoesNotExist(volUUID)
+
dom.deactivateImage(imgUUID)
@public
--
To view, visit https://gerrit.ovirt.org/38241
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia929dfdc78ccaa736033e41a77bce861d5a27769
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Candace Sheremeta <cshereme(a)redhat.com>
7 years, 5 months