Documentation
¶
Index ¶
- Variables
- func New() resource.Driver
- type DRBDDriver
- type NodeTemplateData
- type ResTemplateData
- type T
- func (t *T) ClaimedDevices() device.L
- func (t *T) Connect(ctx context.Context, nodeID string) error
- func (t *T) CreateMD(ctx context.Context) error
- func (t *T) Down(ctx context.Context) error
- func (t *T) DownForce(ctx context.Context) error
- func (t *T) ExposedDevices() device.L
- func (t *T) GoSecondary(ctx context.Context) error
- func (t *T) Info(_ context.Context) (resource.InfoKeys, error)
- func (t *T) Label(_ context.Context) string
- func (t *T) Manifest() *manifest.T
- func (t *T) Name() string
- func (t *T) PostMove(ctx context.Context, peer string) error
- func (t *T) PreMove(ctx context.Context, peer string) error
- func (t *T) PreMoveRollback(ctx context.Context, peer string) error
- func (t *T) ProvisionAsFollower(ctx context.Context) error
- func (t *T) ProvisionAsLeader(ctx context.Context) error
- func (t *T) ProvisionStart(_ context.Context) error
- func (t *T) Provisioned() (provisioned.T, error)
- func (t *T) ReservableDevices() device.L
- func (t *T) Shutdown(ctx context.Context) error
- func (t *T) Start(ctx context.Context) error
- func (t *T) StartStandby(ctx context.Context) error
- func (t *T) Status(ctx context.Context) status.T
- func (t *T) StatusInfo(context.Context) map[string]any
- func (t *T) Stop(ctx context.Context) error
- func (t *T) StopStandby(ctx context.Context) error
- func (t *T) SubDevices() device.L
- func (t *T) UnprovisionAsFollower(ctx context.Context) error
- func (t *T) UnprovisionAsLeader(ctx context.Context) error
- func (t *T) UnprovisionStop(_ context.Context) error
- func (t *T) Up(ctx context.Context) error
- func (t *T) WipeMD(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var (
MaxNodes = 32
)
Functions ¶
Types ¶
type DRBDDriver ¶
type DRBDDriver interface {
Adjust(context.Context) error
Attach(context.Context) error
ConfigurePeerMultiPrimary(ctx context.Context, peer string, enabled bool) error
Connect(context.Context, string) error
ConnStates(context.Context) (drbd.CStateM, error)
ConnState(context.Context, string) (string, error)
CreateMD(context.Context, int) error
DetachForce(context.Context) error
Disconnect(context.Context) error
DiskStates(context.Context) ([]string, error)
Down(context.Context) error
HasMD(context.Context) (bool, error)
IsDefined(context.Context) (bool, error)
Primary(context.Context) error
PrimaryForce(context.Context) error
Role(context.Context) (string, error)
Secondary(context.Context) error
Up(context.Context) error
WipeMD(context.Context) error
WaitCState(ctx context.Context, nodeID string, timeout time.Duration, candidates ...string) (string, error)
WaitConnectingOrConnected(ctx context.Context, nodeID string) (string, error)
StartConnections(context.Context, ...string) error
Show(ctx context.Context) (drbd.DrbdShow, error)
}
type NodeTemplateData ¶
NodeTemplateData represents a structure to hold template data for individual nodes, including their name, address, device, and disk information. It is exported (public) to help template designers to use it.
type ResTemplateData ¶
type ResTemplateData struct {
Name string
Nodes []NodeTemplateData
}
ResTemplateData represents template data for a resource configuration, it is exported (public) to help template designers to use it.
It defines the available fields that template designers can use. Example usage in a template:
resource {{.Name}} {
{{range $node := .Nodes}}
on {{$node.Name}} {
device {{$node.Device}};
disk {{$node.Disk}};
meta-disk internal;
address {{$node.Addr}};
node-id {{$node.NodeId}};
}
{{end}}
connection-mesh {
hosts{{range $node := .Nodes}} {{$node.Name}}{{end}};
}
net {
rr-conflict retry-connect;
}
}
type T ¶
type T struct {
resdisk.T
Path naming.Path `json:"path"`
Nodes []string `json:"nodes"`
Res string `json:"res"`
Disk string `json:"disk"`
MaxPeers int `json:"max_peers"`
Addr string `json:"addr"`
Port int `json:"port"`
Network string `json:"network"`
Template string `json:"template"`
}
func (*T) ClaimedDevices ¶
func (*T) DownForce ¶
DownForce is called by the unprovisioner. Dataloss is not an issue there, so forced detach can be tried.
func (*T) ExposedDevices ¶
func (*T) Label ¶
Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource
func (*T) PostMove ¶
PostMove moves the local res to secondary and disables the multiple primaries on the peer connection name.
func (*T) PreMove ¶
PreMove prepares the peer connection and promotes it to primary for multi-primary mode during resource operations.
func (*T) PreMoveRollback ¶
PreMoveRollback ensures a rollback of a pre-move operation, promoting peer as secondary and disabling multi-primary mode to the peer connection.
func (*T) ProvisionStart ¶
ProvisionStart is a noop to avoid calling the normal Start after provision
func (*T) Provisioned ¶
func (t *T) Provisioned() (provisioned.T, error)
func (*T) ReservableDevices ¶
func (*T) SubDevices ¶
func (*T) UnprovisionStop ¶
UnprovisionStop is a noop to avoid calling the normal Stop before unprovision