Version: v2.4.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0



Package lvm provides an interface to work with LVM2.



This section is empty.


This section is empty.


func CreateVolume

func CreateVolume(r runners.Runner, vg, lv, name, mountDir string) error

CreateVolume creates LVM volume.

func RemoveVolume

func RemoveVolume(r runners.Runner, vg, _, name, mountDir string) error

RemoveVolume removes LVM volume.


type LVManager

type LVManager struct {
	// contains filtered or unexported fields

LVManager describes an LVM2 filesystem manager.

func NewFSManager

func NewFSManager(runner runners.Runner, pool *resources.Pool) (*LVManager, error)

NewFSManager creates a new Manager instance for LVM.

func (*LVManager) CleanupSnapshots

func (m *LVManager) CleanupSnapshots(_ int) ([]string, error)

CleanupSnapshots is not supported in LVM mode.

func (*LVManager) CreateClone

func (m *LVManager) CreateClone(name, _ string) error

CreateClone creates a new volume.

func (*LVManager) CreateSnapshot

func (m *LVManager) CreateSnapshot(_, _ string) (string, error)

CreateSnapshot is not supported in LVM mode.

func (*LVManager) DestroyClone

func (m *LVManager) DestroyClone(name string) error

DestroyClone destroys volumes.

func (*LVManager) DestroySnapshot

func (m *LVManager) DestroySnapshot(_ string) error

DestroySnapshot is not supported in LVM mode.

func (*LVManager) GetDiskState

func (m *LVManager) GetDiskState() (*resources.Disk, error)

GetDiskState is not implemented.

func (*LVManager) GetSessionState

func (m *LVManager) GetSessionState(_ string) (*resources.SessionState, error)

GetSessionState is not implemented.

func (*LVManager) GetSnapshots

func (m *LVManager) GetSnapshots() ([]resources.Snapshot, error)

GetSnapshots is not implemented.

func (*LVManager) ListClonesNames

func (m *LVManager) ListClonesNames() ([]string, error)

ListClonesNames returns a list of clone names.

func (*LVManager) Pool

func (m *LVManager) Pool() *resources.Pool

Pool gets a storage pool.

type ListEntry

type ListEntry struct {
	Name        string `json:"lv_name"`
	GroupName   string `json:"vg_name"`
	Attr        string `json:"lv_attr"`
	Size        string `json:"lv_size"`
	Pool        string `json:"pool_lv"`
	Origin      string `json:"origin"`
	DataPercent string `json:"data_percent"` // TODO(anatoly): Float64.

ListEntry defines logical volume entry in "lvs" command response.

func ListVolumes

func ListVolumes(r runners.Runner, lv string) ([]ListEntry, error)

ListVolumes lists LVM volumes.

type LvsOutput

type LvsOutput struct {
	Reports []ReportEntry `json:"report"`

LvsOutput defines "lvs" command response.

type ReportEntry

type ReportEntry struct {
	Volumes []ListEntry `json:"lv"`

ReportEntry defines report in "lvs" command response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL