Documentation
¶
Index ¶
- Constants
- func PolicyHDDOnly(s *Module) []filesystem.Pool
- func PolicySSDFirst(s *Module) []filesystem.Pool
- func PolicySSDOnly(s *Module) []filesystem.Pool
- type Module
- func (s *Module) BrokenDevices() []pkg.BrokenDevice
- func (s *Module) BrokenPools() []pkg.BrokenPool
- func (s *Module) Cache() (pkg.Volume, error)
- func (m *Module) DeviceAllocate(min gridtypes.Unit) (pkg.Device, error)
- func (m *Module) DeviceLookup(name string) (pkg.Device, error)
- func (m *Module) Devices() ([]pkg.Device, error)
- func (s *Module) DiskCreate(name string, size gridtypes.Unit) (disk pkg.VDisk, err error)
- func (s *Module) DiskDelete(name string) error
- func (s *Module) DiskDownload(id string, url string) error
- func (s *Module) DiskDownloadCompressed(id string, url string, compression string) error
- func (s *Module) DiskExists(id string) bool
- func (s *Module) DiskFormat(name string) error
- func (s *Module) DiskList() ([]pkg.VDisk, error)
- func (s *Module) DiskLookup(id string) (disk pkg.VDisk, err error)
- func (s *Module) DiskResize(name string, size gridtypes.Unit) (disk pkg.VDisk, err error)
- func (s *Module) DiskUpload(id string, url string) error
- func (s *Module) DiskUploadCompressed(id string, url string, compression string) error
- func (s *Module) DiskWrite(name string, image string) error
- func (s *Module) Metrics() ([]pkg.PoolMetrics, error)
- func (s *Module) Monitor(ctx context.Context) <-chan pkg.PoolsStats
- func (s *Module) Total(kind pkg.DeviceType) (uint64, error)
- func (s *Module) VolumeCreate(name string, size gridtypes.Unit) (pkg.Volume, error)
- func (s *Module) VolumeDelete(name string) error
- func (s *Module) VolumeDownload(name string, size gridtypes.Unit, url string) error
- func (s *Module) VolumeDownloadCompressed(name string, size gridtypes.Unit, url string, compression string) error
- func (s *Module) VolumeExists(name string) (bool, error)
- func (s *Module) VolumeList() ([]pkg.Volume, error)
- func (s *Module) VolumeLookup(name string) (pkg.Volume, error)
- func (s *Module) VolumeUpdate(name string, size gridtypes.Unit) error
- func (s *Module) VolumeUpload(name string, url string) error
- func (s *Module) VolumeUploadCompressed(name string, url string, compression string) error
- type Policy
- type TypeCache
Constants ¶
const ( // SSDOverProvisionFactor over provision factor for SSDs SSDOverProvisionFactor = 1 // CacheTarget is the path where the cache disk is mounted CacheTarget = "/var/cache" )
Variables ¶
This section is empty.
Functions ¶
func PolicyHDDOnly ¶
func PolicyHDDOnly(s *Module) []filesystem.Pool
func PolicySSDFirst ¶
func PolicySSDFirst(s *Module) []filesystem.Pool
func PolicySSDOnly ¶
func PolicySSDOnly(s *Module) []filesystem.Pool
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements functionality for pkg.StorageModule
func (*Module) BrokenDevices ¶
func (s *Module) BrokenDevices() []pkg.BrokenDevice
BrokenDevices lists the broken devices that have been detected
func (*Module) BrokenPools ¶
func (s *Module) BrokenPools() []pkg.BrokenPool
BrokenPools lists the broken storage pools that have been detected
func (*Module) Cache ¶
Cache return the special filesystem used by 0-OS to store internal state and flist cache
func (*Module) DeviceAllocate ¶
DeviceAllocate allocates a new free device, allocation is done by creation a zdb subvolume
func (*Module) DeviceLookup ¶
DeviceLookup looks up device by name
func (*Module) DiskCreate ¶
DiskCreate with given size, return path to virtual disk (size in MB)
func (*Module) DiskDelete ¶
DiskDelete removes a virtual disk
func (*Module) DiskDownload ¶ added in v1.1.3
DiskDownload downloads bytes from the given presigned URL and writes them into the existing vdisk file identified by id. The disk must already exist (it is created when the zmount workload is provisioned during prepare).
func (*Module) DiskDownloadCompressed ¶ added in v1.1.5
DiskDownloadCompressed is DiskDownload of bytes encoded as `compression` names.
func (*Module) DiskExists ¶
DiskExists checks if a disk exists
func (*Module) DiskFormat ¶
DiskFormat ensures that the virtual disk has a valid filesystem currently the fs is btrfs
func (*Module) DiskLookup ¶
DiskLookup return info about the disk
func (*Module) DiskResize ¶
DiskCreate with given size, return path to virtual disk (size in MB)
func (*Module) DiskUpload ¶ added in v1.1.3
DiskUpload streams the raw vdisk file identified by id to the given presigned URL using an HTTP PUT. Used to move a zmount (or a full-VM boot disk) to another node during a deployment transfer.
func (*Module) DiskUploadCompressed ¶ added in v1.1.5
DiskUploadCompressed is DiskUpload with the bytes encoded as `compression` names ("" sends them as they are, "zstd" compresses them).
func (*Module) DiskWrite ¶
DiskWrite writes image to disk. Disk will not be changed if it already has a filesystem or partition table.
func (*Module) Monitor ¶
func (s *Module) Monitor(ctx context.Context) <-chan pkg.PoolsStats
Monitor implements monitor method
func (*Module) Total ¶
func (s *Module) Total(kind pkg.DeviceType) (uint64, error)
Total gives the total amount of storage available for a device type
func (*Module) VolumeCreate ¶
VolumeCreate with the given size in a storage pool.
func (*Module) VolumeDelete ¶
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) VolumeDownload ¶ added in v1.1.3
VolumeDownload makes sure a subvolume `name` of the given size exists, then downloads a tar from the presigned URL and extracts it into the subvolume.
func (*Module) VolumeDownloadCompressed ¶ added in v1.1.5
func (s *Module) VolumeDownloadCompressed(name string, size gridtypes.Unit, url string, compression string) error
VolumeDownloadCompressed is VolumeDownload of a tar encoded as `compression` names.
func (*Module) VolumeExists ¶
VolumeExists returns an error if the lookup failed and a bool describing if the volume exists
func (*Module) VolumeList ¶
VolumeList return all the filesystem managed by storeaged present on the nodes
func (*Module) VolumeLookup ¶
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 ¶
VolumeUpdate updates filesystem size
func (*Module) VolumeUpload ¶ added in v1.1.3
VolumeUpload tars the subvolume named `name` and streams it to the given presigned URL using an HTTP PUT. Used to move a VM's writable rootfs layer (subvolume "rootfs:<workloadID>") to another node.