migrate

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultWorkerCount = 3

Variables

This section is empty.

Functions

func ConfigToAZMapping added in v0.6.0

func ConfigToAZMapping(c config.Config) ([]converter.AZMapping, error)

ConfigToAZMapping creates the expanded source -> target AZ mappings used by the compute mapper

func ConfigToAdditionalVMs added in v0.6.0

func ConfigToAdditionalVMs(c config.Config) []bosh.VM

ConfigToAdditionalVMs creates a list of additional non-bosh VMs to migrate

func ConfigToSourceClustersByAZ added in v0.6.0

func ConfigToSourceClustersByAZ(c config.Config) map[string][]string

ConfigToSourceClustersByAZ creates a map of AZs to their source clusters

func ConfigToTargetHostPoolConfig added in v0.6.0

func ConfigToTargetHostPoolConfig(c config.Config) *vcenter.HostPoolConfig

ConfigToTargetHostPoolConfig creates the required configuration format to create a target host pool

func ConfigToVCenterClientPool added in v0.6.0

func ConfigToVCenterClientPool(c config.Config) *vcenter.Pool

ConfigToVCenterClientPool creates a pool of VCenter clients for each AZ source and target

Types

type BoshClient

type BoshClient interface {
	VMsAndStemcells(context.Context) ([]bosh.VM, error)
}

func ConfigToBoshClient added in v0.6.0

func ConfigToBoshClient(c config.Config) BoshClient

ConfigToBoshClient creates an optional bosh client if configured, other a null object (pattern)

type FoundationMigrator

type FoundationMigrator struct {
	WorkerCount   int
	AdditionalVMs []bosh.VM
	// contains filtered or unexported fields
}

FoundationMigrator orchestrates the entire migration of a foundation

func NewFoundationMigrator

func NewFoundationMigrator(
	clientPool *vcenter.Pool,
	boshClient BoshClient,
	vmMigrator *VMMigrator,
	srcAZsToClusters map[string][]string,
	out *log.UpdatableStdout) *FoundationMigrator

NewFoundationMigrator creates a new initialized FoundationMigrator using the provided instances

func NewFoundationMigratorFromConfig added in v0.6.0

func NewFoundationMigratorFromConfig(c config.Config) (*FoundationMigrator, error)

NewFoundationMigratorFromConfig creates a new FoundationMigrator instance from the specified config

func (*FoundationMigrator) Migrate

func (f *FoundationMigrator) Migrate(ctx context.Context) error

Migrate executes the entire migration for all VMs

type NullBoshClient added in v0.5.0

type NullBoshClient struct{}

NullBoshClient is a null object pattern when no bosh client is specified in the config

func (NullBoshClient) VMsAndStemcells added in v0.5.0

func (c NullBoshClient) VMsAndStemcells(context.Context) ([]bosh.VM, error)

VMsAndStemcells returns an empty list

type UpdatableLogger added in v0.6.0

type UpdatableLogger interface {
	PrintUpdatablef(id, format string, a ...interface{})
}

type VCenterClient

type VCenterClient interface {
	HostName() string
	Datacenter() string
	FindVMInClusters(ctx context.Context, az, vmNameOrPath string, clusters []string) (*vcenter.VM, error)
}

type VM added in v0.6.0

type VM struct {
	Name string
	AZ   string

	// list of clusters within the source AZ that may contain the VM
	Clusters []string
}

type VMMigrator

type VMMigrator struct {
	// contains filtered or unexported fields
}

func NewVMMigrator

func NewVMMigrator(clientPool *vcenter.Pool, sourceVMConverter *converter.Converter, vmRelocator VMRelocator, updatableStdout UpdatableLogger) *VMMigrator

func (*VMMigrator) Migrate

func (m *VMMigrator) Migrate(ctx context.Context, sourceVM VM) error

func (*VMMigrator) MigrateVMToTarget added in v0.6.0

func (m *VMMigrator) MigrateVMToTarget(ctx context.Context, sourceClient VCenterClient, sourceVM VM) error

type VMRelocator

type VMRelocator interface {
	RelocateVM(ctx context.Context, srcVM *vcenter.VM, vmTargetSpec *vcenter.TargetSpec) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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