Fail to remove logical volume

Bug #1358552 reported by warewang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
warewang

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

warewang (wangguangcai)
Changed in nova:
assignee: nobody → warewang (wangguangcai)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/115169

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → High
milestone: none → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/115169
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ce2031afb2e42c756c065f423126ffd1a61b820a
Submitter: Jenkins
Branch: master

commit ce2031afb2e42c756c065f423126ffd1a61b820a
Author: warewang <email address hidden>
Date: Tue Aug 19 08:31:58 2014 +0800

    FIX: Fail to remove the logical volume

    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.

    Change-Id: I222f6c5cfe5be63105f2fd8afd7ccd209ca2e5f7
    Closes-Bug: #1358552

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.