lvm

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KLvPath     = "lvPath"
	KLvsPath    = "lvsPath"
	KLvIdFormat = "NAA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli added in v0.5.1

type Cli struct {
	// Command executer
	BaseExecuter exec.Executer
	// Command Root executer
	RootExecuter exec.Executer
}

func NewCli added in v0.5.1

func NewCli() (*Cli, error)

func (*Cli) ActivateLv added in v0.5.1

func (c *Cli) ActivateLv(name, vg string) error

func (*Cli) CopyVolume added in v0.5.1

func (c *Cli) CopyVolume(src, dest string, size int64) error

func (*Cli) CreateLvSnapshot added in v0.5.1

func (c *Cli) CreateLvSnapshot(name, sourceLvName, vg string, size int64) error

func (*Cli) CreateVolume added in v0.5.1

func (c *Cli) CreateVolume(name string, vg string, size int64) error

func (*Cli) DeactivateLv added in v0.5.1

func (c *Cli) DeactivateLv(name, vg string) error

func (*Cli) Delete added in v0.5.1

func (c *Cli) Delete(name, vg string) error

delete volume or snapshot

func (*Cli) Exists added in v0.5.1

func (c *Cli) Exists(name string) bool

func (*Cli) ExtendVolume added in v0.5.1

func (c *Cli) ExtendVolume(name, vg string, newSize int64) error

func (*Cli) ListVgs added in v0.5.1

func (c *Cli) ListVgs() (*[]VolumeGroup, error)

func (*Cli) LvHasSnapshot added in v0.5.1

func (c *Cli) LvHasSnapshot(name, vg string) bool

func (*Cli) LvIsActivate added in v0.5.1

func (c *Cli) LvIsActivate(name, vg string) bool

type Config added in v0.5.2

type Config struct {
	Resource string
	Metrics  []string
	Units    []string
}

type Configs added in v0.5.2

type Configs struct {
	Cfgs []Config `resources`
}

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func (*Driver) AttachSnapshot added in v0.3.2

func (d *Driver) AttachSnapshot(snapshotId string, lvsPath string) (string, *model.ConnectionInfo, error)

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(opt *pb.CreateVolumeSnapshotOpts) (snap *model.VolumeSnapshotSpec, err error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(opt *pb.CreateVolumeOpts) (vol *model.VolumeSpec, err error)

func (*Driver) CreateVolumeGroup added in v0.1.8

func (d *Driver) CreateVolumeGroup(opt *pb.CreateVolumeGroupOpts) (*model.VolumeGroupSpec, error)

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(opt *pb.DeleteVolumeSnapshotOpts) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(opt *pb.DeleteVolumeOpts) error

func (*Driver) DeleteVolumeGroup added in v0.1.8

func (d *Driver) DeleteVolumeGroup(opt *pb.DeleteVolumeGroupOpts) error

func (*Driver) DetachSnapshot added in v0.3.2

func (d *Driver) DetachSnapshot(snapshotId string, info *model.ConnectionInfo) error

func (*Driver) ExtendVolume added in v0.1.1

func (d *Driver) ExtendVolume(opt *pb.ExtendVolumeOpts) (*model.VolumeSpec, error)

ExtendVolume ...

func (*Driver) InitializeConnection

func (d *Driver) InitializeConnection(opt *pb.CreateVolumeAttachmentOpts) (*model.ConnectionInfo, error)

func (*Driver) InitializeSnapshotConnection added in v0.3.2

func (d *Driver) InitializeSnapshotConnection(opt *pb.CreateSnapshotAttachmentOpts) (*model.ConnectionInfo, error)

func (*Driver) ListPools

func (d *Driver) ListPools() ([]*model.StoragePoolSpec, error)

func (*Driver) PullSnapshot

func (d *Driver) PullSnapshot(snapIdentifier string) (*model.VolumeSnapshotSpec, error)

func (*Driver) PullVolume

func (d *Driver) PullVolume(volIdentifier string) (*model.VolumeSpec, error)

func (*Driver) Setup

func (d *Driver) Setup() error

func (*Driver) TerminateConnection

func (d *Driver) TerminateConnection(opt *pb.DeleteVolumeAttachmentOpts) error

func (*Driver) TerminateSnapshotConnection added in v0.3.2

func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) error

func (*Driver) Unset

func (*Driver) Unset() error

func (*Driver) UpdateVolumeGroup added in v0.1.8

func (d *Driver) UpdateVolumeGroup(opt *pb.UpdateVolumeGroupOpts) (*model.VolumeGroupSpec, error)

type LVMConfig

type LVMConfig struct {
	TgtBindIp      string                    `yaml:"tgtBindIp"`
	TgtConfDir     string                    `yaml:"tgtConfDir"`
	EnableChapAuth bool                      `yaml:"enableChapAuth"`
	Pool           map[string]PoolProperties `yaml:"pool,flow"`
}

type MetricCli added in v0.5.2

type MetricCli struct {
	// Command executer
	BaseExecuter exec.Executer
	// Command Root executer
	RootExecuter exec.Executer
}

func NewMetricCli added in v0.5.2

func NewMetricCli() (*MetricCli, error)

func (*MetricCli) CollectMetrics added in v0.5.2

func (cli *MetricCli) CollectMetrics(metricList []string) (map[string]map[string]string, map[string]map[string]string, error)

CollectMetrics function is to call the cli for metrics collection. This will be invoked by lvm metric driver metricList -> metrics to be collected returnMap -> metrics to value map

func (*MetricCli) DiscoverDisks added in v0.5.3

func (c *MetricCli) DiscoverDisks() ([]string, error)

Discover LVM Disks

func (*MetricCli) DiscoverVolumes added in v0.5.3

func (c *MetricCli) DiscoverVolumes() ([]string, []string, error)

Discover LVM volumes

type MetricDriver added in v0.5.2

type MetricDriver struct {
	// contains filtered or unexported fields
}

func (*MetricDriver) CollectMetrics added in v0.5.2

func (d *MetricDriver) CollectMetrics() ([]*model.MetricSpec, error)

CollectMetrics: Driver entry point to collect metrics. This will be invoked by the dock []*model.MetricSpec -> the array of metrics to be returned

func (*MetricDriver) GetMetricList added in v0.5.3

func (d *MetricDriver) GetMetricList(resourceType string) (supportedMetrics []string, err error)

getMetricList:- is to get the list of supported metrics for given resource type supportedMetrics -> list of supported metrics

func (*MetricDriver) Setup added in v0.5.2

func (d *MetricDriver) Setup() error

func (*MetricDriver) Teardown added in v0.5.2

func (*MetricDriver) Teardown() error

type VolumeGroup

type VolumeGroup struct {
	Name          string
	TotalCapacity int64
	FreeCapacity  int64
	UUID          string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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