virtualmachine

package
v0.0.0-...-71ad85e Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeNetworkInterface

func ChangeNetworkInterface(vmProperties *mo.VirtualMachine, spec *types.VirtualMachineCloneSpec, networks []*vlan.LocalList, status *taskstatus.Status) *types.VirtualMachineCloneSpec

func Clone

Clone wraps the creation of a virtual machine and the subsequent waiting of the task. A higher-level virtual machine object is returned.

func CreateSnapshot

func CreateSnapshot(vm *object.VirtualMachine, SnapshotName string, memory bool) error

func CreateSnapshots

func CreateSnapshots(vmObjects []*object.VirtualMachine, SnapshotName string, memory bool) (err error)

func Delete

func Delete(vm *object.VirtualMachine, status *taskstatus.Status) error

func DeleteObjects

func DeleteObjects(vmObjects []*object.VirtualMachine, concurrency uint, status *taskstatus.Status) (err error)

func FromID

func FromID(client *govmomi.Client, id string) (*object.VirtualMachine, error)

FromID locates a VirtualMachine by its managed object reference ID.

func Get

func Get(client *govmomi.Client, dc *object.Datacenter, Path string) (*object.VirtualMachine, error)

func GetFirstMac

func GetFirstMac(vmProperties *mo.VirtualMachine) string

Get the MAC address of the first network interface

func GetGuestIP

func GetGuestIP(client *govmomi.Client, path, name string, dc *object.Datacenter, status *taskstatus.Status) (guestIP string, vmProperties *mo.VirtualMachine, err error)

func GetMac

func GetMac(vmProperties *mo.VirtualMachine, networkList []*vlan.LocalList) []*vlan.LocalList

func GetNetworks

func GetNetworks(vmObject *object.VirtualMachine, status *taskstatus.Status) (networks []string, err error)

Returns the networks of the vmObject

func GetPowerState

Returns the powerstate of the given Virtualmachine object

func Properties

func Properties(vm *object.VirtualMachine, status *taskstatus.Status) (*mo.VirtualMachine, error)

func ReadNetworkInterfaces

func ReadNetworkInterfaces(l object.VirtualDeviceList, status *taskstatus.Status) *object.VirtualDeviceList

ReadNetworkInterfaces returns a list of network interfaces. This is used in the VM data source to discover the properties of the network interfaces on the virtual machine. The list is sorted by the order that they would be added in if a clone were to be done.

func Start

func Start(vm *object.VirtualMachine, status *taskstatus.Status) error

func StartObjects

func StartObjects(vmObjects []*object.VirtualMachine, concurrency uint, status *taskstatus.Status) (err error)

func Stop

func Stop(vm *object.VirtualMachine, status *taskstatus.Status) error

func StopObjects

func StopObjects(vmObjects []*object.VirtualMachine, concurrency uint, status *taskstatus.Status) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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