LVM driver: volume with snaps can't be extended

Bug #1470558 reported by Jordan Pittier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Curt Bruns
Kilo
Fix Released
Undecided
Unassigned

Bug Description

Tested on cinder master

How to reproduce:
1) cinder create --volume-type lvmdriver-1 1
2) cinder snapshot-create $vol_id
3) cinder extend $vol_id 2

The volume extend fails with the following stack trace in c-vol:

 DEBUG oslo_concurrency.processutils [req-10e33803-cad2-49e0-bb51-4a51c0a81154 453f71416a7542cdbe5271437ce3411d 73f423eb4bfa44b0ae8301d9188a3225] u'sudo cinder-ro
otwrap /etc/cinder/rootwrap.conf lvextend -L 2g stack-volumes-lvmdriver-1/volume-d28570df-c058-47ba-b950-8e7f2e000d78' failed. Not Retrying. from (pid=29212) execute /usr/local/lib/pyth
on2.7/dist-packages/oslo_concurrency/processutils.py:273
 ERROR cinder.brick.local_dev.lvm [req-10e33803-cad2-49e0-bb51-4a51c0a81154 453f71416a7542cdbe5271437ce3411d 73f423eb4bfa44b0ae8301d9188a3225] Error extending Vol
ume
 TRACE cinder.brick.local_dev.lvm Traceback (most recent call last):
 TRACE cinder.brick.local_dev.lvm File "/opt/stack/cinder/cinder/brick/local_dev/lvm.py", line 704, in extend_volume
 TRACE cinder.brick.local_dev.lvm run_as_root=True)
 TRACE cinder.brick.local_dev.lvm File "/opt/stack/cinder/cinder/utils.py", line 143, in execute
 TRACE cinder.brick.local_dev.lvm return processutils.execute(*cmd, **kwargs)
 TRACE cinder.brick.local_dev.lvm File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py", line 240, in execute
 TRACE cinder.brick.local_dev.lvm cmd=sanitized_cmd)
 TRACE cinder.brick.local_dev.lvm ProcessExecutionError: Unexpected error while running command.
 TRACE cinder.brick.local_dev.lvm Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvextend -L 2g stack-volumes-lvmdriver-1/volume-d28570df-c058-47ba-b950-
8e7f2e000d78
 TRACE cinder.brick.local_dev.lvm Exit code: 5
 TRACE cinder.brick.local_dev.lvm Stdout: u''
 TRACE cinder.brick.local_dev.lvm Stderr: u' Snapshot origin volumes can be resized only while inactive: try lvchange -an\n'
 TRACE cinder.brick.local_dev.lvm
ERROR cinder.brick.local_dev.lvm [req-10e33803-cad2-49e0-bb51-4a51c0a81154 453f71416a7542cdbe5271437ce3411d 73f423eb4bfa44b0ae8301d9188a3225] Cmd :sudo cinde
r-rootwrap /etc/cinder/rootwrap.conf lvextend -L 2g stack-volumes-lvmdriver-1/volume-d28570df-c058-47ba-b950-8e7f2e000d78
 ERROR cinder.brick.local_dev.lvm [req-10e33803-cad2-49e0-bb51-4a51c0a81154 453f71416a7542cdbe5271437ce3411d 73f423eb4bfa44b0ae8301d9188a3225] StdOut :
 ERROR cinder.brick.local_dev.lvm [req-10e33803-cad2-49e0-bb51-4a51c0a81154 453f71416a7542cdbe5271437ce3411d 73f423eb4bfa44b0ae8301d9188a3225] StdErr : Snapshot
 origin volumes can be resized only while inactive: try lvchange -an

The volume status become "error_extending"

Amador Pahim (apahim)
Changed in cinder:
status: New → Confirmed
Revision history for this message
Lisa Li (lisali) wrote :

Should the extent be prohibited in Openstack?

