Documentation
¶
Index ¶
- func New() resource.Driver
- type T
- func (t *T) Boot(ctx context.Context) error
- func (t *T) ClaimedDevices(ctx context.Context) device.L
- func (t *T) CurrentFree(ctx context.Context) (int64, error)
- func (t *T) CurrentSize(ctx context.Context) (int64, error)
- func (t *T) DriverID() driver.ID
- func (t *T) ExposedDevices(ctx context.Context) device.L
- func (t *T) Holds(src resource.HoldSource) []resource.Hold
- func (t *T) ImportDevices(ctx context.Context) error
- func (t *T) Info(ctx context.Context) (resource.InfoKeys, error)
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) ProvisionAsFollower(ctx context.Context) error
- func (t *T) ProvisionAsLeader(ctx context.Context) error
- func (t *T) ProvisionConflicts(ctx context.Context) []string
- func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)
- func (t *T) ReservableDevices(ctx context.Context) device.L
- func (t *T) Resize(ctx context.Context, to int64) error
- func (t *T) ResizeHandsOut(ctx context.Context) (func(below int64) int64, error)
- func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)
- func (t *T) ResizeProvides(_ context.Context) string
- func (t *T) ResizeSpansBelow() bool
- func (t *T) Start(ctx context.Context) error
- func (t *T) Status(ctx context.Context) status.T
- func (t *T) Stop(ctx context.Context) error
- func (t *T) SubDevices(ctx context.Context) device.L
- func (t *T) UnprovisionAsLeader(ctx context.Context) error
- func (t *T) VolumeGroupName() string
- type VGDriver
- type VGDriverImportDeviceser
- type VGDriverPEStarter
- type VGDriverPVRemover
- type VGDriverProvisioner
- type VGDriverResizer
- type VGDriverUnprovisioner
- type VGDriverWiper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type T ¶
type T struct {
resdisk.T
Path naming.Path
VGName string `json:"vg"`
Size string `json:"size"`
Options []string `json:"options"`
PVs []string `json:"pvs"`
}
func (*T) CurrentFree ¶
CurrentFree implements resource.Freer.
func (*T) CurrentSize ¶
CurrentSize implements resource.Sizer.
func (*T) Holds ¶
func (t *T) Holds(src resource.HoldSource) []resource.Hold
Holds says the volume group, and the physical volumes it is made of.
func (*T) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) ProvisionConflicts ¶
ProvisionConflicts says the volume group of the name exists already, which the provision would adopt.
func (*T) Provisioned ¶
func (*T) Resize ¶
Resize implements resource.Resizer.
Growing takes the whole device, which the plan made sure is large enough. Shrinking sets the physical volume size explicitly, which lvm refuses if extents beyond it are in use.
func (*T) ResizeHandsOut ¶
ResizeHandsOut implements resource.ResizeHandsOuter.
A volume group given a physical volume of below hands out below less what it keeps for itself, in whole extents. It is the inverse of ResizePlan, so what it answers is no more than what lvm hands out: the cut it measures holds what did not fill an extent at the size the physical volume has now, and that part may fill one at another size.
func (*T) ResizePlan ¶
ResizePlan implements resource.Resizer.
A volume group offers its logical volumes less than its physical volumes hold, by the metadata lvm keeps and by what does not fill a whole extent. What it asks of the device below is the size wanted plus what it keeps for itself today, which over-asks by at most one extent and never under-asks.
func (*T) ResizeProvides ¶
ResizeProvides implements resource.ResizeProvides, so the logical volumes of this group find it: no device leads from one to the other.
func (*T) ResizeSpansBelow ¶
ResizeSpansBelow implements resource.ResizeSpansBelow.
A volume group takes up the physical volume it is created on, keeping a cut of it for its own metadata and for what does not fill a whole extent.
func (*T) VolumeGroupName ¶
VolumeGroupName is the name of the volume group, by which a check of its usage is attributed to the object.
type VGDriver ¶
type VGDriver 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)
PVs(context.Context) (device.L, error)
ActiveLVDevices() (device.L, error)
DriverName() string
AddTag(context.Context, string) error
DelTag(context.Context, string) error
HasTag(context.Context, string) (bool, error)
Tags(context.Context) ([]string, error)
GetLVSummary(context.Context) (lvm2.LVSummary, error)
NeedActivate(lvm2.LVSummary) bool
}
type VGDriverImportDeviceser ¶
type VGDriverPEStarter ¶
VGDriverPEStarter is implemented by a volume group driver that says the offset of the first extent of its physical volume, the bytes it keeps for its metadata whatever the device holds.