common

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	//RebootCmdline reboot now
	RebootCmdline = "shutdown -r now"

	//RebootCheck check for the reboot
	RebootCheck = "reboot in 1 minute"
)
View Source
const (
	//DelayBetweenCommandsInSeconds just like it says
	DelayBetweenCommandsInSeconds = 5

	//DelayIfInstalledInSeconds just like it says
	DelayIfInstalledInSeconds = 5

	//DelayOnVolumeCreateInSeconds just like it says
	DelayOnVolumeCreateInSeconds = 20

	//DelayForRebootInSeconds the amount of time to wait for the reboot
	DelayForRebootInSeconds = 5

	//WaitForRebootInSeconds the amount of time to wait for the reboot
	WaitForRebootInSeconds = 120

	//OfflineTimeForMdmNodesInSeconds is the max time an MDM node can be offline
	OfflineTimeForMdmNodesInSeconds = 180

	//PollStatusInSeconds the amount of time to wait before updating state
	PollStatusInSeconds = 5

	//PollAfterFatalInSeconds the amount of time to wait before checking
	PollAfterFatalInSeconds = 3600

	//PollForChangesInSeconds cluster working. check for changes.
	PollForChangesInSeconds = 30
)

Variables

View Source
var (
	//ErrInitialStateFailed failed to get the initial state
	ErrInitialStateFailed = errors.New("Failed to get the initial cluster state")

	//ErrFindNodeFailed failed to find MDM Pair
	ErrFindNodeFailed = errors.New("Failed to find the specific node")

	//ErrMdmPairFailed failed to find MDM Pair
	ErrMdmPairFailed = errors.New("Failed to Find MDM Pair")

	//ErrStateChangeNotAcknowledged failed to find MDM Pair
	ErrStateChangeNotAcknowledged = errors.New("The node state change was not acknowledged")
)

Functions

func CreateMdmPairString

func CreateMdmPairString(state *types.ScaleIOFramework) (string, error)

CreateMdmPairString just like it sounds

func GenerateSdsName

func GenerateSdsName(node *types.ScaleIONode) string

GenerateSdsName creates the SDS name for this given node

func GetGatewayAddress

func GetGatewayAddress(state *types.ScaleIOFramework) (string, error)

GetGatewayAddress returns the ScaleIO gateway address

func GetPrimaryMdmNode

func GetPrimaryMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error)

GetPrimaryMdmNode gets the Primary node

func GetSecondaryMdmNode

func GetSecondaryMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error)

GetSecondaryMdmNode gets the Secondary node

func GetSelfNode

func GetSelfNode(state *types.ScaleIOFramework, executorID string) *types.ScaleIONode

GetSelfNode gets self

func GetTiebreakerMdmNode

func GetTiebreakerMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error)

GetTiebreakerMdmNode gets the TB node

func PersonaIDToString

func PersonaIDToString(persona int) string

PersonaIDToString PersonaID -> String

func PersonaStringToID

func PersonaStringToID(persona string) int

PersonaStringToID String -> PersonaID

func WaitForBaseFinish

func WaitForBaseFinish(sio IScaleioNode)

WaitForBaseFinish waits until base ScaleIO components have been installed

func WaitForCleanInstallReboot

func WaitForCleanInstallReboot(sio IScaleioNode)

WaitForCleanInstallReboot waits for reboot of nodes after install

func WaitForCleanPrereqsReboot

func WaitForCleanPrereqsReboot(sio IScaleioNode)

WaitForCleanPrereqsReboot waits until all systems are ready to reboot after prereq install

func WaitForClusterInitializeFinish

func WaitForClusterInitializeFinish(sio IScaleioNode)

WaitForClusterInitializeFinish wait until the cluster has been initialized

func WaitForClusterInstallFinish

func WaitForClusterInstallFinish(sio IScaleioNode)

WaitForClusterInstallFinish waits for the cluster to be created

func WaitForPrereqsFinish

func WaitForPrereqsFinish(sio IScaleioNode)

WaitForPrereqsFinish waits until all prereqs have been installed

func WaitForStableState

func WaitForStableState(getstate RetrieveState) *types.ScaleIOFramework

WaitForStableState waits until a state can successfully be retrieved

Types

type IScaleioNode

