resvol

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

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

View Source
const (
	Usage int = iota
	NoUsage
)

Variables

View Source
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

func New

func New() resource.Driver

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

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

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

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

func (*T) Configure

func (t *T) Configure() error

Configure installs a resource backpointer in the DataStoreInstall

func (*T) DriverID

func (t *T) DriverID() driver.ID

func (*T) ExposedDevices

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

func (*T) Head

func (t *T) Head() string

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

func (t *T) IsVolatile() bool

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

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

func (t *T) MoveCopiesStorage() bool

MoveCopiesStorage implements resource.MoveStorageCopier, saying what the resource exposing the device of the volume says.

func (*T) PostMove

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

func (*T) PreMove

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

func (*T) PreMoveRollback

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

func (*T) ProvisionAsFollower

func (t *T) ProvisionAsFollower(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)

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

func (t *T) ResizeTarget(ctx context.Context) (naming.Path, error)

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

func (t *T) SnapshotHead(ctx context.Context, name string) (string, func() error, bool, error)

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

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

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

func (t *T) Status(ctx context.Context) status.T

func (*T) StatusInfo

func (t *T) StatusInfo(context.Context) map[string]any

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.

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

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

func (*T) ValidateNodesAndName

func (t *T) ValidateNodesAndName() error

func (*T) Volume

func (t *T) Volume() (object.Vol, error)

func (*T) VolumeList

func (t *T) VolumeList(_ context.Context) naming.Paths

VolumeList implements the volumeLister interface: the vol object of the resource, its name as set or by default, the one Volume opens.

Jump to

Keyboard shortcuts

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