Documentation ¶
Index ¶
- func NewVSphereProviderConfiguration(fileName string) (providers.ProviderConfiguration, error)
- type Client
- func (c *Client) Datacenter(ref types.ManagedObjectReference) *object.Datacenter
- func (c *Client) Datastore(ref types.ManagedObjectReference) *object.Datastore
- func (c *Client) GetClient() *govmomi.Client
- func (c *Client) GetDatacenter(ctx *context.Context, name string) (*Datacenter, error)
- func (c *Client) VimClient() *vim25.Client
- func (c *Client) VirtualMachine(ref types.ManagedObjectReference) *object.VirtualMachine
- type Configuration
- type CreateInput
- type CreateVirtualMachineInput
- type Datacenter
- func (dc *Datacenter) Datacenter(ctx *context.Context) *object.Datacenter
- func (dc *Datacenter) GetDatastore(ctx *context.Context, name string) (*Datastore, error)
- func (dc *Datacenter) GetHostAutoStartManager(ctx *context.Context, esxi string) (*HostAutoStartManager, error)
- func (dc *Datacenter) GetHostSystem(ctx *context.Context, esxi string) (*object.HostSystem, error)
- func (dc *Datacenter) NewFinder(ctx *context.Context) *find.Finder
- func (dc *Datacenter) VimClient() *vim25.Client
- type Datastore
- func (ds *Datastore) CreateVirtualMachine(ctx *context.Context, input *CreateVirtualMachineInput) (*VirtualMachine, error)
- func (ds *Datastore) Datastore(ctx *context.Context) *object.Datastore
- func (ds *Datastore) List(ctx *context.Context) ([]*VirtualMachine, error)
- func (ds *Datastore) ListPath(ctx *context.Context, b *object.HostDatastoreBrowser, path string, ...) ([]types.HostDatastoreBrowserSearchResults, error)
- func (ds *Datastore) VimClient() *vim25.Client
- func (ds *Datastore) VirtualMachine(ctx *context.Context, name string) (*VirtualMachine, error)
- type HostAutoStartManager
- type Status
- type VirtualMachine
- func (vm *VirtualMachine) Configure(ctx *context.Context, input *CreateInput) error
- func (vm *VirtualMachine) Delete(ctx *context.Context) error
- func (vm *VirtualMachine) HostSystem(ctx *context.Context) (string, error)
- func (vm VirtualMachine) IsSimulatorRunning(ctx *context.Context) bool
- func (vm VirtualMachine) IsToolsRunning(ctx *context.Context) (bool, error)
- func (vm *VirtualMachine) ListAddresses(ctx *context.Context) ([]providers.NetworkInterface, error)
- func (vm *VirtualMachine) PowerOff(ctx *context.Context) error
- func (vm *VirtualMachine) PowerOn(ctx *context.Context) error
- func (vm *VirtualMachine) Reconfigure(ctx *context.Context, virtualMachine *object.VirtualMachine, ...) error
- func (vm *VirtualMachine) SetGuestInfo(ctx *context.Context, input *CreateInput) ([]types.BaseOptionValue, error)
- func (vm *VirtualMachine) ShutdownGuest(ctx *context.Context) error
- func (vm *VirtualMachine) Status(ctx *context.Context) (*Status, error)
- func (vm *VirtualMachine) UUID(ctx *context.Context) string
- func (vm *VirtualMachine) VimClient() *vim25.Client
- func (vm *VirtualMachine) VirtualMachine(ctx *context.Context) *object.VirtualMachine
- func (vm *VirtualMachine) WaitForIP(ctx *context.Context) (string, error)
- func (vm *VirtualMachine) WaitForPowered(ctx *context.Context) error
- func (vm *VirtualMachine) WaitForToolsRunning(ctx *context.Context) (bool, error)
- type VmStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVSphereProviderConfiguration ¶
func NewVSphereProviderConfiguration(fileName string) (providers.ProviderConfiguration, error)
Types ¶
type Client ¶
Client Client wrapper
func (*Client) Datacenter ¶
func (c *Client) Datacenter(ref types.ManagedObjectReference) *object.Datacenter
Datacenter return a Datacenter
func (*Client) Datastore ¶
func (c *Client) Datastore(ref types.ManagedObjectReference) *object.Datastore
Datastore create govmomi Datastore object
func (*Client) GetDatacenter ¶
GetDatacenter return the datacenter
func (*Client) VirtualMachine ¶
func (c *Client) VirtualMachine(ref types.ManagedObjectReference) *object.VirtualMachine
VirtualMachine map govmomi VirtualMachine
type Configuration ¶
type Configuration struct { URL string `json:"url"` UserName string `json:"uid"` Password string `json:"password"` Insecure bool `json:"insecure"` DataCenter string `json:"dc"` DataStore string `json:"datastore"` Resource string `json:"resource-pool"` VMBasePath string `json:"vmFolder"` Timeout time.Duration `json:"timeout"` Annotation string `json:"annotation"` TemplateName string `json:"template-name"` Template bool `json:"template"` LinkedClone bool `json:"linked"` Customization string `json:"customization"` Network providers.Network `json:"network"` AvailableGPUTypes map[string]string `json:"gpu-types"` VMWareRegion string `json:"region"` VMWareZone string `json:"zone"` UseBind9 bool `json:"use-bind9"` Bind9Host string `json:"bind9-host"` RndcKeyFile string `json:"rndc-key-file"` StartDelay int `json:"start-delay"` StopDelay int `json:"stop-delay"` }
Configuration declares vsphere connection info
type CreateInput ¶
type Datacenter ¶
type Datacenter struct { Ref types.ManagedObjectReference Name string Client *Client }
Datacenter represent a datacenter
func (*Datacenter) Datacenter ¶
func (dc *Datacenter) Datacenter(ctx *context.Context) *object.Datacenter
Datacenter return a Datacenter
func (*Datacenter) GetDatastore ¶
GetDatastore retrieve named datastore
func (*Datacenter) GetHostAutoStartManager ¶
func (dc *Datacenter) GetHostAutoStartManager(ctx *context.Context, esxi string) (*HostAutoStartManager, error)
GetHostAutoStartManager return the HostAutoStartManager
func (*Datacenter) GetHostSystem ¶
func (dc *Datacenter) GetHostSystem(ctx *context.Context, esxi string) (*object.HostSystem, error)
GetHostSystem return the default hostsystem
func (*Datacenter) NewFinder ¶
func (dc *Datacenter) NewFinder(ctx *context.Context) *find.Finder
NewFinder create a finder
func (*Datacenter) VimClient ¶
func (dc *Datacenter) VimClient() *vim25.Client
VimClient return the VIM25 client
type Datastore ¶
type Datastore struct { Ref types.ManagedObjectReference Name string Datacenter *Datacenter }
Datastore datastore wrapper
func (*Datastore) CreateVirtualMachine ¶
func (ds *Datastore) CreateVirtualMachine(ctx *context.Context, input *CreateVirtualMachineInput) (*VirtualMachine, error)
CreateVirtualMachine create a new virtual machine
func (*Datastore) List ¶
func (ds *Datastore) List(ctx *context.Context) ([]*VirtualMachine, error)
List list VM inside the datastore
func (*Datastore) ListPath ¶
func (ds *Datastore) ListPath(ctx *context.Context, b *object.HostDatastoreBrowser, path string, spec types.HostDatastoreBrowserSearchSpec, recurse bool) ([]types.HostDatastoreBrowserSearchResults, error)
ListPath return object list matching path
func (*Datastore) VirtualMachine ¶
VirtualMachine retrieve the specified virtual machine
type HostAutoStartManager ¶
type HostAutoStartManager struct { mo.HostAutoStartManager Datacenter *Datacenter }
func (*HostAutoStartManager) NextStartOrder ¶ added in v1.30.0
func (h *HostAutoStartManager) NextStartOrder() (result int)
func (*HostAutoStartManager) SetAutoStart ¶
type Status ¶
type Status struct { Interfaces []providers.NetworkInterface Powered bool }
Status shortened vm status
type VirtualMachine ¶
type VirtualMachine struct { Ref types.ManagedObjectReference Name string Datastore *Datastore }
VirtualMachine virtual machine wrapper
func (*VirtualMachine) Configure ¶
func (vm *VirtualMachine) Configure(ctx *context.Context, input *CreateInput) error
Configure set characteristic of VM a virtual machine
func (*VirtualMachine) Delete ¶
func (vm *VirtualMachine) Delete(ctx *context.Context) error
Delete delete the virtual machine
func (*VirtualMachine) HostSystem ¶
func (vm *VirtualMachine) HostSystem(ctx *context.Context) (string, error)
func (VirtualMachine) IsSimulatorRunning ¶
func (vm VirtualMachine) IsSimulatorRunning(ctx *context.Context) bool
IsSimulatorRunning returns true if VMware Tools is currently running in the guest OS, and false otherwise.
func (VirtualMachine) IsToolsRunning ¶
func (vm VirtualMachine) IsToolsRunning(ctx *context.Context) (bool, error)
IsToolsRunning returns true if VMware Tools is currently running in the guest OS, and false otherwise.
func (*VirtualMachine) ListAddresses ¶
func (vm *VirtualMachine) ListAddresses(ctx *context.Context) ([]providers.NetworkInterface, error)
func (*VirtualMachine) PowerOff ¶
func (vm *VirtualMachine) PowerOff(ctx *context.Context) error
PowerOff power off a virtual machine
func (*VirtualMachine) PowerOn ¶
func (vm *VirtualMachine) PowerOn(ctx *context.Context) error
PowerOn power on a virtual machine
func (*VirtualMachine) Reconfigure ¶
func (vm *VirtualMachine) Reconfigure(ctx *context.Context, virtualMachine *object.VirtualMachine, config types.VirtualMachineConfigSpec) error
func (*VirtualMachine) SetGuestInfo ¶
func (vm *VirtualMachine) SetGuestInfo(ctx *context.Context, input *CreateInput) ([]types.BaseOptionValue, error)
SetGuestInfo change guest ingos
func (*VirtualMachine) ShutdownGuest ¶
func (vm *VirtualMachine) ShutdownGuest(ctx *context.Context) error
ShutdownGuest power off a virtual machine
func (*VirtualMachine) Status ¶
func (vm *VirtualMachine) Status(ctx *context.Context) (*Status, error)
Status refresh status virtual machine
func (*VirtualMachine) VimClient ¶
func (vm *VirtualMachine) VimClient() *vim25.Client
VimClient return the VIM25 client
func (*VirtualMachine) VirtualMachine ¶
func (vm *VirtualMachine) VirtualMachine(ctx *context.Context) *object.VirtualMachine
VirtualMachine return govmomi virtual machine
func (*VirtualMachine) WaitForIP ¶
func (vm *VirtualMachine) WaitForIP(ctx *context.Context) (string, error)
WaitForIP wait ip
func (*VirtualMachine) WaitForPowered ¶
func (vm *VirtualMachine) WaitForPowered(ctx *context.Context) error
WaitForToolsRunning wait vmware tool starts
func (*VirtualMachine) WaitForToolsRunning ¶
func (vm *VirtualMachine) WaitForToolsRunning(ctx *context.Context) (bool, error)
WaitForToolsRunning wait vmware tool starts