Skip to content

Commit

Permalink
Fix lvm.extend_volume to pass Gig suffix
Browse files Browse the repository at this point in the history
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 ec442e4)
  • Loading branch information
j-griffith committed Oct 16, 2013
1 parent 5e489f4 commit bdb5d98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cinder/volume/drivers/lvm.py
Expand Up @@ -380,7 +380,8 @@ def _update_volume_stats(self):

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):
Expand Down

0 comments on commit bdb5d98

Please sign in to comment.