Federico Simoncelli has uploaded a new change for review.
Change subject: [wip] hsm: remove superfluous refreshes at startup
......................................................................
[wip] hsm: remove superfluous refreshes at startup
During the startup it's not mandatory to refresh the iscsi connections
(the sdcache is already stale) and the lvm module can handle the lazy
initialization.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=870768
Change-Id: I8386d40c644c99a52f04b6b41b392abf16e3a2a6
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/9276/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 46d1605..6a5040a 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -364,9 +364,6 @@
self.log.warn("Failed to clean Storage Repository.", exc_info=True)
def storageRefresh():
- lvm._lvminfo.bootstrap()
- sdCache.refreshStorage()
-
fileUtils.createdir(self.tasksDir)
# TBD: Should this be run in connectStoragePool? Should tasksDir
# exist under pool link as well (for hsm tasks)
--
To view, visit http://gerrit.ovirt.org/9276
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8386d40c644c99a52f04b6b41b392abf16e3a2a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: [WIP] Add the validateImage command to the SPM
......................................................................
[WIP] Add the validateImage command to the SPM
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-Id: I095362e7d1eb91045569bd9526a102392e7adbe8
---
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/storage/hsm.py
M vdsm/storage/image.py
M vdsm/storage/sp.py
M vdsm/storage/volume.py
6 files changed, 60 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/3491/1
--
To view, visit http://gerrit.ovirt.org/3491
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I095362e7d1eb91045569bd9526a102392e7adbe8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: image: copying a template is always allowed
......................................................................
image: copying a template is always allowed
To copy a template from a domain to another is a safe action even if
it has images that are based on it. This patch relaxes the check during
moveImage if the operation is a copy.
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-Id: I9e07d569eec02ac4dcd386a7c576342f640ec242
---
M vdsm/storage/hsm.py
1 file changed, 19 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8408/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 50d6ce1..730ee03 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1288,32 +1288,39 @@
self._spmSchedule(spUUID, "deleteImage", lambda : True)
- def validateImageMove(self, srcDom, dstDom, imgUUID):
+ def validateImageCopy(self, srcDom, dstDom, imgUUID, safeToMove=False):
"""
- Determines if the image move is legal.
+ Determines if it is possible to copy (or move) the image.
- Moving an image based on a template to a data domain is only allowed if
- the template exists on the target domain.
- Moving a template from a data domain is only allowed if there are no
- images based on it in the source data domain.
+ Copying or moving an image based on a template to a data domain is
+ allowed only if the template already exists on the target domain.
+ When the option safeToMove (default: False) is active (True) an
+ extra check makes sure that if the image is a template (on a data
+ domain) then there are no other images based on it and therefore it
+ is safe to remove it.
"""
srcAllVols = srcDom.getAllVolumes()
dstAllVols = dstDom.getAllVolumes()
# Filter volumes related to this image
srcVolsImgs = sd.getVolsOfImage(srcAllVols, imgUUID)
+
# Find the template
for volName, imgsPar in srcVolsImgs.iteritems():
if len(imgsPar.imgs) > 1:
# This is the template. Should be only one.
tName, tImgs = volName, imgsPar.imgs
+
# Template self image is the 1st entry
if imgUUID != tImgs[0] and tName not in dstAllVols.keys():
- self.log.error("img %s can't be moved to dom %s because "
- "template %s is absent on it", imgUUID, dstDom.sdUUID, tName)
+ self.log.error("Cannot move image %s to domain %s "
+ "because the template %s is missing on the "
+ "destination", imgUUID, dstDom.sdUUID, tName)
raise se.ImageDoesNotExistInSD(imgUUID, dstDom.sdUUID)
- elif imgUUID == tImgs[0] and not srcDom.isBackup():
+ elif (safeToMove and imgUUID == tImgs[0]
+ and not srcDom.isBackup()):
raise se.MoveTemplateImageError(imgUUID)
+
break
return True
@@ -1333,7 +1340,8 @@
srcDom = self.validateSdUUID(srcDomUUID)
dstDom = self.validateSdUUID(dstDomUUID)
pool = self.getPool(spUUID) #Validates that the pool is connected. WHY?
- self.validateImageMove(srcDom, dstDom, imgUUID)
+ self.validateImageCopy(srcDom, dstDom, imgUUID,
+ safeToMove=(op != image.COPY_OP))
domains = [srcDomUUID, dstDomUUID]
domains.sort()
@@ -1364,7 +1372,7 @@
images = {}
for (imgUUID, pZero) in imgDict.iteritems():
images[imgUUID.strip()] = misc.parseBool(pZero)
- self.validateImageMove(srcDom, dstDom, imgUUID)
+ self.validateImageCopy(srcDom, dstDom, imgUUID, safeToMove=True)
domains = sorted([srcDomUUID, dstDomUUID])
for dom in domains:
--
To view, visit http://gerrit.ovirt.org/8408
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e07d569eec02ac4dcd386a7c576342f640ec242
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>