Documentation
¶
Index ¶
- func New() resource.Driver
- type LVDriver
- type LVDriverProvisioner
- type LVDriverResizer
- type LVDriverTailZeroer
- type LVDriverThinProvisioner
- type LVDriverUnprovisioner
- type LVDriverWiper
- type T
- func (t *T) Boot(ctx context.Context) error
- func (t *T) ClaimedDevices(ctx context.Context) device.L
- 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) Info(ctx context.Context) (resource.InfoKeys, error)
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) PoolCharge() (string, int64)
- 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) 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) ResizeRestsOn(_ context.Context) string
- func (t *T) ResizeUnit(ctx context.Context) (int64, error)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LVDriverProvisioner ¶
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 ¶
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 LVDriverWiper ¶
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) CurrentSize ¶
CurrentSize implements resource.Sizer.
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) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) PoolCharge ¶
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) ProvisionConflicts ¶
ProvisionConflicts says the logical volume exists already, which the provision would adopt.
func (*T) Provisioned ¶
func (*T) ResizeHandsOut ¶
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 ¶
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 ¶
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 ¶
ResizeUnit implements resource.ResizeUniter: a logical volume is a whole number of the extents of its group.