Skip to content

Commit

Permalink
Add _create_volume to ThinLVMVolumeDriver
Browse files Browse the repository at this point in the history
Previously, _create_volume from LVMISCSIDriver would be called
when the volume manager calls create_volume_from_snapshot.

Fixes bug: 1192601

Change-Id: I5cca287e8204c4647a5f09df961d9a76d0b38c42
  • Loading branch information
eharney committed Jun 20, 2013
1 parent 1482c40 commit 79a402d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cinder/volume/drivers/lvm.py
Expand Up @@ -643,16 +643,17 @@ def _do_lvm_snapshot(self, src_lvm_name, dest_vref, is_cinder_snap=True):
self._try_execute('lvcreate', '-s', '-n', new_name,
src_lvm_name, run_as_root=True)

def create_volume(self, volume):
"""Creates a logical volume. Can optionally return a Dictionary of
changes to the volume object to be persisted.
"""
def _create_volume(self, volume):
sizestr = self._sizestr(volume['size'])
vg_name = ("%s/%s-pool" % (self.configuration.volume_group,
self.configuration.volume_group))
self._try_execute('lvcreate', '-T', '-V', sizestr, '-n',
volume['name'], vg_name, run_as_root=True)

def create_volume(self, volume):
"""Creates a logical volume."""
self._create_volume(volume)

def delete_volume(self, volume):
"""Deletes a logical volume."""
if self._volume_not_present(volume['name']):
Expand Down

0 comments on commit 79a402d

Please sign in to comment.