resdiskzvol

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: 21 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 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

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 dataset of the volume.

func (*T) Info

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

func (*T) Label

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

func (*T) Manifest

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

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

func (*T) MoveCopiesStorage

func (t *T) MoveCopiesStorage() bool

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

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

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

func (t *T) PostMove(ctx context.Context, to string) error

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

func (t *T) PreMove(ctx context.Context, to string) error

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) ProvisionAsLeader

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

func (*T) ProvisionConflicts

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

ProvisionConflicts says the 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.

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

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

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

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

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

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

ResizeUnit implements resource.ResizeUniter: a volume holds a whole number of blocks.

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) 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