From: Alfredo Deza Date: Thu, 23 Aug 2018 12:35:02 +0000 (-0400) Subject: ceph-volume api.lvm new utility to extend a volume group for one or more devices X-Git-Tag: v12.2.8~5^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe66ec44d693a0299b8e5c9d36d2ca5e0916ea4e;p=ceph.git ceph-volume api.lvm new utility to extend a volume group for one or more devices Signed-off-by: Alfredo Deza (cherry picked from commit 21df60294977f4dd2dab218df77a04b326fd8b19) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 414f0a7eac17..e766671b3238 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -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.