def modify_vg(ns, vg, add_pvs=None, remove_pvs=None):
    vg = common.str2vg(ns, vg)
    service = ns.LMI_StorageConfigurationService.first_instance()

    # get list of current PVs
    pvs = get_vg_pvs(ns, vg)

    for device in add_pvs:
        device = common.str2device(ns, device)
        if device not in pvs:
            pvs.append(device)

    for device in remove_pvs:
        device = common.str2device(ns, device)
        # don't report error when removing device that is not a PV
        if device in pvs:
            pvs.remove(device)

    (ret, _outparams, err) = service.SyncCreateOrModifyVG(Pool=vg, InExtents = list(pvs))
    if ret != 0:
        if err:
            raise LmiFailed("Cannot modify the VG: %s." % err)
        raise LmiFailed("Cannot modify the VG: %s."
                % (service.CreateOrModifyVG.CreateOrModifyVG.value_name(ret),))
    LOG().info("Modified volume group %s", vg.Name)
Modify given Volume Group.
dataset/ETHPy150Open openlmi/openlmi-scripts/commands/storage/lmi/scripts/storage/lvm.py/modify_vg