migration

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IndexHeaderVersion uint32 = 1

IndexHeaderVersion version of the index header to be sent/recv.

Variables

View Source
var (
	ErrNoLiveMigrationSource = fmt.Errorf("%s CRIU isn't installed on the source server. %s on the source server", unableToLiveMigrate, toMigrateLive)
	ErrNoLiveMigrationTarget = fmt.Errorf("%s CRIU isn't installed on the target server. %s on the target server", unableToLiveMigrate, toMigrateLive)
	ErrNoLiveMigration       = fmt.Errorf("%s CRIU isn't installed. %s", unableToLiveMigrate, toMigrateLive)
)

Functions

func ProgressReader

func ProgressReader(op *operations.Operation, key string, description string) func(io.ReadCloser) io.ReadCloser

ProgressReader reports the read progress.

func ProgressTracker

func ProgressTracker(op *operations.Operation, key string, description string) *ioprogress.ProgressTracker

ProgressTracker returns a migration I/O tracker.

func ProgressWriter

func ProgressWriter(op *operations.Operation, key string, description string) func(io.WriteCloser) io.WriteCloser

ProgressWriter reports the write progress.

func TypesToHeader

func TypesToHeader(types ...Type) *migration.MigrationHeader

TypesToHeader converts one or more Types to a MigrationHeader. It uses the first type argument supplied to indicate the preferred migration method and sets the MigrationHeader's Fs type to that. If the preferred type is ZFS then it will also set the header's optional ZfsFeatures. If the fallback Rsync type is present in any of the types even if it is not preferred, then its optional features are added to the header's RsyncFeatures, allowing for fallback negotiation to take place on the farside.

Types

type ControlResponse

type ControlResponse struct {
	migration.MigrationControl
	Err error
}

ControlResponse encapsulates MigrationControl with a receive error.

type Info

type Info struct {
	Config *backupConfig.Config `json:"config,omitempty" yaml:"config,omitempty"` // Equivalent of backup.yaml but embedded in index.
}

Info represents the index frame sent if supported.

type InfoResponse

type InfoResponse struct {
	StatusCode int
	Error      string
	Refresh    *bool // This is used to let the source know whether to actually refresh a volume.
}

InfoResponse represents the response to the index frame sent if supported. Right now this doesn't contain anything useful, its just used to indicate receipt of the index header. But in the future the itention is to use it allow the target to send back additional information to the source about which frames (such as snapshots) it needs for the migration after having inspected the Info index header.

func (*InfoResponse) Err

func (r *InfoResponse) Err() error

Err returns the error of the response.

type Type

type Type struct {
	FSType   migration.MigrationFSType // Transport mode selected.
	Features []string                  // Feature hints for selected FSType transport mode.
}

Type represents the migration transport type. It indicates the method by which the migration can take place and what optional features are available.

func MatchTypes

func MatchTypes(offer *migration.MigrationHeader, fallbackType migration.MigrationFSType, ourTypes []Type) ([]Type, error)

MatchTypes attempts to find matching migration transport types between an offered type sent from a remote source and the types supported by a local storage pool. If matches are found then one or more Types are returned containing the method and the matching optional features present in both. The function also takes a fallback type which is used as an additional offer type preference in case the preferred remote type is not compatible with the local type available. It is expected that both sides of the migration will support the fallback type for the volume's content type that is being migrated.

type VolumeSourceArgs

type VolumeSourceArgs struct {
	IndexHeaderVersion uint32
	Name               string
	Snapshots          []string
	MigrationType      Type
	TrackProgress      bool
	MultiSync          bool
	FinalSync          bool
	Data               any // Optional store to persist storage driver state between MultiSync phases.
	ContentType        string
	AllowInconsistent  bool
	Refresh            bool
	Info               *Info
	VolumeOnly         bool
	ClusterMove        bool
}

VolumeSourceArgs represents the arguments needed to setup a volume migration source.

type VolumeTargetArgs

type VolumeTargetArgs struct {
	IndexHeaderVersion    uint32
	Name                  string
	Description           string
	Config                map[string]string // Only used for custom volume migration.
	Snapshots             []string
	MigrationType         Type
	TrackProgress         bool
	Refresh               bool
	Live                  bool
	VolumeSize            int64
	ContentType           string
	VolumeOnly            bool
	ClusterMoveSourceName string
}

VolumeTargetArgs represents the arguments needed to setup a volume migration sink.

Jump to

Keyboard shortcuts

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