mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Added snapshot option to linux_lvm.lvcreate
This commit is contained in:
parent
396abb06eb
commit
19170dad98
@ -230,7 +230,7 @@ def vgcreate(vgname, devices, **kwargs):
|
||||
return vgdata
|
||||
|
||||
|
||||
def lvcreate(lvname, vgname, size=None, extents=None, pv=''):
|
||||
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=''):
|
||||
'''
|
||||
Create a new logical volume, with option for which physical volume to be used
|
||||
|
||||
@ -240,10 +240,14 @@ def lvcreate(lvname, vgname, size=None, extents=None, pv=''):
|
||||
|
||||
salt '*' lvm.lvcreate new_volume_name vg_name size=10G
|
||||
salt '*' lvm.lvcreate new_volume_name vg_name extents=100 /dev/sdb
|
||||
salt '*' lvm.lvcreate new_snapshot vg_name snapshot=volume_name size=3G
|
||||
'''
|
||||
if size and extents:
|
||||
return 'Error: Please specify only size or extents'
|
||||
|
||||
if snapshot:
|
||||
vgname = '-s ' + vgname + '/' + snapshot
|
||||
|
||||
if size:
|
||||
cmd = 'lvcreate -n {0} {1} -L {2} {3}'.format(lvname, vgname, size, pv)
|
||||
elif extents:
|
||||
|
Loading…
Reference in New Issue
Block a user