summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Griffith <john.griffith@solidfire.com>2013-10-15 19:13:45 -0600
committerJohn Griffith <john.griffith@solidfire.com>2013-10-15 21:33:00 -0600
commitbdb5d982d069ac6464c8ef857a0f95dde02005de (patch)
treea9f05480c47d9e40d659eed63199f2654a2d19b1
parent5e489f475f4fe0529280f419b4708aa22c13ad39 (diff)
downloadcinder-bdb5d982d069ac6464c8ef857a0f95dde02005de.tar.gz
Fix lvm.extend_volume to pass Gig suffix2013.2.rc32013.2
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)
-rw-r--r--cinder/volume/drivers/lvm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py
index 862fe238f..1b37cbf8f 100644
--- a/cinder/volume/drivers/lvm.py
+++ b/cinder/volume/drivers/lvm.py
@@ -380,7 +380,8 @@ class LVMVolumeDriver(driver.VolumeDriver):
def extend_volume(self, volume, new_size):
"""Extend an existing voumes size."""
- self.vg.extend_volume(volume['name'], new_size)
+ self.vg.extend_volume(volume['name'],
+ self._sizestr(new_size))
class LVMISCSIDriver(LVMVolumeDriver, driver.ISCSIDriver):