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) Info(ctx context.Context) (resource.InfoKeys, error)
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) PoolName() string
- func (t *T) PreSync(ctx context.Context) error
- func (t *T) ProvisionAsLeader(ctx context.Context) error
- func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)
- func (t *T) ReservableDevices(ctx context.Context) device.L
- func (t *T) Resize(ctx context.Context, to int64) error
- func (t *T) ResizePlan(ctx context.Context, to int64) (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) ToSync(ctx context.Context) []string
- func (t *T) UnprovisionAsLeader(ctx context.Context) error
- func (t *T) UnprovisionStop(ctx context.Context, leader bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) PoolName ¶
PoolName is the name of the pool, by which a check of its health is attributed to the object.
func (*T) Provisioned ¶
func (*T) Resize ¶
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 ¶
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) UnprovisionStop ¶
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.