Documentation ¶
Index ¶
- Constants
- func ParseLayerList(s string) ([]lapi.LayerType, error)
- func SnapSort(snaps []*SnapInfo)
- func Sort(vols []*Info)
- type Assignment
- type AttacherDettacher
- type CreateDeleter
- type Info
- type Mounter
- type Parameters
- type Querier
- type SnapInfo
- type SnapshotCreateDeleter
- type VolumeStats
- type VolumeStatter
Constants ¶
const DefaultDisklessStoragePoolName = "DfltDisklessStorPool"
DefaultDisklessStoragePoolName is the hidden diskless storage pool that linstor assigned diskless volumes to if they're not given a user created DisklessStoragePool.
Variables ¶
This section is empty.
Functions ¶
func ParseLayerList ¶ added in v0.8.0
ParseLayerList returns a slice of LayerType from a string of space-separated layers.
Types ¶
type Assignment ¶
type Assignment struct { Vol *Info // Node is the node that the assignment is valid for. Node string // Path is a location on the Node's filesystem where the volume may be accessed. Path string }
Assignment represents a volume situated on a particular node.
type AttacherDettacher ¶
type AttacherDettacher interface { Querier Attach(ctx context.Context, vol *Info, node string) error Detach(ctx context.Context, vol *Info, node string) error NodeAvailable(ctx context.Context, node string) error GetAssignmentOnNode(ctx context.Context, vol *Info, node string) (*Assignment, error) }
AttacherDettacher handles operations relating to volume accessiblity on nodes.
type CreateDeleter ¶
type CreateDeleter interface { Querier Create(ctx context.Context, vol *Info, req *csi.CreateVolumeRequest) error Delete(ctx context.Context, vol *Info) error // AccessibleTopologies returns the list of key value pairs volume topologies // for the volume or nil if not applicable. AccessibleTopologies(ctx context.Context, vol *Info) ([]*csi.Topology, error) }
CreateDeleter handles the creation and deletion of volumes.
type Info ¶
type Info struct { Name string `json:"name"` ID string `json:"id"` CreatedBy string `json:"createdBy"` CreationTime time.Time `json:"creationTime"` SizeBytes int64 `json:"sizeBytes"` Readonly bool `json:"readonly"` Parameters map[string]string `json:"parameters"` Snapshots []*SnapInfo `json:"snapshots"` }
Info provides the everything need to manipulate volumes.
func (*Info) ToAutoPlace ¶ added in v0.8.0
func (i *Info) ToAutoPlace() (lapi.AutoPlaceRequest, error)
ToAutoPlace prepares a Info to be deployed by linstor via autoplace.
func (*Info) ToDiskfullResourceCreate ¶ added in v0.8.0
func (i *Info) ToDiskfullResourceCreate(node string) (lapi.ResourceCreate, error)
ToDiskfullResourceCreate prepares a Info to be deployed by linstor on a node with local storage.
func (*Info) ToDisklessResourceCreate ¶ added in v0.8.0
func (i *Info) ToDisklessResourceCreate(node string) (lapi.ResourceCreate, error)
ToDisklessResourceCreate prepares a Info to be deployed by linstor on a node without local storage.
func (*Info) ToResourceCreateList ¶ added in v0.8.0
func (i *Info) ToResourceCreateList() ([]lapi.ResourceCreate, error)
ToResourceCreateList prepares a list of lapi.ResourceCreate to be used to manually assign resources based on the node and client lists of the volume.
type Mounter ¶ added in v0.3.0
type Mounter interface { Mount(vol *Info, source, target, fsType string, options []string) error Unmount(target string) error IsNotMountPoint(target string) (bool, error) }
Mounter handles the filesystems located on volumes.
type Parameters ¶ added in v0.8.0
type Parameters struct { // ClientList is a list of nodes where the volume should be assigned to disklessly // at the time that the volume is first created. ClientList []string // NodeList is a list of nodes where the volume should be assigned to diskfully // at the time that the volume is first created. Specifying this overrides any // other automatic placement rules. NodeList []string // ReplicasOnDifferent is a list that corresponds to the `linstor resource create` // option of the same name. ReplicasOnDifferent []string // ReplicasOnSame is a list that corresponds to the `linstor resource create` // option of the same name. ReplicasOnSame []string // DisklessStoragePool is the diskless storage pool to use for diskless assignments. DisklessStoragePool string // DoNotPlaceWithRegex corresponds to the `linstor resource create` // option of the same name. DoNotPlaceWithRegex string // FSOpts is a string of filesystem options passed at mount time. FSOpts string // MountOpts is a string of mount options passed at mount time. Comma // separated like in /etc/fstab. MountOpts string // StoragePool is the storage pool to use for diskful assignments. StoragePool string SizeKiB uint64 // PlacementCount is the number of replicas of the volume in total. PlacementCount int32 // Disklessonremaining corresponds to the `linstor resource create` // option of the same name. Disklessonremaining bool // Encrypt volumes if true. Encryption bool // AllowRemoteVolumeAccess if true, volumes may be accessed over the network. AllowRemoteVolumeAccess bool // LayerList is a list that corresponds to the `linstor resource create` // option of the same name. LayerList []lapi.LayerType // PlacementPolicy determines where volumes are created. PlacementPolicy topology.PlacementPolicy // PostMountXfsOpts is an optional string of post-mount call PostMountXfsOpts string // ResourceGroup is the resource-group name in LINSTOR. ResourceGroup string // DRBDOpts are the options than can be set on DRBD resources DRBDOpts map[string]string }
Parameters configuration for linstor volumes.
func NewParameters ¶ added in v0.8.0
func NewParameters(params map[string]string) (Parameters, error)
NewParameters parses out the raw parameters we get and sets appropriate zero values
func (*Parameters) ToResourceGroupModify ¶ added in v0.8.2
func (params *Parameters) ToResourceGroupModify(rg *lapi.ResourceGroup) (lapi.ResourceGroupModify, error)
Convert parameters into a modify-object that reconciles any differences between parameters and resource group
type Querier ¶
type Querier interface { // ListAll should return a sorted list of pointers to Info. ListAll(ctx context.Context) ([]*Info, error) GetByName(ctx context.Context, name string) (*Info, error) //GetByID should return nil when volume is not found. GetByID(ctx context.Context, ID string) (*Info, error) // AllocationSizeKiB returns the number of KiB required to provision required bytes. AllocationSizeKiB(requiredBytes, limitBytes int64) (int64, error) // CapacityBytes determines the capacity of the underlying storage in Bytes. CapacityBytes(ctx context.Context, params map[string]string) (int64, error) }
Querier retrives various states of volumes.
type SnapshotCreateDeleter ¶ added in v0.8.0
type SnapshotCreateDeleter interface { SnapCreate(ctx context.Context, snap *SnapInfo) (*SnapInfo, error) SnapDelete(ctx context.Context, snap *SnapInfo) error GetSnapByName(ctx context.Context, name string) (*SnapInfo, error) GetSnapByID(ctx context.Context, ID string) (*SnapInfo, error) // List Snapshots should return a sorted list of snapshots. ListSnaps(ctx context.Context) ([]*SnapInfo, error) // CanonicalizeSnapshotName tries to return a relatively similar version // of the suggestedName if the storage backend cannot use the suggestedName // in its original form. CanonicalizeSnapshotName(ctx context.Context, suggestedName string) string // VolFromSnap creats a new volume based on the provided snapshot. VolFromSnap(ctx context.Context, snap *SnapInfo, vol *Info) error // VolFromVol creats a new volume based on the provided volume. VolFromVol(ctx context.Context, sourceVol, vol *Info) error }
SnapshotCreateDeleter handles the creation and deletion of snapshots.
type VolumeStats ¶ added in v0.8.0
type VolumeStats struct { AvailableBytes int64 TotalBytes int64 UsedBytes int64 AvailableInodes int64 TotalInodes int64 UsedInodes int64 }
VolumeStats provides details about filesystem usage.
type VolumeStatter ¶ added in v0.8.0
type VolumeStatter interface { // GetVolumeStats determines filesystem usage. GetVolumeStats(path string) (VolumeStats, error) }
VolumeStatter provides info about volume/filesystem usage.