Documentation ¶
Index ¶
- Constants
- Variables
- func Capacity(poolName string) (*apis.CStorPoolCapacityAttr, error)
- func CheckForZreplContinuous(ZreplRetryInterval time.Duration)
- func CheckForZreplInitial(ZreplRetryInterval time.Duration)
- func CreatePool(cStorPool *apis.CStorPool, blockDeviceList []string) error
- func DeletePool(poolName string) error
- func GetDevPathIfNotSlashDev(devID string) string
- func GetDeviceIDs(csp *apis.CStorPool) ([]string, error)
- func GetPoolName() ([]string, error)
- func ImportPool(cStorPool *apis.CStorPool, importOptions *ImportOptions) (string, error)
- func LabelClear(blockDevices []string) error
- func SetCachefile(cStorPool *apis.CStorPool) error
- func SetPoolRDMode(csp *apis.CStorPool, isROMode bool) error
- func Status(poolName string) (string, bool, error)
- func ValidatePool(cStorPool *apis.CStorPool, devID []string) error
- type ImportOptions
- type PoolNamePrefix
Constants ¶
const ( StatusNoPoolsAvailable = "no pools available" ZpoolStatusDegraded = "DEGRADED" ZpoolStatusFaulted = "FAULTED" ZpoolStatusOffline = "OFFLINE" ZpoolStatusOnline = "ONLINE" ZpoolStatusRemoved = "REMOVED" )
PoolOperator is the name of the tool that makes pool-related operations.
Variables ¶
var CStorZpools map[string]zpool.Topology
CStorZpools is a map of imported cstor pools config at backend identified via their UID
var ImportedCStorPools map[string]*apis.CStorPool
ImportedCStorPools is a map of imported cstor pools API config identified via their UID
var PoolAddEventHandled = false
PoolAddEventHandled is a flag representing if the pool has been initially imported or created
var RunnerVar util.Runner
RunnerVar the runner variable for executing binaries.
Functions ¶
func Capacity ¶
func Capacity(poolName string) (*apis.CStorPoolCapacityAttr, error)
Capacity finds the capacity of the pool. The ouptut of command executed is as follows:
root@cstor-sparse-pool-o8bw-6869f69cc8-jhs6c:/# zpool get size,free,allocated cstor-2ebe403a-f2e2-11e8-87fd-42010a800087 NAME PROPERTY VALUE SOURCE cstor-2ebe403a-f2e2-11e8-87fd-42010a800087 size 9.94G - cstor-2ebe403a-f2e2-11e8-87fd-42010a800087 free 9.94G - cstor-2ebe403a-f2e2-11e8-87fd-42010a800087 allocated 202K -
func CheckForZreplContinuous ¶
CheckForZreplContinuous is continuous health checker for status of zrepl in cstor-pool container.
func CheckForZreplInitial ¶
CheckForZreplInitial is blocking call for checking status of zrepl in cstor-pool container.
func CreatePool ¶
CreatePool creates a new cStor pool.
func GetDevPathIfNotSlashDev ¶
GetDevPathIfNotSlashDev gets the path from given deviceID if its not prefix to "/dev"
func GetDeviceIDs ¶
GetDeviceIDs returns the list of device IDs for the csp.
func GetPoolName ¶
GetPoolName return the pool already created.
func ImportPool ¶
func ImportPool(cStorPool *apis.CStorPool, importOptions *ImportOptions) (string, error)
ImportPool imports cStor pool if already present.
func LabelClear ¶
LabelClear is to clear zpool label on block devices.
func SetCachefile ¶
SetCachefile is to set the cachefile for pool.
func SetPoolRDMode ¶
SetPoolRDMode set/unset pool readonly
Types ¶
type ImportOptions ¶
type ImportOptions struct { // CachefileFlag option to use cachefile for import CachefileFlag bool // DevPath is directory where pool devices resides DevPath string // contains filtered or unexported fields }
ImportOptions contains the options to build import command
type PoolNamePrefix ¶
type PoolNamePrefix string
PoolNamePrefix is a typed string to store pool name prefix
const (
PoolPrefix PoolNamePrefix = "cstor-"
)
PoolPrefix is prefix for pool name