Change in vdsm[master]: StorageDomainManifest: Move clusterLock into Manifest
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: StorageDomainManifest: Move clusterLock into Manifest
......................................................................
Patch Set 13: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/43549/13/vdsm/storage/sd.py
File vdsm/storage/sd.py:
Line 465
Line 466
Line 467
Line 468
Line 469
Please this as a wrapper for the format converter so it does not have to peek into storage domain _manifest.
--
To view, visit https://gerrit.ovirt.org/43549
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2c019a7fed6ba793d2b3a2459af221b1abbff2a3
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
8 years, 8 months
Change in vdsm[master]: StorageDomainManifest: Move clusterLock into Manifest
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: StorageDomainManifest: Move clusterLock into Manifest
......................................................................
Patch Set 13:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/43549
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2c019a7fed6ba793d2b3a2459af221b1abbff2a3
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: StorageDomainManifest: Move clusterLock into Manifest
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: StorageDomainManifest: Move clusterLock into Manifest
......................................................................
Patch Set 12:
(1 comment)
https://gerrit.ovirt.org/#/c/43549/12/vdsm/storage/imageRepository/format...
File vdsm/storage/imageRepository/formatConverter.py:
Line 117: log.debug("Setting permissions for domain %s", domain.sdUUID)
Line 118: domain.setMetadataPermissions()
Line 119:
Line 120: log.debug("Initializing the new cluster lock for domain %s", domain.sdUUID)
Line 121: newClusterLock = domain._manifest._makeDomainLock(targetVersion)
> Because we removed it. This is the only consumer of that logic so I decide
Please keep the domain._makeClusterLock() for now, even if this is the only caller.
Line 122: newClusterLock.initLock()
Line 123:
Line 124: log.debug("Acquiring the host id %s for domain %s", hostId, domain.sdUUID)
Line 125: newClusterLock.acquireHostId(hostId, async=False)
--
To view, visit https://gerrit.ovirt.org/43549
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2c019a7fed6ba793d2b3a2459af221b1abbff2a3
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
8 years, 8 months
Change in vdsm[master]: StorageDomainManifest: Move clusterLock into Manifest
by alitke@redhat.com
Adam Litke has posted comments on this change.
Change subject: StorageDomainManifest: Move clusterLock into Manifest
......................................................................
Patch Set 12:
(8 comments)
https://gerrit.ovirt.org/#/c/43549/12/tests/manifest_tests.py
File tests/manifest_tests.py:
Line 64: self.assertEquals(mdpath, manifest.getMDPath())
Line 65:
Line 66: def test_getmetaparam(self):
Line 67: with namedTemporaryDir() as tmpdir:
Line 68: metadata = {sd.DMDK_VERSION: 3}
> Why not use FakeMetadata object for consistency? (for another patch?)
Good point, but not related to this patch.
Line 69: manifest = make_filesd_manifest(tmpdir, metadata)
Line 70: metadata[sd.DMDK_SDUUID] = manifest.sdUUID
Line 71: self.assertEquals(manifest.sdUUID,
Line 72: manifest.getMetaParam(sd.DMDK_SDUUID))
https://gerrit.ovirt.org/#/c/43549/12/tests/storagetestlib.py
File tests/storagetestlib.py:
Line 38: def make_blocksd_manifest(tmpdir=None, metadata=None, sduuid=None):
Line 39: if sduuid is None:
Line 40: sduuid = str(uuid.uuid4())
Line 41: if metadata is None:
Line 42: metadata = FakeMetadata([(sd.DMDK_VERSION, 3)])
> You can use:
Done
Line 43: manifest = blockSD.BlockStorageDomainManifest(sduuid, metadata)
Line 44: if tmpdir is not None:
Line 45: manifest.domaindir = tmpdir
Line 46: os.makedirs(os.path.join(manifest.domaindir, sduuid, sd.DOMAIN_IMAGES))
Line 77: sduuid = str(uuid.uuid4())
Line 78: domain_path = os.path.join(tmpdir, sduuid)
Line 79: make_file(get_metafile_path(domain_path))
Line 80: if metadata is None:
Line 81: metadata = FakeMetadata([(sd.DMDK_VERSION, 3)])
> You can use:
Done
Line 82: manifest = fileSD.FileStorageDomainManifest(domain_path, metadata)
Line 83: os.makedirs(os.path.join(manifest.domaindir, sduuid, sd.DOMAIN_IMAGES))
Line 84: return manifest
Line 85:
https://gerrit.ovirt.org/#/c/43549/12/vdsm/storage/imageRepository/format...
File vdsm/storage/imageRepository/formatConverter.py:
Line 117: log.debug("Setting permissions for domain %s", domain.sdUUID)
Line 118: domain.setMetadataPermissions()
Line 119:
Line 120: log.debug("Initializing the new cluster lock for domain %s", domain.sdUUID)
Line 121: newClusterLock = domain._manifest._makeDomainLock(targetVersion)
> Why no not use domain._makeClusterLock()?
Because we removed it. This is the only consumer of that logic so I decided to call into the manifest. In general this module is badly behaved as it accesses many protected class members.
Line 122: newClusterLock.initLock()
Line 123:
Line 124: log.debug("Acquiring the host id %s for domain %s", hostId, domain.sdUUID)
Line 125: newClusterLock.acquireHostId(hostId, async=False)
https://gerrit.ovirt.org/#/c/43549/12/vdsm/storage/sd.py
File vdsm/storage/sd.py:
Line 555
Line 556
Line 557
Line 558
Line 559
> Lets move it to the manifest, so we don't have to make the manifest domainL
Done
Line 304: def __init__(self, sdUUID, domaindir, metadata):
Line 305: self.sdUUID = sdUUID
Line 306: self.domaindir = domaindir
Line 307: self.replaceMetadata(metadata)
Line 308: self.domainLock = self._makeDomainLock()
> Why public? old lock was private.
Done
Line 309:
Line 310: @property
Line 311: def oop(self):
Line 312: return oop.getProcessPool(self.sdUUID)
Line 428: DEFAULT_LEASE_PARAMS[DMDK_LOCK_RENEWAL_INTERVAL_SEC],
Line 429: DEFAULT_LEASE_PARAMS[DMDK_LEASE_TIME_SEC],
Line 430: DEFAULT_LEASE_PARAMS[DMDK_LEASE_RETRIES],
Line 431: DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC],
Line 432: )
> For another patch, move leaseParams after lock class selection.
ok
Line 433:
Line 434: try:
Line 435: clusterLockClass = self._domainLockTable[domVersion]
Line 436: except KeyError:
Line 431: DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC],
Line 432: )
Line 433:
Line 434: try:
Line 435: clusterLockClass = self._domainLockTable[domVersion]
> If you renamed _makeClusterLock to _makeDomainLock, you should also rename
Done
Line 436: except KeyError:
Line 437: raise se.UnsupportedDomainVersion(domVersion)
Line 438:
Line 439: return clusterLockClass(self.sdUUID, self.getIdsFilePath(),
--
To view, visit https://gerrit.ovirt.org/43549
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2c019a7fed6ba793d2b3a2459af221b1abbff2a3
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
8 years, 8 months
Change in vdsm[master]: migration: Add incoming migration semaphore
by michal.skrivanek@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: migration: Add incoming migration semaphore
......................................................................
Patch Set 2:
(2 comments)
https://gerrit.ovirt.org/#/c/45954/2/vdsm/virt/migration.py
File vdsm/virt/migration.py:
Line 330: dev._deviceXML, self._vm.conf, dev.custom)
Line 331: hooks.before_vm_migrate_source(self._vm._dom.XMLDesc(0),
Line 332: self._vm.conf)
Line 333:
Line 334: while True:
> we need something more robust then just retrying - there should be some kin
to me this looks good enough. Higher level logic is a cancel migration by engine which ultimately resolves all issues which cannot be handled by vdsm
Line 335: # Do not measure the time spent for creating the VM on the
Line 336: # destination. In some cases some expensive operations can
Line 337: # cause the migration to get cancelled right after the
Line 338: # transfer started.
Line 347: SourceThread._ongoingMigrations.release()
Line 348: # the destination is busy with incoming migrations
Line 349: # release semaphore and give other outgoing migrations
Line 350: # a chance
Line 351: time.sleep(5)
> see above
10 is fine, or more...
either way it needs to be a parameter in vdsm.conf at least
Line 352: SourceThread._ongoingMigrations.acquire()
Line 353: else:
Line 354: break
Line 355:
--
To view, visit https://gerrit.ovirt.org/45954
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8952f732033ed160292b11fbc0c4deac099b2b3e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
8 years, 8 months
Change in vdsm[ovirt-3.6]: configurator doesn't load pyc files under configurators folder
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: configurator doesn't load pyc files under configurators folder
......................................................................
configurator doesn't load pyc files under configurators folder
configurator loads dynamically modules from configurators folder. It
searches for py files only. In ovirt-node installation we install only pyc
files and this caused us to miss all configurators modules in ovirt-node
installation. The listmodules function now returns a set to avoid
duplicate module names.
Change-Id: Ia529de0069e2f4ec168a4b9df82ba62c56d66730
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1259247
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configurator.py
M tests/toolTests.py
2 files changed, 27 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/46011/1
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index 5ed905d..20924ba 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -29,9 +29,9 @@
from collections import deque
-from glob import iglob
import argparse
import os
+import re
import sys
import traceback
@@ -50,21 +50,18 @@
return __import__(pkg, globals(), locals(), [mname], level=0)
-def _listmodules(pkg):
+def _listmodules(path):
"""Return base file names for all modules under pkg."""
- path = os.path.join(os.path.abspath(pkg.__path__[0]), '')
- getmname = lambda x: os.path.basename(os.path.splitext(x)[0])
- filter_ = lambda x: not x.startswith('_')
-
- return [
- getmname(module)
- for module in iglob("%s*.py" % path)
- if filter_(getmname(module))
- ]
+ is_module = re.compile(r"^[^_].*\.pyc?$").search
+ return set(
+ os.path.splitext(name)[0]
+ for name in os.listdir(path)
+ if is_module(name)
+ )
_CONFIGURATORS = {}
-for module in _listmodules(configurators):
+for module in _listmodules(configurators.__path__[0]):
_CONFIGURATORS[module] = _import_module(configurators, module)
if not hasattr(_CONFIGURATORS[module], 'name'):
setattr(_CONFIGURATORS[module], 'name', module)
diff --git a/tests/toolTests.py b/tests/toolTests.py
index c8c7d1e..0c9666d 100644
--- a/tests/toolTests.py
+++ b/tests/toolTests.py
@@ -30,7 +30,8 @@
from vdsm.tool import upgrade
from vdsm import utils
import monkeypatch
-from testlib import VdsmTestCase
+from testlib import (VdsmTestCase, namedTemporaryDir, permutations,
+ expandPermutations)
from testValidation import ValidateRunningAsRoot
from unittest import TestCase
import tempfile
@@ -83,8 +84,24 @@
dict((m.name, m) for m in mockConfigurers))
+@expandPermutations
class PatchConfiguratorsTests(VdsmTestCase):
+ @permutations([(('a.py', 'b.py'), ('a', 'b')),
+ (('a.py', 'b.py', 'a.pyc', 'a.pyioas'), ('a', 'b')),
+ (('a.py', 'b.py', 'a.pyc', 'a.py'), ('a', 'b')),
+ (('a.py', 'b.py', 'a.pyc', '_my.py'), ('a', 'b'))])
+ def testListConfiguratorsModulesFolder(self, files, expected_modules):
+ expected = set(expected_modules)
+ with namedTemporaryDir() as path:
+ for f in files:
+ utils.touchFile(os.path.join(path, f))
+ result = configurator._listmodules(path)
+ self.assertEquals(
+ result,
+ expected,
+ )
+
def testPatch(self):
self.configurator = MockModuleConfigurator('a')
self.function_was_run = False
--
To view, visit https://gerrit.ovirt.org/46011
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia529de0069e2f4ec168a4b9df82ba62c56d66730
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
8 years, 8 months
Change in vdsm[ovirt-3.5]: Live merge: Update base size after live merge
by alitke@redhat.com
Hello Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/45950
to review the following change.
Change subject: Live merge: Update base size after live merge
......................................................................
Live merge: Update base size after live merge
When performing a live merge, data is copied from a top volume into a
base volume. If the top volume is larger than the base volume (which
can happen if the drive size was extended), libvirt will change the size
of the base volume to match that of the top volume. When synchronizing
metadata after the merge, we need to update the 'capacity' field of the
base volume to reflect the new size. We do this inside the
LiveMergeCleanupThread to ensure that it gets retried in the event of
storage connection problems or vdsm restarts.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251958
Change-Id: Iae354de36db63ae3bf4b4fc7f72df5e306035784
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/42921
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 25 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/45950/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 4ec4930..4e8faab 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5740,7 +5740,7 @@
def queryBlockJobs(self):
def startCleanup(job, drive, needPivot):
- t = LiveMergeCleanupThread(self, job['jobID'], drive, needPivot)
+ t = LiveMergeCleanupThread(self, job, drive, needPivot)
t.start()
self._liveMergeCleanupThreads[job['jobID']] = t
@@ -6086,11 +6086,11 @@
class LiveMergeCleanupThread(threading.Thread):
- def __init__(self, vm, jobId, drive, doPivot):
+ def __init__(self, vm, job, drive, doPivot):
threading.Thread.__init__(self)
self.setDaemon(True)
self.vm = vm
- self.jobId = jobId
+ self.job = job
self.drive = drive
self.doPivot = doPivot
self.success = False
@@ -6114,7 +6114,7 @@
self.vm.stopDisksStatsCollection()
self.vm.log.info("Requesting pivot to complete active layer commit "
- "(job %s)", self.jobId)
+ "(job %s)", self.job['jobID'])
try:
flags = libvirt.VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT
ret = self.vm._dom.blockJobAbort(self.drive.name, flags)
@@ -6124,22 +6124,39 @@
else:
if ret != 0:
self.vm.log.error("Pivot failed for job %s (rc=%i)",
- self.jobId, ret)
+ self.job['jobID'], ret)
raise RuntimeError("pivot failed")
self._waitForXMLUpdate()
- self.vm.log.info("Pivot completed (job %s)", self.jobId)
+ self.vm.log.info("Pivot completed (job %s)", self.job['jobID'])
+
+ def update_base_size(self):
+ # If the drive size was extended just after creating the snapshot which
+ # we are removing, the size of the top volume might be larger than the
+ # size of the base volume. In that case libvirt has enlarged the base
+ # volume automatically as part of the blockCommit operation. Update
+ # our metadata to reflect this change.
+ topVolUUID = self.job['topVolume']
+ baseVolUUID = self.job['baseVolume']
+ topVolInfo = self.vm._getVolumeInfo(self.drive.domainID,
+ self.drive.poolID,
+ self.drive.imageID, topVolUUID)
+ self.vm._setVolumeSize(self.drive.domainID, self.drive.poolID,
+ self.drive.imageID, baseVolUUID,
+ topVolInfo['capacity'])
@utils.traceback()
def run(self):
+ self.update_base_size()
if self.doPivot:
self.tryPivot()
self.vm.log.info("Synchronizing volume chain after live merge "
- "(job %s)", self.jobId)
+ "(job %s)", self.job['jobID'])
self.vm._syncVolumeChain(self.drive)
if self.doPivot:
self.vm.startDisksStatsCollection()
self.success = True
- self.vm.log.info("Synchronization completed (job %s)", self.jobId)
+ self.vm.log.info("Synchronization completed (job %s)",
+ self.job['jobID'])
def isSuccessful(self):
"""
--
To view, visit https://gerrit.ovirt.org/45950
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae354de36db63ae3bf4b4fc7f72df5e306035784
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
8 years, 8 months
Change in vdsm[ovirt-3.5]: virt: Introduce Vm._setVolumeSize helper
by alitke@redhat.com
Hello Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/45949
to review the following change.
Change subject: virt: Introduce Vm._setVolumeSize helper
......................................................................
virt: Introduce Vm._setVolumeSize helper
We have two place invoking self.cif.irs.setVolumeSize(), ignoring errors
without documenting the reason. This patch adds Vm._setVolumeSize()
helper that raises on errors, eliminating such code.
We use setVolumeSize() when extending a disk. First we set volume size to
0, marking it as in transaction. Then we update the guest about the new
size via libvirt, and finally we store the new size in the volume.
In the first setVolumeSize() call setting volume size to 0, it is clear
that we want to fail the operation, so using _setVolumeSize() the
request fails without additional error handling code.
The second setVolumeSize() call updating the volume to the actual new
size is done after the vm was updated and can use the new device, so it
is not clear if we should fail the request or just warn about the
incorrect meta data in the volume (size=0). This patches changes the
behavior to fail the request in this case.
Change-Id: I742fde77a23387f89fa746c2030e151237cb230f
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/37943
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-by: Adam Litke <alitke(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251958
---
M vdsm/virt/vm.py
1 file changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/45949/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index e656a63..4ec4930 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4704,8 +4704,8 @@
return errCode['resizeErr']
# Uncommit the current volume size (mark as in transaction)
- self.cif.irs.setVolumeSize(drive.domainID, drive.poolID,
- drive.imageID, drive.volumeID, 0)
+ self._setVolumeSize(drive.domainID, drive.poolID, drive.imageID,
+ drive.volumeID, 0)
try:
self._dom.blockResize(drive.name, newSizeBytes,
@@ -4719,9 +4719,8 @@
# In all cases we want to try and fix the size in the metadata.
# Same as above, this is what libvirt would do, see BZ#963881
sizeRoundedBytes = qemuimg.info(drive.path, "qcow2")['virtualsize']
- self.cif.irs.setVolumeSize(
- drive.domainID, drive.poolID, drive.imageID, drive.volumeID,
- sizeRoundedBytes)
+ self._setVolumeSize(drive.domainID, drive.poolID, drive.imageID,
+ drive.volumeID, sizeRoundedBytes)
return {'status': doneCode, 'size': str(sizeRoundedBytes)}
@@ -6077,6 +6076,14 @@
(domainID, volumeID))
return res['info']
+ def _setVolumeSize(self, domainID, poolID, imageID, volumeID, size):
+ res = self.cif.irs.setVolumeSize(domainID, poolID, imageID, volumeID,
+ size)
+ if res['status']['code'] != 0:
+ raise StorageUnavailableError(
+ "Unable to set volume size to %s for domain %s volume %s" %
+ (size, domainID, volumeID))
+
class LiveMergeCleanupThread(threading.Thread):
def __init__(self, vm, jobId, drive, doPivot):
--
To view, visit https://gerrit.ovirt.org/45949
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I742fde77a23387f89fa746c2030e151237cb230f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
8 years, 8 months
Change in vdsm[ovirt-3.5]: Live Merge: Allow extension of non-leaf raw volumes
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: Live Merge: Allow extension of non-leaf raw volumes
......................................................................
Live Merge: Allow extension of non-leaf raw volumes
volume.extendSize() is currently prohibited for any non-leaf volume.
For a very specific live merge scenario we must permit extension of an
internal raw base volume. Allow this usage and add a comment explaining
the reasoning.
The scenario:
- User begins with a raw block disk.
- User creates a snapshot.
- User enlarges the disk (diskSizeExtend)
- User performs live merge to remove the snapshot
In this case the base volume is too small to accommodate the data
from the child volume and an error is raised since libvirt cannot
enlarge a block device. The solution is to require engine to call
extendVolumeSize on the base volume before requesting the live merge
operation.
Change-Id: I82a73356a863abe39d367cdc70a9b1e914f75aee
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251958
Reviewed-on: https://gerrit.ovirt.org/43407
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/volume.py
1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/45948/1
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 75fa1c4..0cd6de6 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -548,11 +548,10 @@
"""
Extend the size (virtual disk size seen by the guest) of the volume.
"""
- if not self.isLeaf() or self.isShared():
+ if self.isShared():
raise se.VolumeNonWritable(self.volUUID)
volFormat = self.getFormat()
-
if volFormat == COW_FORMAT:
self.log.debug("skipping cow size extension for volume %s to "
"size %s", self.volUUID, newSize)
@@ -560,6 +559,14 @@
elif volFormat != RAW_FORMAT:
raise se.IncorrectFormat(self.volUUID)
+ # Note: This function previously prohibited extending non-leaf volumes.
+ # If a disk is enlarged a volume may become larger than its parent. In
+ # order to support live merge of a larger volume into its raw parent we
+ # must permit extension of this raw volume prior to starting the merge.
+ isBase = self.getParent() == BLANK_UUID
+ if not (isBase or self.isLeaf()):
+ raise se.VolumeNonWritable(self.volUUID)
+
curRawSize = self.getVolumeSize()
if (newSize < curRawSize):
--
To view, visit https://gerrit.ovirt.org/45948
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82a73356a863abe39d367cdc70a9b1e914f75aee
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
8 years, 8 months