cinder : extend volume Error

Bug #1240287 reported by Hyun Ha
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
John Griffith

Bug Description

On the environment where using Cinder LVM driver, extend_volume fails like the following.

# cinder extend 9dd8b44a-6835-40a6-ad9d-a103c25c532d 2
# cinder list
+--------------------------------------+-----------------+----------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------------+----------------+------+-------------+----------+-------------+
| 9dd8b44a-6835-40a6-ad9d-a103c25c532d | error_extending | test03 | 1 | None | false | |
+--------------------------------------+-----------------+----------------+------+-------------+----------+-------------+

2013-10-16 09:00:05.573 19511 ERROR cinder.brick.local_dev.lvm [req-5ef88a15-b50d-4135-ad7c-926ad3cc8e5d e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] Error extending Volume
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm Traceback (most recent call last):
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm File "/opt/openstack/cinder/cinder/brick/local_dev/lvm.py", line 469, in extend_volume
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm run_as_root=True)
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm File "/opt/openstack/cinder/cinder/utils.py", line 142, in execute
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm return processutils.execute(*cmd, **kwargs)
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm File "/opt/openstack/cinder/cinder/openstack/common/processutils.py", line 173, in execute
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm cmd=' '.join(cmd))
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm ProcessExecutionError: Unexpected error while running command.
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm Command: sudo cinder-rootwrap /opt/openstack/cinder/etc/cinder/rootwrap.conf lvextend -L 2 cinder-volumes/volume-9dd8b44a-6835-40a6-ad9d-a103c25c532d
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm Exit code: 3
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm Stdout: ' Rounding up size to full physical extent 4.00 MiB\n'
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm Stderr: " New size given (1 extents) not larger than existing size (256 extents)\n Run `lvextend --help' for more information.\n"
2013-10-16 09:00:05.573 19511 TRACE cinder.brick.local_dev.lvm
2013-10-16 09:00:05.577 19511 ERROR cinder.brick.local_dev.lvm [req-5ef88a15-b50d-4135-ad7c-926ad3cc8e5d e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] Cmd :sudo cinder-rootwrap /opt/openstack/cinder/etc/cinder/rootwrap.conf lvextend -L 2 cinder-volumes/volume-9dd8b44a-6835-40a6-ad9d-a103c25c532d
2013-10-16 09:00:05.580 19511 ERROR cinder.brick.local_dev.lvm [req-5ef88a15-b50d-4135-ad7c-926ad3cc8e5d e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] StdOut : Rounding up size to full physical extent 4.00 MiB

2013-10-16 09:00:05.580 19511 ERROR cinder.brick.local_dev.lvm [req-5ef88a15-b50d-4135-ad7c-926ad3cc8e5d e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] StdErr : New size given (1 extents) not larger than existing size (256 extents)
  Run `lvextend --help' for more information.

# cinder help extend
usage: cinder extend <volume> <new-size>

Attempt to extend the size of an existing volume.

Positional arguments:
  <volume> Name or ID of the volume to extend.
  <new-size> New size of volume in GB

In cinder cli, the integer of 'new-size' is in GB .
But In LVM command, (lvextend -L 2 cinder-volumes/volume-9dd8b44a-6835-40a6-ad9d-a103c25c532d ) '-L 2' is in MB.

so, If I really want to extend size of volume, 1 GB to 2 GB, I have to try like the following.

# cinder extend 54a7125f-3a8f-48dc-a8b8-8f623c742ecb 2048
# cinder list
+--------------------------------------+-----------------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------------+--------------+------+-------------+----------+-------------+
| 54a7125f-3a8f-48dc-a8b8-8f623c742ecb | available | haha-vol01 | 2048 | None | false | |
| 9dd8b44a-6835-40a6-ad9d-a103c25c532d | error_extending | test03 | 1 | None | false | |
+--------------------------------------+-----------------+--------------+------+-------------+----------+-------------+
# lvs

  LV VG Attr LSize Origin Snap% Move Log Copy% Convert
  volume-54a7125f-3a8f-48dc-a8b8-8f623c742ecb cinder-volumes -wi-ao 2.00g

please check this bug. Thank you.

Hyun Ha (raymon-ha)
description: updated
description: updated
description: updated
description: updated
Hyun Ha (raymon-ha)
summary: - cinder extend
+ cinder : extend volume Error
Changed in cinder:
status: New → Triaged
assignee: nobody → John Griffith (john-griffith)
milestone: none → havana-rc3
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/51989
Committed: http://github.com/openstack/cinder/commit/ec442e41d2d243003a42ed60ae862e96142a5cde
Submitter: Jenkins
Branch: master

commit ec442e41d2d243003a42ed60ae862e96142a5cde
Author: John Griffith <email address hidden>
Date: Tue Oct 15 19:13:45 2013 -0600

    Fix lvm.extend_volume to pass Gig suffix

    The extend function in the lvm driver was not converting
    the cinder size value to Gigabytes before passing the call
    to the vg module. The result was that we would attempt to
    extend a volume to "new size in Megabytes" which of course
    is less than the current size since we do a Gigabyte string
    conversion on create and everywhere else.

    This change makes sure we pass the integer change through
    the sizestr method to get the G suffix needed to work properly.

    Change-Id: I070962a3aa7038f612e19a93ccaa60cbc13008f6
    Closes-Bug: #1240287

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

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/51998

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (milestone-proposed)

Reviewed: https://review.openstack.org/51998
Committed: http://github.com/openstack/cinder/commit/bdb5d982d069ac6464c8ef857a0f95dde02005de
Submitter: Jenkins
Branch: milestone-proposed

commit bdb5d982d069ac6464c8ef857a0f95dde02005de
Author: John Griffith <email address hidden>
Date: Tue Oct 15 19:13:45 2013 -0600

    Fix lvm.extend_volume to pass Gig suffix

    The extend function in the lvm driver was not converting
    the cinder size value to Gigabytes before passing the call
    to the vg module. The result was that we would attempt to
    extend a volume to "new size in Megabytes" which of course
    is less than the current size since we do a Gigabyte string
    conversion on create and everywhere else.

    This change makes sure we pass the integer change through
    the sizestr method to get the G suffix needed to work properly.

    Change-Id: I070962a3aa7038f612e19a93ccaa60cbc13008f6
    Closes-Bug: #1240287
    (cherry picked from commit ec442e41d2d243003a42ed60ae862e96142a5cde)

Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-rc3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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