lvm

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package lvm provides an interface to work with LVM2.

Index

Constants

View Source
const (

	// PoolMode defines the lvm filesystem name.
	PoolMode = "lvm"
)

Variables

This section is empty.

Functions

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.

Types

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) GetFilesystemState

func (m *LVManager) GetFilesystemState() (models.FileSystem, error)

GetFilesystemState 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
y or Y : Canonical URL