resdisklv

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() resource.Driver

Types

type LVDriver

type LVDriver interface {
	Activate(context.Context) error
	Deactivate(context.Context) error
	IsActive(context.Context) (bool, error)
	Exists(context.Context) (bool, error)
	FQN() string
	Devices(context.Context) (device.L, error)
	DriverName() string
}

type LVDriverProvisioner

type LVDriverProvisioner interface {
	Create(context.Context, string, []string) error
}

type LVDriverResizer

type LVDriverResizer interface {
	Size(context.Context) (int64, error)
	Resize(context.Context, int64) error
}

LVDriverResizer is implemented by the lv implementations that can report and change their size. A resource whose implementation does not is refused when a resize is planned, not when it is applied.

type LVDriverTailZeroer

type LVDriverTailZeroer interface {
	ZeroTail(context.Context) error
}

LVDriverTailZeroer is implemented by the lv implementations that zero the end of a volume they made, where a volume made before on the same extents may have left metadata.

type LVDriverThinProvisioner

type LVDriverThinProvisioner interface {
	CreateThin(ctx context.Context, size, pool string, args []string) error
}

LVDriverThinProvisioner is implemented by the lv implementations that make thin volumes, in a thin pool of the volume group.

type LVDriverUnprovisioner

type LVDriverUnprovisioner interface {
	Remove(context.Context, []string) error
}

type LVDriverWiper

type LVDriverWiper interface {
	Wipe(context.Context) error
}

type T

type T struct {
	resdisk.T
	LVName        string   `json:"name"`
	VGName        string   `json:"vg"`
	Size          string   `json:"size"`
	CreateOptions []string `json:"create_options"`
	ThinPool      string   `json:"thin_pool"`
}

func (*T) Boot

func (t *T) Boot(ctx context.Context) error

func (*T) ClaimedDevices

func (t *T) ClaimedDevices(ctx context.Context) device.L

func (*T) CurrentSize

func (t *T) CurrentSize(ctx context.Context) (int64, error)

CurrentSize implements resource.Sizer.

func (*T) DriverID

func (t *T) DriverID() driver.ID

func (*T) ExposedDevices

func (t *T) ExposedDevices(ctx context.Context) device.L

func (*T) Holds

func (t *T) Holds(src resource.HoldSource) []resource.Hold

Holds says the logical volume, and the device it exposes, which a filesystem of another object naming it as a path holds too.

func (*T) Info

func (t *T) Info(ctx context.Context) (resource.InfoKeys, error)

func (*T) Label

func (t *T) Label(_ context.Context) string

Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource

func (*T) Manifest

func (t *T) Manifest() *manifest.T

Manifest exposes to the core the input expected by the driver.

func (*T) PoolCharge

func (t *T) PoolCharge() (string, int64)

PoolCharge implements resource.PoolCharger. A logical volume takes its size of the volume group it is carved from, and a thin volume of the thin pool it is in, named as a pool of thin volumes names its head: the size it is seen with being the most it can take.

A size that is a share of the group, "100%FREE" and the like, is not a number the group can be rationed by, and is answered as none.

func (*T) ProvisionAsLeader

func (t *T) ProvisionAsLeader(ctx context.Context) error

func (*T) ProvisionConflicts

func (t *T) ProvisionConflicts(ctx context.Context) []string

ProvisionConflicts says the logical volume exists already, which the provision would adopt.

func (*T) Provisioned

func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)

func (*T) Resize

func (t *T) Resize(ctx context.Context, to int64) error

Resize implements resource.Resizer.

func (*T) ResizeHandsOut

func (t *T) ResizeHandsOut(ctx context.Context) (func(below int64) int64, error)

ResizeHandsOut implements resource.ResizeHandsOuter.

A logical volume given a volume group of below takes what the group would have free then, on top of what it holds: what the other volumes of the group hold stays theirs. It is the inverse of ResizePlan, in whole extents.

A thin volume is carved from its thin pool, which over-commits, and a volume whose group can not be read cannot say: both answer what is below them, as their plan asks it.

func (*T) ResizePlan

func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)

ResizePlan implements resource.Resizer.

A logical volume takes what it grows by from the free space of its volume group, which holds other volumes too: it asks the group for the space the group has taken, plus that growth, rounded up to whole extents. A group with the free space holds that already, and is not asked to grow. Asking it for the size of the volume alone said a group of other volumes held it, with no free space left.

A thin volume is carved from its thin pool, which over-commits: it asks the size it is given. So does a volume whose group can not be read.

func (*T) ResizeRestsOn

func (t *T) ResizeRestsOn(_ context.Context) string

ResizeRestsOn implements resource.ResizeRestsOn.

A logical volume takes its space from its volume group, which no device leads to: what a volume group exposes is the logical volumes themselves.

func (*T) ResizeUnit

func (t *T) ResizeUnit(ctx context.Context) (int64, error)

ResizeUnit implements resource.ResizeUniter: a logical volume is a whole number of the extents of its group.

func (*T) Start

func (t *T) Start(ctx context.Context) error

func (*T) Status

func (t *T) Status(ctx context.Context) status.T

func (*T) Stop

func (t *T) Stop(ctx context.Context) error

func (*T) SubDevices

func (t *T) SubDevices(ctx context.Context) device.L

func (*T) UnprovisionAsLeader

func (t *T) UnprovisionAsLeader(ctx context.Context) error

Jump to

Keyboard shortcuts

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