Documentation ¶
Index ¶
- func Copy(dst interface{}, src interface{}) error
- func ToCIDR(address, netmask string) string
- 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
- func (conf *Configuration) Clone(nodeIndex int) (*Configuration, error)
- func (conf *Configuration) Copy() *Configuration
- func (conf *Configuration) Create(name string, userName, authKey string, cloudInit interface{}, network *Network, ...) (*VirtualMachine, error)
- func (conf *Configuration) CreateWithContext(ctx *context.Context, name string, userName, authKey string, ...) (*VirtualMachine, error)
- func (conf *Configuration) Delete(name string) error
- func (conf *Configuration) DeleteWithContext(ctx *context.Context, name string) error
- func (conf *Configuration) Exists(name string) bool
- func (conf *Configuration) ExistsWithContext(ctx *context.Context, name string) bool
- func (conf *Configuration) FindInterfaceByName(networkName string) *NetworkInterface
- func (conf *Configuration) FindPreferredIPAddress(interfaces []NetworkInterface) string
- func (conf *Configuration) GetClient(ctx *context.Context) (*Client, error)
- func (conf *Configuration) GetHostSystem(name string) (string, error)
- func (conf *Configuration) GetHostSystemWithContext(ctx *context.Context, name string) (string, error)
- func (conf *Configuration) PowerOff(name string) error
- func (conf *Configuration) PowerOffWithContext(ctx *context.Context, name string) error
- func (conf *Configuration) PowerOn(name string) error
- func (conf *Configuration) PowerOnWithContext(ctx *context.Context, name string) error
- func (conf *Configuration) RetrieveNetworkInfos(name string, nodeIndex int) error
- func (conf *Configuration) RetrieveNetworkInfosWithContext(ctx *context.Context, name string, nodeIndex int) error
- func (conf *Configuration) SetAutoStart(esxi, name string, startOrder int) error
- func (conf *Configuration) SetAutoStartWithContext(ctx *context.Context, esxi, name string, startOrder int) error
- func (conf *Configuration) ShutdownGuest(name string) error
- func (conf *Configuration) ShutdownGuestWithContext(ctx *context.Context, name string) error
- func (conf *Configuration) Status(name string) (*Status, error)
- func (conf *Configuration) StatusWithContext(ctx *context.Context, name string) (*Status, error)
- func (conf *Configuration) UUID(name string) (string, error)
- func (conf *Configuration) UUIDWithContext(ctx *context.Context, name string) (string, error)
- func (conf *Configuration) VirtualMachine(name string) (*VirtualMachine, error)
- func (conf *Configuration) VirtualMachineList() ([]*VirtualMachine, error)
- func (conf *Configuration) VirtualMachineListWithContext(ctx *context.Context) ([]*VirtualMachine, error)
- func (conf *Configuration) VirtualMachineWithContext(ctx *context.Context, name string) (*VirtualMachine, error)
- func (conf *Configuration) WaitForIP(name string) (string, error)
- func (conf *Configuration) WaitForIPWithContext(ctx *context.Context, name string) (string, error)
- func (conf *Configuration) WaitForToolsRunning(name string) (bool, error)
- func (conf *Configuration) WaitForToolsRunningWithContext(ctx *context.Context, name string) (bool, error)
- 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, name, templateName, vmFolder, resourceName string, ...) (*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 GuestInfos
- type HostAutoStartManager
- type Nameserver
- type Network
- func (net *Network) Devices(ctx *context.Context, devices object.VirtualDeviceList, dc *Datacenter, ...) (object.VirtualDeviceList, error)
- func (net *Network) GetCloudInitNetwork(nodeIndex int) *NetworkDeclare
- func (net *Network) GetDeclaredExistingInterfaces() []*NetworkInterface
- func (net *Network) UpdateMacAddressTable(nodeIndex int)
- type NetworkAdapter
- type NetworkConfig
- type NetworkDeclare
- type NetworkInterface
- func (net *NetworkInterface) AttachMacAddress(address string, nodeIndex int)
- func (net *NetworkInterface) Change(device types.BaseVirtualDevice, update types.BaseVirtualDevice)
- func (net *NetworkInterface) ChangeAddress(card *types.VirtualEthernetCard, nodeIndex int) bool
- func (net *NetworkInterface) Device(ctx *context.Context, dc *Datacenter, nodeIndex int) (types.BaseVirtualDevice, error)
- func (net *NetworkInterface) GetMacAddress(nodeIndex int) string
- func (net *NetworkInterface) MatchInterface(ctx *context.Context, dc *Datacenter, card *types.VirtualEthernetCard) (bool, error)
- func (net *NetworkInterface) NeedToReconfigure(nodeIndex int) bool
- func (net *NetworkInterface) Reference(ctx *context.Context, dc *Datacenter) (object.NetworkReference, error)
- func (net *NetworkInterface) SetMacAddress(nodeIndex int, device types.BaseVirtualDevice) types.BaseVirtualDevice
- type NetworkResolv
- type Status
- type VirtualMachine
- func (vm *VirtualMachine) Configure(ctx *context.Context, userName, authKey string, cloudInit interface{}, ...) 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) ([]NetworkInterface, error)
- func (vm *VirtualMachine) PowerOff(ctx *context.Context) error
- func (vm *VirtualMachine) PowerOn(ctx *context.Context) error
- func (vm *VirtualMachine) SetGuestInfo(ctx *context.Context, guestInfos *GuestInfos) 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) WaitForToolsRunning(ctx *context.Context) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Client *govmomi.Client Configuration *Configuration }
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"` TemplateName string `json:"template-name"` Template bool `json:"template"` LinkedClone bool `json:"linked"` AllowUpgrade bool `json:"allow-upgrade"` Customization string `json:"customization"` Network *Network `json:"network"` TestMode bool `json:"-"` }
Configuration declares vsphere connection info
func (*Configuration) Clone ¶
func (conf *Configuration) Clone(nodeIndex int) (*Configuration, error)
Clone duplicate the conf, change ip address in network config if needed
func (*Configuration) Copy ¶ added in v1.20.14
func (conf *Configuration) Copy() *Configuration
Create a shadow copy
func (*Configuration) Create ¶
func (conf *Configuration) Create(name string, userName, authKey string, cloudInit interface{}, network *Network, annotation string, expandHardDrive bool, memory, cpus, disk, nodeIndex int) (*VirtualMachine, error)
Create will create a named VM not powered memory and disk are in megabytes
func (*Configuration) CreateWithContext ¶
func (conf *Configuration) CreateWithContext(ctx *context.Context, name string, userName, authKey string, cloudInit interface{}, network *Network, annotation string, expandHardDrive bool, memory, cpus, disk, nodeIndex int) (*VirtualMachine, error)
CreateWithContext will create a named VM not powered memory and disk are in megabytes
func (*Configuration) Delete ¶
func (conf *Configuration) Delete(name string) error
Delete a VM by name
func (*Configuration) DeleteWithContext ¶
func (conf *Configuration) DeleteWithContext(ctx *context.Context, name string) error
DeleteWithContext a VM by name
func (*Configuration) Exists ¶ added in v1.25.6
func (conf *Configuration) Exists(name string) bool
func (*Configuration) ExistsWithContext ¶ added in v1.25.6
func (conf *Configuration) ExistsWithContext(ctx *context.Context, name string) bool
ExistsWithContext return the current status of VM by name
func (*Configuration) FindInterfaceByName ¶ added in v1.21.8
func (conf *Configuration) FindInterfaceByName(networkName string) *NetworkInterface
func (*Configuration) FindPreferredIPAddress ¶ added in v1.21.8
func (conf *Configuration) FindPreferredIPAddress(interfaces []NetworkInterface) string
func (*Configuration) GetClient ¶
func (conf *Configuration) GetClient(ctx *context.Context) (*Client, error)
GetClient create a new govomi client
func (*Configuration) GetHostSystem ¶ added in v1.20.14
func (conf *Configuration) GetHostSystem(name string) (string, error)
GetHostSystem return the host where the virtual machine leave
func (*Configuration) GetHostSystemWithContext ¶ added in v1.20.14
func (*Configuration) PowerOff ¶
func (conf *Configuration) PowerOff(name string) error
PowerOff power off a VM by name
func (*Configuration) PowerOffWithContext ¶
func (conf *Configuration) PowerOffWithContext(ctx *context.Context, name string) error
PowerOffWithContext power off a VM by name
func (*Configuration) PowerOn ¶
func (conf *Configuration) PowerOn(name string) error
PowerOn power on a VM by name
func (*Configuration) PowerOnWithContext ¶
func (conf *Configuration) PowerOnWithContext(ctx *context.Context, name string) error
PowerOnWithContext power on a VM by name
func (*Configuration) RetrieveNetworkInfos ¶ added in v1.20.14
func (conf *Configuration) RetrieveNetworkInfos(name string, nodeIndex int) error
func (*Configuration) RetrieveNetworkInfosWithContext ¶ added in v1.20.14
func (*Configuration) SetAutoStart ¶ added in v1.20.5
func (conf *Configuration) SetAutoStart(esxi, name string, startOrder int) error
SetAutoStart set autostart for the VM
func (*Configuration) SetAutoStartWithContext ¶ added in v1.20.5
func (conf *Configuration) SetAutoStartWithContext(ctx *context.Context, esxi, name string, startOrder int) error
SetAutoStartWithContext set autostart for the VM
func (*Configuration) ShutdownGuest ¶
func (conf *Configuration) ShutdownGuest(name string) error
ShutdownGuest power off a VM by name
func (*Configuration) ShutdownGuestWithContext ¶
func (conf *Configuration) ShutdownGuestWithContext(ctx *context.Context, name string) error
ShutdownGuestWithContext power off a VM by name
func (*Configuration) Status ¶
func (conf *Configuration) Status(name string) (*Status, error)
Status return the current status of VM by name
func (*Configuration) StatusWithContext ¶
StatusWithContext return the current status of VM by name
func (*Configuration) UUID ¶ added in v1.24.6
func (conf *Configuration) UUID(name string) (string, error)
UUID get VM UUID by name
func (*Configuration) UUIDWithContext ¶ added in v1.24.6
UUID get VM UUID by name
func (*Configuration) VirtualMachine ¶
func (conf *Configuration) VirtualMachine(name string) (*VirtualMachine, error)
VirtualMachine Retrieve VM by name
func (*Configuration) VirtualMachineList ¶
func (conf *Configuration) VirtualMachineList() ([]*VirtualMachine, error)
VirtualMachineList return all VM for the current datastore
func (*Configuration) VirtualMachineListWithContext ¶
func (conf *Configuration) VirtualMachineListWithContext(ctx *context.Context) ([]*VirtualMachine, error)
VirtualMachineListWithContext return all VM for the current datastore
func (*Configuration) VirtualMachineWithContext ¶
func (conf *Configuration) VirtualMachineWithContext(ctx *context.Context, name string) (*VirtualMachine, error)
VirtualMachineWithContext Retrieve VM by name
func (*Configuration) WaitForIP ¶
func (conf *Configuration) WaitForIP(name string) (string, error)
WaitForIP wait ip a VM by name
func (*Configuration) WaitForIPWithContext ¶
WaitForIPWithContext wait ip a VM by name
func (*Configuration) WaitForToolsRunning ¶ added in v1.15.11
func (conf *Configuration) WaitForToolsRunning(name string) (bool, error)
WaitForToolsRunning wait vmware tools is running a VM by name
func (*Configuration) WaitForToolsRunningWithContext ¶ added in v1.15.11
func (conf *Configuration) WaitForToolsRunningWithContext(ctx *context.Context, name string) (bool, error)
WaitForToolsRunningWithContext wait vmware tools is running a VM by name
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 ¶ added in v1.20.5
func (dc *Datacenter) GetHostAutoStartManager(ctx *context.Context, esxi string) (*HostAutoStartManager, error)
GetHostAutoStartManager return the HostAutoStartManager
func (*Datacenter) GetHostSystem ¶ added in v1.20.5
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, name, templateName, vmFolder, resourceName string, template bool, linkedClone bool, network *Network, customization string, nodeIndex int) (*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 GuestInfos ¶
GuestInfos the guest infos Must not start with `guestinfo.`
type HostAutoStartManager ¶ added in v1.20.5
type HostAutoStartManager struct { Ref types.ManagedObjectReference Datacenter *Datacenter }
func (*HostAutoStartManager) SetAutoStart ¶ added in v1.20.5
type Nameserver ¶
type Nameserver struct { Search []string `json:"search,omitempty" yaml:"search,omitempty"` Addresses []string `json:"addresses,omitempty" yaml:"addresses,omitempty"` }
Nameserver declaration
type Network ¶
type Network struct { Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` Interfaces []*NetworkInterface `json:"interfaces,omitempty" yaml:"interfaces,omitempty"` DNS *NetworkResolv `json:"dns,omitempty" yaml:"dns,omitempty"` }
Network describes a card adapter
func (*Network) Devices ¶
func (net *Network) Devices(ctx *context.Context, devices object.VirtualDeviceList, dc *Datacenter, nodeIndex int) (object.VirtualDeviceList, error)
Devices return all devices
func (*Network) GetCloudInitNetwork ¶
func (net *Network) GetCloudInitNetwork(nodeIndex int) *NetworkDeclare
GetCloudInitNetwork create cloud-init object
func (*Network) GetDeclaredExistingInterfaces ¶
func (net *Network) GetDeclaredExistingInterfaces() []*NetworkInterface
GetDeclaredExistingInterfaces return the declared existing interfaces
func (*Network) UpdateMacAddressTable ¶ added in v1.20.14
type NetworkAdapter ¶
type NetworkAdapter struct { DHCP4 bool `json:"dhcp4,omitempty" yaml:"dhcp4,omitempty"` NicName *string `json:"set-name,omitempty" yaml:"set-name,omitempty"` Match *map[string]string `json:"match,omitempty" yaml:"match,omitempty"` Gateway4 *string `json:"gateway4,omitempty" yaml:"gateway4,omitempty"` Addresses *[]string `json:"addresses,omitempty" yaml:"addresses,omitempty"` Nameservers *Nameserver `json:"nameservers,omitempty" yaml:"nameservers,omitempty"` DHCPOverrides *map[string]interface{} `json:"dhcp4-overrides,omitempty" yaml:"dhcp4-overrides,omitempty"` Routes *[]v1alpha1.NetworkRoutes `json:"routes,omitempty" yaml:"routes,omitempty"` }
NetworkAdapter wrapper
type NetworkConfig ¶
type NetworkConfig struct { InstanceID string `json:"instance-id,omitempty" yaml:"instance-id,omitempty"` LocalHostname string `json:"local-hostname,omitempty" yaml:"local-hostname,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` Network *NetworkDeclare `json:"network,omitempty" yaml:"network,omitempty"` }
NetworkConfig wrapper
type NetworkDeclare ¶
type NetworkDeclare struct { Version int `json:"version,omitempty" yaml:"version,omitempty"` Ethernets map[string]*NetworkAdapter `json:"ethernets,omitempty" yaml:"ethernets,omitempty"` }
NetworkDeclare wrapper
type NetworkInterface ¶
type NetworkInterface struct { Primary bool `json:"primary,omitempty" yaml:"primary,omitempty"` Existing bool `json:"exists,omitempty" yaml:"exists,omitempty"` NetworkName string `json:"network,omitempty" yaml:"network,omitempty"` Adapter string `json:"adapter,omitempty" yaml:"adapter,omitempty"` MacAddress string `json:"mac-address,omitempty" yaml:"mac-address,omitempty"` NicName string `json:"nic,omitempty" yaml:"nic,omitempty"` DHCP bool `json:"dhcp,omitempty" yaml:"dhcp,omitempty"` UseRoutes bool `default:"true" json:"use-dhcp-routes,omitempty" yaml:"use-dhcp-routes,omitempty"` IPAddress string `json:"address,omitempty" yaml:"address,omitempty"` Netmask string `json:"netmask,omitempty" yaml:"netmask,omitempty"` Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` Routes []v1alpha1.NetworkRoutes `json:"routes,omitempty" yaml:"routes,omitempty"` // contains filtered or unexported fields }
NetworkInterface declare single interface
func (*NetworkInterface) AttachMacAddress ¶ added in v1.20.14
func (net *NetworkInterface) AttachMacAddress(address string, nodeIndex int)
func (*NetworkInterface) Change ¶
func (net *NetworkInterface) Change(device types.BaseVirtualDevice, update types.BaseVirtualDevice)
Change applies update backing and hardware address changes to the given network device.
func (*NetworkInterface) ChangeAddress ¶
func (net *NetworkInterface) ChangeAddress(card *types.VirtualEthernetCard, nodeIndex int) bool
ChangeAddress just the mac adress
func (*NetworkInterface) Device ¶
func (net *NetworkInterface) Device(ctx *context.Context, dc *Datacenter, nodeIndex int) (types.BaseVirtualDevice, error)
Device return a device
func (*NetworkInterface) GetMacAddress ¶
func (net *NetworkInterface) GetMacAddress(nodeIndex int) string
GetMacAddress return a macaddress
func (*NetworkInterface) MatchInterface ¶
func (net *NetworkInterface) MatchInterface(ctx *context.Context, dc *Datacenter, card *types.VirtualEthernetCard) (bool, error)
MatchInterface return if this interface match the virtual device Due missing read permission, I can't create BackingInfo network card, so I use collected info to construct backing info
func (*NetworkInterface) NeedToReconfigure ¶
func (net *NetworkInterface) NeedToReconfigure(nodeIndex int) bool
NeedToReconfigure tell that we must set the mac address
func (*NetworkInterface) Reference ¶
func (net *NetworkInterface) Reference(ctx *context.Context, dc *Datacenter) (object.NetworkReference, error)
Reference return the network reference
func (*NetworkInterface) SetMacAddress ¶
func (net *NetworkInterface) SetMacAddress(nodeIndex int, device types.BaseVirtualDevice) types.BaseVirtualDevice
SetMacAddress put mac address in the device
type NetworkResolv ¶
type NetworkResolv struct { Search []string `json:"search,omitempty" yaml:"search,omitempty"` Nameserver []string `json:"nameserver,omitempty" yaml:"nameserver,omitempty"` }
NetworkResolv /etc/resolv.conf
type Status ¶
type Status struct { Interfaces []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, userName, authKey string, cloudInit interface{}, network *Network, annotation string, expandHardDrive bool, memory, cpus, disk, nodeIndex int, allowUpgrade bool) 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 ¶ added in v1.20.14
func (vm *VirtualMachine) HostSystem(ctx *context.Context) (string, error)
func (VirtualMachine) IsSimulatorRunning ¶ added in v1.24.3
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 ¶ added in v1.21.8
func (vm *VirtualMachine) ListAddresses(ctx *context.Context) ([]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) SetGuestInfo ¶
func (vm *VirtualMachine) SetGuestInfo(ctx *context.Context, guestInfos *GuestInfos) 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) UUID ¶ added in v1.24.6
func (vm *VirtualMachine) UUID(ctx *context.Context) string
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) WaitForToolsRunning ¶ added in v1.15.11
func (vm *VirtualMachine) WaitForToolsRunning(ctx *context.Context) (bool, error)
WaitForToolsRunning wait vmware tool starts