Lisa Li (lisali)
Changed in cinder:
assignee: nobody → Lisa Li (lisali)
Revision history for this message
Lisa Li (lisali) wrote :

The behaviors are different for back-end storage.

Changed in cinder:
assignee: Lisa Li (lisali) → nobody
Revision history for this message
John Griffith (john-griffith) wrote :

Extend is perfectly valid, doing extend in the scenario you describe just require a deactivate command which is fine.

Changed in cinder:
status: Confirmed → Triaged
importance: Undecided → Medium
assignee: nobody → John Griffith (john-griffith)
milestone: none → liberty-2
Changed in cinder:
status: Triaged → In Progress
tags: added: kilo-backport-potential
Changed in cinder:
assignee: John Griffith (john-griffith) → Curt Bruns (curt-e-bruns)
Mike Perez (thingee)
Changed in cinder:
milestone: liberty-2 → liberty-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/198813
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=314611f79afa6fe79f3d5022c814772048669bb0
Submitter: Jenkins
Branch: master

commit 314611f79afa6fe79f3d5022c814772048669bb0
Author: Curt Bruns <email address hidden>
Date: Mon Jul 6 15:09:41 2015 +0000

    Add deactivate step to extend_lv

    Extending a linear LVM volume that has a snapshot requires
    that the LV be deactivated explicitly prior to extending.

    This adds a deactivate_lv method and calls it prior to
    issuing the extend call. If auto_activation_volume_list
    is not defined lvm.conf, then volumes will be reactivated
    automatically after the extend. If auto_activation_volume_list
    is defined, then volumes that should be automatically
    reactivated should be added to the auto_activation_volume_list
    or they won't be activated automatically.
    NOTE: This doesn't apply to thin provisioned LVs as they don't
    require the deactivation step.

    DocImpact: When a user extends LVM Volumes with a snapshot, the
    volumes will be deactivated. Their re-activation is automatic,
    unless auto_activation_volume_list is defined in lvm.conf.
    See lvm.conf for more info. Thin provisioned LVM Volumes
    will not be deactivated as they don't require it.

    Co-Authored-By: John Griffith <email address hidden>
    Change-Id: If746625cfe658c3528525dc7f4bf869f1c9704dc
    Closes-Bug: #1470558

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/206935

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/209993

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/juno)

Change abandoned by Jordan Pittier (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/209993
Reason: Will do Matt's way.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/kilo)

Reviewed: https://review.openstack.org/206935
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=4d2794527ead282514f7019ce8a9b58d2817eda3
Submitter: Jenkins
Branch: stable/kilo

commit 4d2794527ead282514f7019ce8a9b58d2817eda3
Author: Curt Bruns <email address hidden>
Date: Mon Jul 6 15:09:41 2015 +0000

    Add deactivate step to extend_lv

    Extending a linear LVM volume that has a snapshot requires
    that the LV be deactivated explicitly prior to extending.

    This adds a deactivate_lv method and calls it prior to
    issuing the extend call. If auto_activation_volume_list
    is not defined lvm.conf, then volumes will be reactivated
    automatically after the extend. If auto_activation_volume_list
    is defined, then volumes that should be automatically
    reactivated should be added to the auto_activation_volume_list
    or they won't be activated automatically.
    NOTE: This doesn't apply to thin provisioned LVs as they don't
    require the deactivation step.

    DocImpact: When a user extends LVM Volumes with a snapshot, the
    volumes will be deactivated. Their re-activation is automatic,
    unless auto_activation_volume_list is defined in lvm.conf.
    See lvm.conf for more info. Thin provisioned LVM Volumes
    will not be deactivated as they don't require it.

    Conflicts:
            cinder/tests/brick/test_brick_lvm.py

    Co-Authored-By: John Griffith <email address hidden>
    Change-Id: If746625cfe658c3528525dc7f4bf869f1c9704dc
    Closes-Bug: #1470558
    (cherry picked from commit 314611f79afa6fe79f3d5022c814772048669bb0)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
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.