Documentation
¶
Index ¶
- func New() resource.Driver
- type T
- 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) MoveCopiesStorage() bool
- func (t *T) PoolCharge() (string, int64)
- func (t *T) PostMove(ctx context.Context, to string) error
- func (t *T) PreMove(ctx context.Context, to string) 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) Resize(ctx context.Context, to int64) error
- func (t *T) ResizeHandsOut(_ context.Context) (func(below int64) int64, error)
- func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)
- func (t *T) ResizeUnit(_ 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) UnprovisionAsLeader(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type T ¶
type T struct {
resdisk.T
resource.SSH
Name string `json:"name"`
Size *int64 `json:"size"`
BlockSize *int64 `json:"blocksize"`
CreateOptions []string `json:"create_options"`
// contains filtered or unexported fields
}
func (*T) CurrentSize ¶
CurrentSize implements resource.Sizer.
func (*T) Holds ¶
func (t *T) Holds(src resource.HoldSource) []resource.Hold
Holds says the dataset of the volume.
func (*T) MoveCopiesStorage ¶
MoveCopiesStorage implements resource.MoveStorageCopier. A zvol is in a pool imported on one node at a time, so the device of a moving container is mirrored to the copy PreMove made on the destination.
func (*T) PoolCharge ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource PoolCharge implements resource.PoolCharger. A zvol takes its size of the zpool it is carved from, which is what its name begins with.
func (*T) PostMove ¶
PostMove implements resource.PostMover. The container runs on the destination: the move snapshots older than the one sent are destroyed on both nodes.
The move is done whatever the pruning says, so a failure to prune is worth a warning, not a failed move.
func (*T) PreMove ¶
PreMove implements resource.PreMover. It copies the zvol to the destination, so the device the container opens exists there when the move mirrors its disk to it.
The copy is sent from the newest snapshot both nodes hold, which the previous move left, and in full when there is none. The device node is created by udev once the receive is done, which the destination waits for.
func (*T) ProvisionConflicts ¶
ProvisionConflicts says the volume exists already, which the provision would adopt.
func (*T) Provisioned ¶
func (*T) Resize ¶
Resize implements resource.Resizer.
A volume holds a whole number of blocks, so it is asked for the next one up rather than a size zfs would refuse. The link above asked for a size it needs, so round up and never down.
func (*T) ResizeHandsOut ¶
ResizeHandsOut implements resource.ResizeHandsOuter.
A volume takes its space from a pool the object does not own, so no resource of a chain is below it: it is the bottom, and is asked for the size a chain is given. It hands out what it is given.
func (*T) ResizePlan ¶
ResizePlan implements resource.Resizer.
A volume takes its space from the pool holding it, which hands out what it has: there is nothing below to ask a size of.
func (*T) ResizeUnit ¶
ResizeUnit implements resource.ResizeUniter: a volume holds a whole number of blocks.