Adam Litke has uploaded a new change for review. Change subject: storage: Clean up image links during teardownImage ......................................................................
storage: Clean up image links during teardownImage In commit 736ab9 we began cleaning up volume links that were created in /var/run/vdsm/images/... Unfortunately on block domains we are leaving around a broken symlink in /rhev/data-center/... in some cases and this will cause storage operations related to a disk of a VM that was previously running to fail on this host. The solution is to also remove this broken symlink during teardownImage. Change-Id: I5fb871f3ccd785c555c72db34ab818c04d000534 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1319987 Signed-off-by: Adam Litke <ali...@redhat.com> --- M vdsm/storage/blockSD.py M vdsm/storage/fileSD.py M vdsm/storage/hsm.py 3 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/55227/1 diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py index 4445ca1..42d6c58 100644 --- a/vdsm/storage/blockSD.py +++ b/vdsm/storage/blockSD.py @@ -1140,6 +1140,12 @@ raise return dst + def unlinkBCImage(self, imgUUID): + img_path = self.getLinkBCImagePath(imgUUID) + if os.path.islink(img_path): + self.log.debug("Removing image directory link %r", img_path) + os.unlink(img_path) + def createImageLinks(self, srcImgPath, imgUUID, volUUIDs): """ qcow chain is built by reading each qcow header and reading the path diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index ae8fb10..65fd100 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -502,6 +502,10 @@ # Nothing to do here other than returning the path return self.getLinkBCImagePath(imgUUID) + def unlinkBCImage(self, imgUUID): + # Nothing to do since linkBCImage is a no-op + pass + def createImageLinks(self, srcImgPath, imgUUID): """ qcow chain is built by reading each qcow header and reading the path diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 881f337..c4305bd 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -3235,6 +3235,7 @@ vars.task.getSharedLock(STORAGE, sdUUID) dom = sdCache.produce(sdUUID) + dom.unlinkBCImage(imgUUID) dom.deactivateImage(imgUUID) @public -- To view, visit https://gerrit.ovirt.org/55227 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fb871f3ccd785c555c72db34ab818c04d000534 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <ali...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches