Documentation ¶
Index ¶
- func NewVMNotFoundError(name string, err error) error
- type AdapterNotFoundError
- type AdapterUpdater
- type Client
- func (c *Client) CreateFolder(ctx context.Context, folderPath string) error
- func (c *Client) Datacenter() string
- func (c *Client) FindVMInClusters(ctx context.Context, azName, vmNameOrPath string, clusters []string) (*VM, error)
- func (c *Client) HostName() string
- func (c *Client) Insecure() bool
- func (c *Client) Logout(ctx context.Context)
- func (c *Client) Password() string
- func (c *Client) URL() *url.URL
- func (c *Client) UserName() string
- type Disk
- type Finder
- func (f *Finder) Adapter(ctx context.Context, vmNameOrPath, networkName string) (*anyAdapter, error)
- func (f *Finder) AdapterBackingInfo(ctx context.Context, networkName string) (types.BaseVirtualDeviceBackingInfo, error)
- func (f *Finder) Cluster(ctx context.Context, clusterName string) (*object.ClusterComputeResource, error)
- func (f *Finder) Datastore(ctx context.Context, datastoreName string) (*object.Datastore, error)
- func (f *Finder) DatastoreRef(ctx context.Context, datastoreName string) (*types.ManagedObjectReference, error)
- func (f *Finder) Disks(ctx context.Context, vm *object.VirtualMachine) ([]Disk, error)
- func (f *Finder) Folder(ctx context.Context, folderPath string) (*object.Folder, error)
- func (f *Finder) FolderRef(ctx context.Context, folderPath string) (*types.ManagedObjectReference, error)
- func (f *Finder) HostsInCluster(ctx context.Context, clusterName string) ([]*object.HostSystem, error)
- func (f *Finder) Networks(ctx context.Context, vm *object.VirtualMachine) ([]string, error)
- func (f *Finder) ResourcePool(ctx context.Context, fullyQualifiedResourcePoolName string) (*object.ResourcePool, error)
- func (f *Finder) ResourcePoolRef(ctx context.Context, fullyQualifiedResourcePoolName string) (*types.ManagedObjectReference, error)
- func (f *Finder) VMClusterName(ctx context.Context, vm *object.VirtualMachine) (string, error)
- func (f *Finder) VirtualMachine(ctx context.Context, vmNameOrPath string) (*object.VirtualMachine, error)
- type HostPool
- func (hp *HostPool) Initialize(ctx context.Context) error
- func (hp *HostPool) LeaseAvailableHost(ctx context.Context, azName string) (*object.HostSystem, error)
- func (hp *HostPool) Release(ctx context.Context, host *object.HostSystem)
- func (hp *HostPool) WaitForLeaseAvailableHost(ctx context.Context, azName string) (*object.HostSystem, error)
- type HostPoolAZ
- type HostPoolConfig
- type ISOEjector
- type Pool
- func (p *Pool) AddSource(az, host, username, password, datacenter string, insecure bool)
- func (p *Pool) AddTarget(az, host, username, password, datacenter string, insecure bool)
- func (p *Pool) Close(ctx context.Context)
- func (p *Pool) GetClients() []*Client
- func (p *Pool) GetSourceClientByAZ(az string) *Client
- func (p *Pool) GetSourceClients() []*Client
- func (p *Pool) GetTargetClientByAZ(az string) *Client
- func (p *Pool) GetTargetClients() []*Client
- func (p *Pool) SourceAZs() []string
- func (p *Pool) TargetAZs() []string
- type ProgressLogger
- type ProgressSink
- type RelocateSpec
- func (rs *RelocateSpec) Build(ctx context.Context) (*types.VirtualMachineRelocateSpec, error)
- func (rs *RelocateSpec) WithDryRun(dryRun bool) *RelocateSpec
- func (rs *RelocateSpec) WithSourceVM(vm *VM) *RelocateSpec
- func (rs *RelocateSpec) WithTargetHost(host *object.HostSystem) *RelocateSpec
- func (rs *RelocateSpec) WithTargetSpec(vmTargetSpec *TargetSpec) *RelocateSpec
- type TargetSpec
- type VM
- type VMNotFoundError
- type VMRelocator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVMNotFoundError ¶
Types ¶
type AdapterNotFoundError ¶
type AdapterNotFoundError struct {
// contains filtered or unexported fields
}
func NewAdapterNotFoundError ¶
func NewAdapterNotFoundError(vmName, networkName string) *AdapterNotFoundError
func (*AdapterNotFoundError) Error ¶
func (e *AdapterNotFoundError) Error() string
type AdapterUpdater ¶
type AdapterUpdater struct {
// contains filtered or unexported fields
}
func NewAdapterUpdater ¶
func NewAdapterUpdater(finder *Finder) *AdapterUpdater
func (*AdapterUpdater) TargetNewNetwork ¶
func (a *AdapterUpdater) TargetNewNetwork(ctx context.Context, adapter *anyAdapter, targetNetName string) (*anyAdapter, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewFromGovmomiClient ¶
func (*Client) CreateFolder ¶ added in v0.7.0
CreateFolder creates the specified folder including any parent folders If the folder(s) already exists, no folders are created and nil is returned
func (*Client) Datacenter ¶ added in v0.6.0
func (*Client) FindVMInClusters ¶ added in v0.6.0
type Finder ¶
type Finder struct { Datacenter string // contains filtered or unexported fields }
func (*Finder) AdapterBackingInfo ¶
func (*Finder) DatastoreRef ¶
func (*Finder) HostsInCluster ¶
func (*Finder) ResourcePool ¶
func (*Finder) ResourcePoolRef ¶ added in v0.7.0
func (*Finder) VMClusterName ¶ added in v0.7.0
func (*Finder) VirtualMachine ¶
type HostPool ¶
type HostPool struct { MaxLeasePerHost int LeaseWaitTimeoutInMinutes int LeaseCheckIntervalInSeconds int // contains filtered or unexported fields }
func NewHostPool ¶
func NewHostPool(clientPool *Pool, config *HostPoolConfig) *HostPool
func (*HostPool) LeaseAvailableHost ¶
func (hp *HostPool) LeaseAvailableHost(ctx context.Context, azName string) (*object.HostSystem, error)
LeaseAvailableHost returns the best host system to copy a VM to If no hosts are currently available a nil host will be returned, the caller should wait and retry later Release should be called by the caller when done with the host
func (*HostPool) Release ¶
func (hp *HostPool) Release(ctx context.Context, host *object.HostSystem)
Release releases the specified host back into the pool and makes it available for lease again
func (*HostPool) WaitForLeaseAvailableHost ¶
func (hp *HostPool) WaitForLeaseAvailableHost(ctx context.Context, azName string) (*object.HostSystem, error)
WaitForLeaseAvailableHost returns the best host system to copy a VM to If no hosts are currently available this func will block until one is available or configured timeout Release should be called by the caller when done with the host
type HostPoolAZ ¶ added in v0.6.0
type HostPoolAZ struct {
Clusters []string
}
type HostPoolConfig ¶ added in v0.6.0
type HostPoolConfig struct {
AZs map[string]HostPoolAZ
}
type ISOEjector ¶
type ISOEjector struct {
// contains filtered or unexported fields
}
func NewISOEjector ¶
func NewISOEjector(vm *object.VirtualMachine) *ISOEjector
type Pool ¶ added in v0.6.0
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of vcenter client instances
func NewPool ¶ added in v0.6.0
func NewPool() *Pool
NewPool creates a new empty pool Call AddSource and AddTarget to fully initialize the pool
func NewPoolWithExternalClients ¶ added in v0.6.0
NewPoolWithExternalClients creates a new vcenter pool using externally managed vcenter clients This is used for testing purposes
func (*Pool) AddSource ¶ added in v0.6.0
AddSource adds a new source az/client pair If the AZ's vcenter matches another AZ's source vcenter then the client is re-used
func (*Pool) AddTarget ¶ added in v0.6.0
AddTarget adds a new target az/client pair If the AZ's vcenter matches another AZ's target vcenter then the client is re-used
func (*Pool) GetClients ¶ added in v0.6.0
GetClients returns all target and source vcenter clients
func (*Pool) GetSourceClientByAZ ¶ added in v0.6.0
GetSourceClientByAZ returns the source vcenter client associated with the AZ, otherwise nil
func (*Pool) GetSourceClients ¶ added in v0.6.0
GetSourceClients returns all source vcenter clients
func (*Pool) GetTargetClientByAZ ¶ added in v0.6.0
GetTargetClientByAZ returns the target vcenter client associated with the AZ, otherwise nil
func (*Pool) GetTargetClients ¶ added in v0.6.0
GetTargetClients returns all target vcenter clients
type ProgressLogger ¶
type ProgressLogger struct {
// contains filtered or unexported fields
}
func NewProgressLogger ¶
func NewProgressLogger(updatableStdout *log.UpdatableStdout) *ProgressLogger
func (*ProgressLogger) NewProgressSink ¶
func (p *ProgressLogger) NewProgressSink(taskName string) *ProgressSink
func (*ProgressLogger) SinkDone ¶
func (p *ProgressLogger) SinkDone()
type ProgressSink ¶
type ProgressSink struct {
// contains filtered or unexported fields
}
func (*ProgressSink) Sink ¶
func (p *ProgressSink) Sink() chan<- progress.Report
type RelocateSpec ¶
type RelocateSpec struct { DryRun bool // contains filtered or unexported fields }
func NewRelocateSpec ¶
func NewRelocateSpec(sourceClient *Client, destinationClient *Client) *RelocateSpec
func (*RelocateSpec) Build ¶
func (rs *RelocateSpec) Build(ctx context.Context) (*types.VirtualMachineRelocateSpec, error)
func (*RelocateSpec) WithDryRun ¶ added in v0.7.0
func (rs *RelocateSpec) WithDryRun(dryRun bool) *RelocateSpec
func (*RelocateSpec) WithSourceVM ¶
func (rs *RelocateSpec) WithSourceVM(vm *VM) *RelocateSpec
func (*RelocateSpec) WithTargetHost ¶
func (rs *RelocateSpec) WithTargetHost(host *object.HostSystem) *RelocateSpec
func (*RelocateSpec) WithTargetSpec ¶
func (rs *RelocateSpec) WithTargetSpec(vmTargetSpec *TargetSpec) *RelocateSpec
type TargetSpec ¶
type VMNotFoundError ¶
func (*VMNotFoundError) Error ¶
func (e *VMNotFoundError) Error() string
type VMRelocator ¶
type VMRelocator struct { DryRun bool // contains filtered or unexported fields }
func NewVMRelocator ¶
func NewVMRelocator(clientPool *Pool, destinationHostPool *HostPool, updatableStdout *log.UpdatableStdout) *VMRelocator
func (*VMRelocator) RelocateVM ¶
func (r *VMRelocator) RelocateVM(ctx context.Context, srcVM *VM, vmTargetSpec *TargetSpec) error
func (*VMRelocator) WithDryRun ¶
func (r *VMRelocator) WithDryRun(dryRun bool) *VMRelocator