type IScaleioNode interface {
	GetSelfNode() *types.ScaleIONode
	UpdateScaleIOState() *types.ScaleIOFramework
	UpdateNodeState(nodeState int) error
	UpdateDevices() error
	UpdatePingNode() error

	RunStateUnknown()
	RunStateCleanPrereqsReboot()
	RunStatePrerequisitesInstalled()
	RunStateBasePackagedInstalled()
	RunStateInitializeCluster()
	RunStateAddResourcesToScaleIO()
	RunStateInstallRexRay()
	RunStateCleanInstallReboot()
	RunStateSystemReboot()
	RunStateFinishInstall()
	RunStateUpgradeCluster()
	RunStateFatalInstall()
}

IScaleioNode is the interface for implementing a ScaleIO node

type RetrieveState

type RetrieveState func() (*types.ScaleIOFramework, error)

RetrieveState is a call back to retrieve an update of the state

type ScaleioNode

type ScaleioNode struct {
	Config         *config.Config
	RebootRequired bool
	Node           *types.ScaleIONode
	State          *types.ScaleIOFramework
	GetState       RetrieveState
}

ScaleioNode implementation for ScaleIO Node

func (*ScaleioNode) GetSelfNode

func (bsn *ScaleioNode) GetSelfNode() *types.ScaleIONode

GetSelfNode returns myself

func (*ScaleioNode) RunStateAddResourcesToScaleIO added in v0.3.0

func (bsn *ScaleioNode) RunStateAddResourcesToScaleIO()

RunStateAddResourcesToScaleIO default action for StateAddResourcesToScaleIO

func (*ScaleioNode) RunStateBasePackagedInstalled

func (bsn *ScaleioNode) RunStateBasePackagedInstalled()

RunStateBasePackagedInstalled default action for StateBasePackagedInstalled

func (*ScaleioNode) RunStateCleanInstallReboot

func (bsn *ScaleioNode) RunStateCleanInstallReboot()

RunStateCleanInstallReboot default action for StateCleanInstallReboot

func (*ScaleioNode) RunStateCleanPrereqsReboot

func (bsn *ScaleioNode) RunStateCleanPrereqsReboot()

RunStateCleanPrereqsReboot default action for StateCleanPrereqsReboot

func (*ScaleioNode) RunStateFatalInstall

func (bsn *ScaleioNode) RunStateFatalInstall()

RunStateFatalInstall default action for StateFatalInstall

func (*ScaleioNode) RunStateFinishInstall

func (bsn *ScaleioNode) RunStateFinishInstall()

RunStateFinishInstall default action for StateFinishInstall

func (*ScaleioNode) RunStateInitializeCluster

func (bsn *ScaleioNode) RunStateInitializeCluster()

RunStateInitializeCluster default action for StateInitializeCluster

func (*ScaleioNode) RunStateInstallRexRay

func (bsn *ScaleioNode) RunStateInstallRexRay()

RunStateInstallRexRay default action for StateInstallRexRay

func (*ScaleioNode) RunStatePrerequisitesInstalled

func (bsn *ScaleioNode) RunStatePrerequisitesInstalled()

RunStatePrerequisitesInstalled default action for StatePrerequisitesInstalled

func (*ScaleioNode) RunStateSystemReboot

func (bsn *ScaleioNode) RunStateSystemReboot()

RunStateSystemReboot default action for StateSystemReboot

func (*ScaleioNode) RunStateUnknown

func (bsn *ScaleioNode) RunStateUnknown()

RunStateUnknown default action for StateUnknown

func (*ScaleioNode) RunStateUpgradeCluster

func (bsn *ScaleioNode) RunStateUpgradeCluster()

RunStateUpgradeCluster default action for StateUpgradeCluster

func (*ScaleioNode) UpdateDevices added in v0.3.0

func (bsn *ScaleioNode) UpdateDevices() error

UpdateDevices this function tells the scheduler which devices to add

func (*ScaleioNode) UpdateNodeState

func (bsn *ScaleioNode) UpdateNodeState(nodeState int) error

UpdateNodeState this function tells the scheduler that the executor's state has changed

func (*ScaleioNode) UpdatePingNode

func (bsn *ScaleioNode) UpdatePingNode() error

UpdatePingNode this function tells the scheduler that "I am still here"

func (*ScaleioNode) UpdateScaleIOState

func (bsn *ScaleioNode) UpdateScaleIOState() *types.ScaleIOFramework

UpdateScaleIOState updates the state of the framework

Jump to

Keyboard shortcuts

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