The nova.virt.libvirt.storage.lvm Module

clear_volume(path)

Obfuscate the logical volume.

Parameters:path – logical volume path
create_volume(vg, lv, size, sparse=False)

Create LVM image.

Creates a LVM image with given size.

Parameters:
  • vg – existing volume group which should hold this image
  • lv – name for this image (logical volume)
Size:

size of image in bytes

Sparse:

create sparse logical volume

get_volume_group_info(vg)

Return free/used/total space info for a volume group in bytes

Parameters:vg – volume group name
Returns:A dict containing: :total: How big the filesystem is (in bytes) :free: How much space is free (in bytes) :used: How much space is used (in bytes)
get_volume_size(path)

Get logical volume size in bytes.

Parameters:path – logical volume path
Raises:processutils.ProcessExecutionError if getting the volume size fails in some unexpected way.
Raises:exception.VolumeBDMPathNotFound if the volume path does not exist.
list_volumes(vg)

List logical volumes paths for given volume group.

Parameters:vg – volume group name
Returns:Return a logical volume list for given volume group : Data format example : [‘volume-aaa’, ‘volume-bbb’, ‘volume-ccc’]
remove_volumes(paths)

Remove one or more logical volume.

volume_info(path)

Get logical volume info.

Parameters:path – logical volume path
Returns:Return a dict object including info of given logical volume : Data format example : {‘#Seg’: ‘1’, ‘Move’: ‘’, ‘Log’: ‘’, ‘Meta%’: ‘’, ‘Min’: ‘-1’, : ... : ‘Free’: ‘9983’, ‘LV’: ‘volume-aaa’, ‘Host’: ‘xyz.com’, : ‘Active’: ‘active’, ‘Path’: ‘/dev/vg/volume-aaa’, ‘#LV’: ‘3’, : ‘Maj’: ‘-1’, ‘VSize’: ‘50.00g’, ‘VFree’: ‘39.00g’, ‘Pool’: ‘’, : ‘VG Tags’: ‘’, ‘KMaj’: ‘253’, ‘Convert’: ‘’, ‘LProfile’: ‘’, : ‘#Ext’: ‘12799’, ‘Attr’: ‘-wi-a—–’, ‘VG’: ‘vg’, : ... : ‘LSize’: ‘1.00g’, ‘#PV’: ‘1’, ‘#VMdaCps’: ‘unmanaged’}

Previous topic

The nova.virt.libvirt.storage.dmcrypt Module

Next topic

The nova.virt.libvirt.storage.rbd_utils Module

Project Source

This Page