resdiskzpool

package
v3.0.0-rc49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

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