pool

package
Version: v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNoPoolsAvailable = "no pools available"
	ZpoolStatusDegraded    = "DEGRADED"
	ZpoolStatusFaulted     = "FAULTED"
	ZpoolStatusOffline     = "OFFLINE"
	ZpoolStatusOnline      = "ONLINE"
	ZpoolStatusRemoved     = "REMOVED"
	ZpoolStatusUnavail     = "UNAVAIL"
)

PoolOperator is the name of the tool that makes pool-related operations.

Variables

View Source
var CStorZpools map[string]zpool.Topology

CStorZpools is a map of imported cstor pools config at backend identified via their UID

View Source
var ImportedCStorPools map[string]*apis.CStorPool

ImportedCStorPools is a map of imported cstor pools API config identified via their UID

View Source
var PoolAddEventHandled = false

PoolAddEventHandled is a flag representing if the pool has been initially imported or created

View Source
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

func CheckForZreplContinuous(ZreplRetryInterval time.Duration)

CheckForZreplContinuous is continuous health checker for status of zrepl in cstor-pool container.

func CheckForZreplInitial

func CheckForZreplInitial(ZreplRetryInterval time.Duration)

CheckForZreplInitial is blocking call for checking status of zrepl in cstor-pool container.

func CreatePool

func CreatePool(cStorPool *apis.CStorPool, blockDeviceList []string) error

CreatePool creates a new cStor pool.

func DeletePool

func DeletePool(poolName string) error

DeletePool destroys the pool created.

func GetDevPathIfNotSlashDev

func GetDevPathIfNotSlashDev(devID string) string

GetDevPathIfNotSlashDev gets the path from given deviceID if its not prefix to "/dev"

func GetDeviceIDs

func GetDeviceIDs(csp *apis.CStorPool) ([]string, error)

GetDeviceIDs returns the list of device IDs for the csp.

func GetPoolName

func GetPoolName() ([]string, error)

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

func LabelClear(blockDevices []string) error

LabelClear is to clear zpool label on block devices.

func SetCachefile

func SetCachefile(cStorPool *apis.CStorPool) error

SetCachefile is to set the cachefile for pool.

func SetPoolRDMode

func SetPoolRDMode(csp *apis.CStorPool, isROMode bool) error

SetPoolRDMode set/unset pool readonly

func Status

func Status(poolName string) (string, bool, error)

root@cstor-pool-1dvj-854db8dc56-prblp:/# zpool get -Hp -ovalue health,io.openebs:readonly cstor-3cbec7b9-578d-11ea-b66e-42010a9a0080 ONLINE off

The output is then parsed by poolStatusOutputParser function to get the status of the pool

func ValidatePool

func ValidatePool(cStorPool *apis.CStorPool, devID []string) error

ValidatePool checks for validity of CStorPool resource.

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

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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