Documentation ¶
Index ¶
- func NewVMNotFoundError(name string) error
- type AdapterNotFoundError
- type AdapterUpdater
- type Client
- type Disk
- type Finder
- func (f *Finder) Adapter(ctx context.Context, vmName, networkName string) (*anyAdapter, error)
- func (f *Finder) AdapterBackingInfo(ctx context.Context, networkName string) (types.BaseVirtualDeviceBackingInfo, 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) 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) ResourcePoolFromSpec(ctx context.Context, spec TargetSpec) (*object.ResourcePool, error)
- func (f *Finder) ResourcePoolFromSpecRef(ctx context.Context, spec TargetSpec) (*types.ManagedObjectReference, error)
- func (f *Finder) VirtualMachine(ctx context.Context, vmName string) (*object.VirtualMachine, error)
- type HostPool
- func (hp *HostPool) Initialize(ctx context.Context) error
- func (hp *HostPool) LeaseAvailableHost(ctx context.Context, clusterName string) (*object.HostSystem, error)
- func (hp *HostPool) Release(ctx context.Context, host *object.HostSystem)
- func (hp *HostPool) WaitForLeaseAvailableHost(ctx context.Context, clusterName string) (*object.HostSystem, error)
- type ISOEjector
- type ProgressLogger
- type ProgressSink
- type RelocateSpec
- func (rs *RelocateSpec) Build(ctx context.Context) (*types.VirtualMachineRelocateSpec, error)
- 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 { Host string Username string Password string Insecure bool DryRun bool // contains filtered or unexported fields }
func NewFromGovmomiClient ¶
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) ResourcePoolFromSpec ¶
func (f *Finder) ResourcePoolFromSpec(ctx context.Context, spec TargetSpec) (*object.ResourcePool, error)
func (*Finder) ResourcePoolFromSpecRef ¶
func (f *Finder) ResourcePoolFromSpecRef(ctx context.Context, spec TargetSpec) (*types.ManagedObjectReference, error)
func (*Finder) VirtualMachine ¶
type HostPool ¶
type HostPool struct { Datacenter string MaxLeasePerHost int LeaseWaitTimeoutInMinutes int LeaseCheckIntervalInSeconds int // contains filtered or unexported fields }
func NewHostPool ¶
func (*HostPool) LeaseAvailableHost ¶
func (hp *HostPool) LeaseAvailableHost(ctx context.Context, clusterName 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, clusterName 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 ISOEjector ¶
type ISOEjector struct {
// contains filtered or unexported fields
}
func NewISOEjector ¶
func NewISOEjector(vm *object.VirtualMachine) *ISOEjector
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 {
// 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) 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 TargetSpec struct { Name string Datacenter string Cluster string ResourcePool string Datastores map[string]string Networks map[string]string }
func (TargetSpec) FullyQualifiedResourcePool ¶
func (t TargetSpec) FullyQualifiedResourcePool() string
FullyQualifiedResourcePool ensures we avoid "multiple found" errors
type VMNotFoundError ¶
type VMNotFoundError struct {
Name string
}
func (*VMNotFoundError) Error ¶
func (e *VMNotFoundError) Error() string
type VMRelocator ¶
type VMRelocator struct { DryRun bool // contains filtered or unexported fields }
func NewVMRelocator ¶
func NewVMRelocator(sourceClient *Client, destinationClient *Client, 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
Click to show internal directories.
Click to hide internal directories.