mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
ceph-volume api.lvm new utility to extend a volume group for one or more devices
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
0283164142
commit
21df602949
@ -434,6 +434,31 @@ def create_vg(devices, name=None, name_prefix=None):
|
||||
return vg
|
||||
|
||||
|
||||
def extend_vg(vg, devices):
|
||||
"""
|
||||
Extend a Volume Group. Command looks like::
|
||||
|
||||
vgextend --force --yes group_name [device, ...]
|
||||
|
||||
Once created the volume group is extended and returned as a ``VolumeGroup`` object
|
||||
|
||||
:param vg: A VolumeGroup object
|
||||
:param devices: A list of devices to extend the VG. Optionally, a single
|
||||
device (as a string) can be used.
|
||||
"""
|
||||
if not isinstance(devices, list):
|
||||
devices = [devices]
|
||||
process.run([
|
||||
'vgextend',
|
||||
'--force',
|
||||
'--yes',
|
||||
vg.name] + devices
|
||||
)
|
||||
|
||||
vg = get_vg(vg_name=vg.name)
|
||||
return vg
|
||||
|
||||
|
||||
def remove_vg(vg_name):
|
||||
"""
|
||||
Removes a volume group.
|
||||
|
Loading…
Reference in New Issue
Block a user