virtualmachine

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Create

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

func Customize

func Customize(vm *object.VirtualMachine, spec types.CustomizationSpec) error

Customize wraps the customization of a virtual machine and the subsequent waiting of the task.

func Destroy

func Destroy(vm *object.VirtualMachine) error

Destroy wraps the Destroy task and the subsequent waiting for the task to complete.

func FromMOID

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

FromMOID locates a virtualMachine by its managed object reference ID.

func FromPath

func FromPath(client *govmomi.Client, path string, dc *object.Datacenter) (*object.VirtualMachine, error)

FromPath returns a VirtualMachine via its supplied path.

func FromUUID

func FromUUID(client *govmomi.Client, uuid string) (*object.VirtualMachine, error)

FromUUID locates a virtualMachine by its UUID.

func GracefulPowerOff

func GracefulPowerOff(client *govmomi.Client, vm *object.VirtualMachine, timeout int, force bool) error

GracefulPowerOff is a meta-operation that handles powering down of virtual machines. A graceful shutdown is attempted first if possible (VMware tools is installed, and the guest state is not suspended), and then, if allowed, a power-off is forced if that fails.

func MoveToFolder

func MoveToFolder(client *govmomi.Client, vm *object.VirtualMachine, relative string) error

MoveToFolder moves a virtual machine to the specified folder.

func PowerOff

func PowerOff(vm *object.VirtualMachine) error

PowerOff wraps powering off a VM and the waiting for the subsequent task.

func PowerOn

func PowerOn(vm *object.VirtualMachine) error

PowerOn wraps powering on a VM and the waiting for the subsequent task.

func Properties

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

Properties is a convenience method that wraps fetching the VirtualMachine MO from its higher-level object.

func Reconfigure

Reconfigure wraps the Reconfigure task and the subsequent waiting for the task to complete.

func Relocate

func Relocate(vm *object.VirtualMachine, spec types.VirtualMachineRelocateSpec, timeout int) error

Relocate wraps the Relocate task and the subsequent waiting for the task to complete.

func ShutdownGuest

func ShutdownGuest(client *govmomi.Client, vm *object.VirtualMachine, timeout int) error

ShutdownGuest wraps the graceful shutdown of a guest VM, and then waiting an appropriate amount of time for the guest power state to go to powered off. If the VM does not power off in the shutdown period specified by timeout (in minutes), an error is returned.

The minimum value for timeout is 1 minute - setting to a 0 or negative value is not allowed and will just reset the timeout to the minimum.

func WaitForGuestNet

func WaitForGuestNet(client *govmomi.Client, vm *object.VirtualMachine, timeout int) error

WaitForGuestNet waits for a virtual machine to have routeable network access. This is denoted as a gateway, and at least one IP address that can reach that gateway. This function supports both IPv4 and IPv6, and returns the moment either stack is routeable - it doesn't wait for both.

The timeout is specified in minutes. If zero or a negative value is passed, the waiter returns without error immediately.

Types

This section is empty.

Jump to

Keyboard shortcuts

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