yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #19229
[Bug 1358552] [NEW] Fail to remove logical volume
Public bug reported:
The logical volume can not be removed when delete VM error. I look at
the code, found that parameter is a list in the libvirt's lvm, but in
imagebackend, parameters passed is a string.
in the Libvirt's LVM
def remove_volumes(paths): ## #the path is list
"""Remove one or more logical volume."""
errors = []
for path in paths:
clear_volume(path)
lvremove = ('lvremove', '-f', path)
try:
utils.execute(*lvremove, attempts=3, run_as_root=True)
except processutils.ProcessExecutionError as exp:
errors.append(str(exp))
if errors:
raise exception.VolumesNotRemoved(reason=(', ').join(errors))
in the imagebackend's LVM
@contextlib.contextmanager
def remove_volume_on_error(self, path):
try:
yield
except Exception:
with excutils.save_and_reraise_exception():
lvm.remove_volumes(path) ### the path is string
** Affects: nova
Importance: Undecided
Assignee: warewang (wangguangcai)
Status: New
** Changed in: nova
Assignee: (unassigned) => warewang (wangguangcai)
** Description changed:
- The logical volume can not be removed when create VM error. I look at
+ The logical volume can not be removed when delete VM error. I look at
the code, found that parameter is a list in the libvirt's lvm, but in
imagebackend, parameters passed is a string.
in the Libvirt's LVM
def remove_volumes(paths): ## #the path is list
- """Remove one or more logical volume."""
+ """Remove one or more logical volume."""
- errors = []
- for path in paths:
- clear_volume(path)
- lvremove = ('lvremove', '-f', path)
- try:
- utils.execute(*lvremove, attempts=3, run_as_root=True)
- except processutils.ProcessExecutionError as exp:
- errors.append(str(exp))
- if errors:
- raise exception.VolumesNotRemoved(reason=(', ').join(errors))
+ errors = []
+ for path in paths:
+ clear_volume(path)
+ lvremove = ('lvremove', '-f', path)
+ try:
+ utils.execute(*lvremove, attempts=3, run_as_root=True)
+ except processutils.ProcessExecutionError as exp:
+ errors.append(str(exp))
+ if errors:
+ raise exception.VolumesNotRemoved(reason=(', ').join(errors))
in the imagebackend's LVM
- @contextlib.contextmanager
- def remove_volume_on_error(self, path):
- try:
- yield
- except Exception:
- with excutils.save_and_reraise_exception():
- lvm.remove_volumes(path) ### the path is string
+ @contextlib.contextmanager
+ def remove_volume_on_error(self, path):
+ try:
+ yield
+ except Exception:
+ with excutils.save_and_reraise_exception():
+ lvm.remove_volumes(path) ### the path is string
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1358552
Title:
Fail to remove logical volume
Status in OpenStack Compute (Nova):
New
Bug description:
The logical volume can not be removed when delete VM error. I look at
the code, found that parameter is a list in the libvirt's lvm, but in
imagebackend, parameters passed is a string.
in the Libvirt's LVM
def remove_volumes(paths): ## #the path is list
"""Remove one or more logical volume."""
errors = []
for path in paths:
clear_volume(path)
lvremove = ('lvremove', '-f', path)
try:
utils.execute(*lvremove, attempts=3, run_as_root=True)
except processutils.ProcessExecutionError as exp:
errors.append(str(exp))
if errors:
raise exception.VolumesNotRemoved(reason=(', ').join(errors))
in the imagebackend's LVM
@contextlib.contextmanager
def remove_volume_on_error(self, path):
try:
yield
except Exception:
with excutils.save_and_reraise_exception():
lvm.remove_volumes(path) ### the path is string
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1358552/+subscriptions
Follow ups
References