storage

package
v0.4.7-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

README

Storage

Implementation of the storage module interface

Mountpoints

Every volume which is managed by the storage module is mounted in /mnt. The name of the mountpoint is the label of the volume. For instance, a volume with label volumelabel will be mounted in /mnt/volumelabel. The volumes are mounted when the storage module is started, and remain mounted after that. In case the storae module exits in any way, there is no attempt to unmount any volume.

Since filesystems are created as subvolumes within the "root" volumes, they are always mounted.

Next to the volumes, the storage module also tries to instantiate a cache. It does this by creating a subvolume, preferably in a volume which was created on SSD devices, and then creates a bind mount in the /var directory. The full path of the cache is /var/path.

Documentation

Index

Constants

View Source
const (
	// CacheTarget is the path where the cache disk is mounted
	CacheTarget = "/var/cache"
)
View Source
const ZDBPoolPrefix = "zdb"

ZDBPoolPrefix is the prefix used for the subvolume create for 0-DB containers

Variables

This section is empty.

Functions

func NewVDiskModule

func NewVDiskModule(module *Module) (pkg.VDiskModule, error)

NewVDiskModule creates a new disk allocator

Types

type Module added in v0.4.9

type Module struct {
	// contains filtered or unexported fields
}

Module implements functionality for pkg.StorageModule

func New

func New() (*Module, error)

New create a new storage module service

func (*Module) Allocate added in v0.4.9

func (s *Module) Allocate(nsID string, diskType pkg.DeviceType, size uint64, mode pkg.ZDBMode) (allocation pkg.Allocation, err error)

Allocate is responsible to make sure the subvolume used by a 0-db as enough storage capacity of specified size, type and mode it returns the volume ID and its path or an error if it couldn't allocate enough storage

func (*Module) BrokenDevices added in v0.4.9

func (s *Module) BrokenDevices() []pkg.BrokenDevice

BrokenDevices lists the broken devices that have been detected

func (*Module) BrokenPools added in v0.4.9

func (s *Module) BrokenPools() []pkg.BrokenPool

BrokenPools lists the broken storage pools that have been detected

func (*Module) CreateFilesystem added in v0.4.9

func (s *Module) CreateFilesystem(name string, size uint64, poolType pkg.DeviceType) (pkg.Filesystem, error)

CreateFilesystem with the given size in a storage pool.

func (*Module) Find added in v0.4.9

func (s *Module) Find(nsID string) (allocation pkg.Allocation, err error)

Find finds a zdb namespace allocation

func (*Module) GetCacheFS added in v0.4.9

func (s *Module) GetCacheFS() (pkg.Filesystem, error)

GetCacheFS return the special filesystem used by 0-OS to store internal state and flist cache

func (*Module) ListFilesystems added in v0.4.9

func (s *Module) ListFilesystems() ([]pkg.Filesystem, error)

ListFilesystems return all the filesystem managed by storeaged present on the nodes

func (*Module) Monitor added in v0.4.9

func (s *Module) Monitor(ctx context.Context) <-chan pkg.PoolsStats

Monitor implements monitor method

func (*Module) Path added in v0.4.9

func (s *Module) Path(name string) (pkg.Filesystem, error)

Path return the path of the mountpoint of the named filesystem if no volume with name exists, an empty path and an error is returned

func (*Module) ReleaseFilesystem added in v0.4.9

func (s *Module) ReleaseFilesystem(name string) error

ReleaseFilesystem with the given name, this will unmount and then delete the filesystem. After this call, the caller must not perform any more actions on this filesystem

func (*Module) Total added in v0.4.9

func (s *Module) Total(kind pkg.DeviceType) (uint64, error)

Total gives the total amount of storage available for a device type

func (*Module) VDiskFindCandidate added in v0.4.9

func (s *Module) VDiskFindCandidate(size uint64) (path string, err error)

VDiskFindCandidate find a suitbale location for creating a vdisk of the given size

func (*Module) VDiskPools added in v0.4.9

func (s *Module) VDiskPools() ([]string, error)

VDiskPools return a list of all vdisk pools

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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