storage

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 22 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 (
	// SSDOverProvisionFactor over provision factor for SSDs
	SSDOverProvisionFactor = 2
	// CacheTarget is the path where the cache disk is mounted
	CacheTarget = "/var/cache"
)

Variables

This section is empty.

Functions

This section is empty.

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) 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) Cache added in v0.5.5

func (s *Module) Cache() (pkg.Volume, error)

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

func (*Module) DeviceAllocate added in v0.5.5

func (m *Module) DeviceAllocate(min gridtypes.Unit) (pkg.Device, error)

DeviceAllocate allocates a new free device, allocation is done by creation a zdb subvolume

func (*Module) DeviceLookup added in v0.5.5

func (m *Module) DeviceLookup(name string) (pkg.Device, error)

DeviceLookup looks up device by name

func (*Module) Devices added in v0.5.5

func (m *Module) Devices() ([]pkg.Device, error)

Devices list all "allocated" devices

func (*Module) DiskCreate added in v0.5.5

func (s *Module) DiskCreate(name string, size gridtypes.Unit) (disk pkg.VDisk, err error)

DiskCreate with given size, return path to virtual disk (size in MB)

func (*Module) DiskDelete added in v0.5.5

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

DiskDelete removes a virtual disk

func (*Module) DiskExists added in v0.5.5

func (s *Module) DiskExists(id string) bool

DiskExists checks if a disk exists

func (*Module) DiskFormat added in v0.5.5

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

DiskFormat ensures that the virtual disk has a valid filesystem currently the fs is btrfs

func (*Module) DiskList added in v0.5.5

func (s *Module) DiskList() ([]pkg.VDisk, error)

DiskList list all created disks

func (*Module) DiskLookup added in v0.5.5

func (s *Module) DiskLookup(id string) (disk pkg.VDisk, err error)

DiskLookup return info about the disk

func (*Module) DiskResize added in v0.5.5

func (s *Module) DiskResize(name string, size gridtypes.Unit) (disk pkg.VDisk, err error)

DiskCreate with given size, return path to virtual disk (size in MB)

func (*Module) DiskWrite added in v0.5.5

func (s *Module) DiskWrite(name string, image string) error

DiskWrite writes image to disk

func (*Module) Monitor added in v0.4.9

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

Monitor implements monitor method

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) VolumeCreate added in v0.5.5

func (s *Module) VolumeCreate(name string, size gridtypes.Unit) (pkg.Volume, error)

VolumeCreate with the given size in a storage pool.

func (*Module) VolumeDelete added in v0.5.5

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

VolumeDelete 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) VolumeList added in v0.5.5

func (s *Module) VolumeList() ([]pkg.Volume, error)

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

func (*Module) VolumeLookup added in v0.5.5

func (s *Module) VolumeLookup(name string) (pkg.Volume, error)

VolumeLookup 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) VolumeUpdate added in v0.5.5

func (s *Module) VolumeUpdate(name string, size gridtypes.Unit) error

VolumeUpdate updates filesystem size

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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