resdiskzpool

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: 30 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
	Name          string      `json:"name"`
	Size          string      `json:"size"`
	CreateOptions []string    `json:"create_options"`
	VDev          []string    `json:"vdev"`
	Path          naming.Path `json:"path"`
	Multihost     string      `json:"multihost"`
	Zone          string      `json:"zone"`
}

func (*T) CurrentSize

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

CurrentSize implements resource.Sizer.

It is what the pool holds, which is less than its vdevs do: zfs keeps room for its labels and its reserve.

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 pool, and the devices of its vdevs.

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

func (t *T) PoolName() string

PoolName is the name of the pool, by which a check of its health is attributed to the object.

func (*T) PreSync

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

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 pool exists already, which the provision would adopt.

func (*T) Provisioned

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

func (*T) ReservableDevices

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

func (*T) Resize

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

Resize implements resource.Resizer.

A pool is not given a size: it is what its vdevs hold. Growing one is telling it to look again at devices that have grown.

func (*T) ResizeHandsOut

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

ResizeHandsOut implements resource.ResizeHandsOuter.

A pool hands out what is below it, as its plan asks below what it is asked. zfs keeps a little of the device for itself, but no fixed property says how much, and the gap to the device is the growth itself once the device has grown and the pool has not: see ResizePlan. So a chain worked out from its bottom asks the pool for what its device holds, and the pool lands a little under it, as it does today.

func (*T) ResizePlan

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

ResizePlan implements resource.Resizer.

The device below is asked for the size wanted, and the pool ends up a little under it, because zfs keeps room for its labels and its reserve. That is the same bargain a filesystem makes with the device under it.

What zfs keeps is not added to the request, even though it is a fixed fraction of the pool, near a twenty fifth of it: a 300mi device carried a 288mi pool and a 600mi device carries a 576mi one.

Adding it would mean measuring the gap between the device and the pool, and that gap is the growth itself once the device has grown and the pool has not, which every pass would then ask for again. It is the trap a drbd resource, an md member and a luks header all set, and the pool is the one place where there is no fixed property to read instead. So the request is passed down as it came, and the pool lands a little under it.

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

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

func (*T) UnprovisionAsLeader

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

func (*T) UnprovisionStop

func (t *T) UnprovisionStop(ctx context.Context, leader bool) error

UnprovisionStop skips the normal pre-unprovision resource stop, because zfs can only destroy imported pools. The Unprovision func imports anyway, but if we don't export unnecessary export/import is saved.

Jump to

Keyboard shortcuts

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