linstor

package module
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: GPL-2.0 Imports: 8 Imported by: 28

README

golinstor

This library aims to be a simple go interface for Linstor

This library is in an early stage and does not yet have a stable API: vendor this package, should you use it.

Documentation

godocs

License

GPL2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnoughFreeSpace

func EnoughFreeSpace(requestedKiB, replicas string) error

EnoughFreeSpace checks to see if there's enough free space to create a new resource.

func GetDevPath added in v0.7.0

func GetDevPath(r Resource, stat bool) (string, error)

func WaitForDevPath

func WaitForDevPath(r Resource, maxRetries int) (string, error)

WaitForDevPath polls until the resourse path appears on the system.

Types

type FSUtil

type FSUtil struct {
	*Resource
	BlockSize int64
	FSType    string
	Force     bool
	XFSDataSU string
	XFSDataSW int
	XFSLogDev string
	// contains filtered or unexported fields
}

FSUtil handles creating a filesystem and mounting resources.

func (FSUtil) Mount

func (f FSUtil) Mount(path string) error

Mount the FSUtil's resource on the path.

func (FSUtil) UnMount

func (f FSUtil) UnMount(path string) error

UnMount the FSUtil's resource from the path.

type Resource

type Resource struct {
	Name                string
	NodeName            string
	Redundancy          string
	NodeList            []string
	ClientList          []string
	AutoPlace           string
	DoNotPlaceWithRegex string
	SizeKiB             uint64
	StoragePool         string
	DisklessStoragePool string
	Encryption          bool
}

Resource contains all the information needed to query and assign/deploy a resource. If you're deploying a resource, Redundancy is required. If you're assigning a resource to a particular node, NodeName is required.

func (Resource) Assign

func (r Resource) Assign() error

Assign assigns a resource with diskfull storage to all nodes in its NodeList, then attaches the resource disklessly to all nodes in its ClientList.

func (Resource) Create added in v0.1.0

func (r Resource) Create() error

Create reserves the resource name in Linstor.

func (Resource) CreateAndAssign added in v0.1.0

func (r Resource) CreateAndAssign() error

CreateAndAssign deploys the resource, created a new one if it doesn't exist.

func (Resource) Delete added in v0.1.0

func (r Resource) Delete() error

Delete removes a resource entirely from all nodes.

func (Resource) Exists

func (r Resource) Exists() (bool, error)

Exists checks to see if a resource is defined in DRBD Manage.

func (Resource) IsClient

func (r Resource) IsClient(nodeName string) bool

IsClient determines if resource is running as a client on nodeName.

func (Resource) OnNode added in v0.1.0

func (r Resource) OnNode(nodeName string) (bool, error)

OnNode determines if a resource is present on a particular node.

func (Resource) Unassign

func (r Resource) Unassign(nodeName string) error

Unassign unassigns a resource from a particular node.

Jump to

Keyboard shortcuts

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