]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add option to specify a pv for lvcreate 31362/head
authorMohamad Gebai <mgebai@suse.com>
Sun, 31 Mar 2019 17:05:35 +0000 (13:05 -0400)
committerJan Fajerski <jfajerski@suse.com>
Mon, 4 Nov 2019 13:44:22 +0000 (14:44 +0100)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
(cherry picked from commit 38b2d7a66c76d9c5b1d2e00ada9503f22a7d8fb6)

src/ceph-volume/ceph_volume/api/lvm.py

index d5df10b3c01c573ebd5574003235f6ea7ddba105..47ccc1068d4bf05ff8277e2c39d1b6f10bf19422 100644 (file)
@@ -570,7 +570,7 @@ def remove_lv(lv):
     return True
 
 
-def create_lv(name, group, extents=None, size=None, tags=None, uuid_name=False):
+def create_lv(name, group, extents=None, size=None, tags=None, uuid_name=False, pv=None):
     """
     Create a Logical Volume in a Volume Group. Command looks like::
 
@@ -604,31 +604,34 @@ def create_lv(name, group, extents=None, size=None, tags=None, uuid_name=False):
         'lockbox': 'ceph.lockbox_device',  # XXX might not ever need this lockbox sorcery
     }
     if size:
-        process.run([
+        command = [
             'lvcreate',
             '--yes',
             '-L',
             '%s' % size,
             '-n', name, group
-        ])
+        ]
     elif extents:
-        process.run([
+        command = [
             'lvcreate',
             '--yes',
             '-l',
             '%s' % extents,
             '-n', name, group
-        ])
+        ]
     # create the lv with all the space available, this is needed because the
     # system call is different for LVM
     else:
-        process.run([
+        command = [
             'lvcreate',
             '--yes',
             '-l',
             '100%FREE',
             '-n', name, group
-        ])
+        ]
+    if pv:
+        command.append(pv)
+    process.run(command)
 
     lv = get_lv(lv_name=name, vg_name=group)
     lv.set_tags(tags)