lvmd

package
v0.0.0-...-b485392 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeLvmdConfigFile = "/var/lib/microshift/lvms/lvmd.yaml"
	LvmdConfigFileName    = "lvmd.yaml"
)
View Source
const (
	TypeThin  = DeviceType("thin")
	TypeThick = DeviceType("thick")
)

Variables

This section is empty.

Functions

func LvmPresentOnMachine

func LvmPresentOnMachine() error

func SaveLvmdConfigToFile

func SaveLvmdConfigToFile(l *Lvmd, p string) error

Types

type DeviceClass

type DeviceClass struct {
	// Name for the device-class name
	Name string `json:"name"`
	// Volume group name for the device-class
	VolumeGroup string `json:"volume-group"`
	// Default is a flag to indicate whether the device-class is the default
	Default bool `json:"default"`
	// SpareGB is storage capacity in GiB to be spared
	SpareGB *uint64 `json:"spare-gb"`
	// Stripe is the number of stripes in the logical volume
	Stripe *uint `json:"stripe"`
	// StripeSize is the amount of data that is written to one device before moving to the next device
	StripeSize string `json:"stripe-size"`
	// LVCreateOptions are extra arguments to pass to lvcreate
	LVCreateOptions []string `json:"lvcreate-options"`
	// Type is the name of logical volume target, supports 'thick' (default) or 'thin' currently
	Type DeviceType `json:"type"`
	// ThinPoolConfig holds the configuration for thinpool in this volume group corresponding to the device-class
	ThinPoolConfig *ThinPoolConfig `json:"thin-pool"`
}

DeviceClass maps between device-classes and target for logical volume creation current targets are VolumeGroup for thick-lv and ThinPool for thin-lv

type DeviceType

type DeviceType string

type Lvmd

type Lvmd struct {
	DeviceClasses []*DeviceClass `json:"device-classes"`
	SocketName    string         `json:"socket-name"`
	Message       string         `json:"-"`
}

Lvmd stores the read-in or defaulted values of the lvmd configuration and provides the topolvm-node process information about its host's storage environment.

func DefaultLvmdConfig

func DefaultLvmdConfig() (*Lvmd, error)

DefaultLvmdConfig returns a configuration struct for Lvmd with default settings based on the current host. If a single volume group is found, that value is used. If multiple volume groups are available and one is named "rhel", that group is used. Otherwise, the configuration returned will report that it is not enabled (see IsEnabled()).

func NewLvmdConfigFromFile

func NewLvmdConfigFromFile(p string) (*Lvmd, error)

func (*Lvmd) IsEnabled

func (l *Lvmd) IsEnabled() bool

IsEnabled returns a boolean indicating whether the CSI driver should be enabled for this host.

type ThinPoolConfig

type ThinPoolConfig struct {
	// Name of thinpool
	Name string `json:"name"`
	// OverprovisionRatio signifies the upper bound multiplier for allowing logical volume creation in this pool
	OverprovisionRatio float64 `json:"overprovision-ratio"`
}

ThinPoolConfig holds the configuration of thin pool in a volume group

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL