Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Previously, an error would occur when using "moveImage" from the Rest API when the image did not exist in the source domain and an internal parameter "force" was set. VDSM would try to delete the image even though it did not exist and the task failed.
VDSM now validates if the image exists and will output an error message if no source volumes are found.
Description of problem:
moveImage operation (with copy operand) fails since function is called with 'force' value in 'true' as vdsm tries to delete the image even if it doesn't exists, exception is not caught, and task is failing.
def move(self, srcSdUUID, dstSdUUID, imgUUID, vmUUID, op, postZero, force):
"""
...
destDom = sdCache.produce(dstSdUUID)
# If image already exists check whether it illegal/fake, overwrite it
if not self.isLegal(destDom.sdUUID, imgUUID):
force = True
# We must first remove the previous instance of image (if exists)
# in destination domain, if we got the overwrite command
if force:
self.log.info("delete image %s on domain %s before overwriting", imgUUID, destDom.sdUUID)
_deleteImage(destDom, imgUUID, postZero)
chains = self._createTargetImage(destDom, srcSdUUID, imgUUID)
self._interImagesCopy(destDom, srcSdUUID, imgUUID, chains)
self._finalizeDestinationImage(destDom, imgUUID, chains, force)
if force:
leafVol = chains['dstChain'][-1]
# Now we should re-link all deleted hardlinks, if exists
self.__templateRelink(destDom, imgUUID, leafVol.volUUID)
we are hitting this issue in API tests where 'force' is always true (another bug).
excepted results:
vdsm should be more robust and validate if image exists before it tries to delete it or use try: except: method.
Comment 5Eduardo Warszawski
2012-11-13 14:34:39 UTC
This is not a regression.
You should not use force parameter for overriding a non-existent image.
And non-inexistent images can't be removed.
Rest API should not send force in every call.
d05470ea-9e55-4598-97cc-cc779adfe02d::ERROR::2012-11-13 06:09:00,478::task::853::TaskManager.Task::(_setError) Task=`d05470ea-9e55-4598-97cc-cc779adfe02d`::Unexpected error
Traceback (most recent call last):
File "/usr/share/vdsm/storage/task.py", line 861, in _run
return fn(*args, **kargs)
File "/usr/share/vdsm/storage/task.py", line 320, in run
return self.cmd(*self.argslist, **self.argsdict)
File "/usr/share/vdsm/storage/securable.py", line 63, in wrapper
return f(self, *args, **kwargs)
File "/usr/share/vdsm/storage/sp.py", line 1741, in moveImage
image.Image(repoPath).move(srcDomUUID, dstDomUUID, imgUUID, vmUUID, op, postZero, force)
File "/usr/share/vdsm/storage/image.py", line 628, in move
_deleteImage(destDom, imgUUID, postZero)
File "/usr/share/vdsm/storage/image.py", line 80, in _deleteImage
dom.deleteImage(dom.sdUUID, imgUUID, imgVols)
File "/usr/share/vdsm/storage/blockSD.py", line 945, in deleteImage
deleteVolumes(sdUUID, toDel)
File "/usr/share/vdsm/storage/blockSD.py", line 177, in deleteVolumes
lvm.removeLVs(sdUUID, vols)
File "/usr/share/vdsm/storage/lvm.py", line 1010, in removeLVs
raise se.CannotRemoveLogicalVolume(vgName, str(lvNames))
CannotRemoveLogicalVolume: Cannot remove Logical Volume: ('065747fa-57d3-435a-81f0-448a9210191a', '()')
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHSA-2012-1508.html
Description of problem: moveImage operation (with copy operand) fails since function is called with 'force' value in 'true' as vdsm tries to delete the image even if it doesn't exists, exception is not caught, and task is failing. def move(self, srcSdUUID, dstSdUUID, imgUUID, vmUUID, op, postZero, force): """ ... destDom = sdCache.produce(dstSdUUID) # If image already exists check whether it illegal/fake, overwrite it if not self.isLegal(destDom.sdUUID, imgUUID): force = True # We must first remove the previous instance of image (if exists) # in destination domain, if we got the overwrite command if force: self.log.info("delete image %s on domain %s before overwriting", imgUUID, destDom.sdUUID) _deleteImage(destDom, imgUUID, postZero) chains = self._createTargetImage(destDom, srcSdUUID, imgUUID) self._interImagesCopy(destDom, srcSdUUID, imgUUID, chains) self._finalizeDestinationImage(destDom, imgUUID, chains, force) if force: leafVol = chains['dstChain'][-1] # Now we should re-link all deleted hardlinks, if exists self.__templateRelink(destDom, imgUUID, leafVol.volUUID) we are hitting this issue in API tests where 'force' is always true (another bug). excepted results: vdsm should be more robust and validate if image exists before it tries to delete it or use try: except: method.