Documentation
¶
Overview ¶
Package resvol is the volume resource driver
A volume resource is linked to a volume object named <name> in the namespace of the service.
The volume object contains disk and fs resources configured by the <pool> that created it, so the service doesn't have to embed driver keywords that would prevent the service from being run on another cluster with different capabilities.
Access: * rwo Read Write Once * rwx Read Write Many * roo Read Only Once * rox Read Only Many
Index ¶
- Constants
- Variables
- func New() resource.Driver
- type T
- func (t *T) Boot(ctx context.Context) error
- func (t *T) CanInstall(ctx context.Context) (bool, error)
- func (t *T) Configure() error
- func (t *T) DriverID() driver.ID
- func (t *T) ExposedDevices(ctx context.Context) device.L
- func (t *T) Head() string
- func (t *T) Holds(src resource.HoldSource) []resource.Hold
- func (t *T) IsVolatile() bool
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) MoveCopiesStorage() bool
- func (t *T) PostMove(ctx context.Context, to string) error
- func (t *T) PreMove(ctx context.Context, to string) error
- func (t *T) PreMoveRollback(ctx context.Context, to string) error
- func (t *T) ProvisionAsFollower(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) ResizeTarget(ctx context.Context) (naming.Path, error)
- func (t *T) SnapshotHead(ctx context.Context, name string) (string, func() error, bool, error)
- func (t *T) Start(ctx context.Context) error
- func (t *T) StartBlocker(ctx context.Context) *resource.StartBlocker
- func (t *T) Status(ctx context.Context) status.T
- func (t *T) StatusInfo(context.Context) map[string]any
- func (t *T) Stop(ctx context.Context) error
- func (t *T) SubDevices(ctx context.Context) device.L
- func (t *T) UnprovisionAsLeader(ctx context.Context) error
- func (t *T) ValidateNodesAndName() error
- func (t *T) Volume() (object.Vol, error)
- func (t *T) VolumeList(_ context.Context) naming.Paths
Constants ¶
const ( Usage int = iota NoUsage )
Variables ¶
var ( // GroupVolume holds the vol object the resource uses: its name, the // size it is claimed with, its nodes, and whether other objects use // it too. GroupVolume = keywords.Group{ ID: "volume", Name: "Volume", Text: keywords.NewText(fs, "text/group/volume"), Order: 10, } // GroupPool holds what the pool the vol is allocated from is chosen // by: its name, its type, and the capabilities it must have. GroupPool = keywords.Group{ ID: "pool", Name: "Pool", Text: keywords.NewText(fs, "text/group/pool"), Order: 20, } )
The groups of the keywords of a volume resource beside the ones of the datarecv keywords, which hold the owner and permissions of its root and the files installed in it.
The pool group has no strategies: pool and type are no alternatives, a pool lookup keeping the pools matching both, see pool.Lookup.Do.
Functions ¶
Types ¶
type T ¶
type T struct {
resource.T
resource.Restart
datarecv.DataRecv
Name string `json:"name"`
Access string `json:"access"`
Exclusive bool `json:"exclusive"`
Pool string `json:"pool"`
PoolType string `json:"type"`
Size *int64 `json:"size"`
Format bool `json:"format"`
Volatile bool `json:"volatile"`
Snap bool `json:"snap"`
VolNodes []string
// Context
Path naming.Path
Topology topology.T
Nodes []string
ObjectParents []string
// contains filtered or unexported fields
}
func (*T) Boot ¶
Boot removes the flag a crash left, as v2 did: the node booted, the instance is not started, and the flag would read the volume of the instance up, holding it. The volume object is booted by the daemon on its own, so the boot does not stop it.
func (*T) Holds ¶
func (t *T) Holds(src resource.HoldSource) []resource.Hold
Holds says the volume object, of the namespace of the object: used exclusively, unless exclusive is false, its use then shared with the other consumers saying so.
func (*T) IsVolatile ¶
IsVolatile tells whether the volume is volatile: its data is discarded at stop, so nothing in it is meant to outlive the instance, nor be backed up.
func (*T) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) MoveCopiesStorage ¶
MoveCopiesStorage implements resource.MoveStorageCopier, saying what the resource exposing the device of the volume says.
func (*T) Provisioned ¶
Provisioned says the volume of the resource exists and is claimed by the object, as v2 did. A volume existing but not claimed, as one a service created again points at after the purge of its former self, is not: the provision claims it, and the claim is what the volume reads its children from, which its stop, its purge and its sync store wait for.
func (*T) ResizeTarget ¶
ResizeTarget implements resource.ResizeTargeter.
A volume resource holds no size of its own: it stands for the head of the volume it points at, which is where a resize asked of it belongs.
func (*T) SnapshotHead ¶
SnapshotHead implements resource.HeadSnapshotter: the snapshot of the head of the vol, which the resource of the vol holding it takes, when its storage takes them.
func (*T) StartBlocker ¶
func (t *T) StartBlocker(ctx context.Context) *resource.StartBlocker
StartBlocker implements resource.StartBlockerer, saying what the resources of the volume say, as read by the last status evaluation.
func (*T) StatusInfo ¶
StatusInfo names the vol object of the resource, whose local instance the resource status relays: the daemon refreshes the status of the consumer when it changes.