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

(cherry picked from commit 79a402d)

Conflicts:
	cinder/volume/drivers/lvm.py

Change-Id: I5cca287e8204c4647a5f09df961d9a76d0b38c42
  • Loading branch information
eharney committed Jun 20, 2013
1 parent e97b555 commit 7a15827
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cinder/volume/drivers/lvm.py
Expand Up @@ -630,14 +630,16 @@ 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" % (FLAGS.volume_group, FLAGS.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 7a15827

Please sign in to comment.