vm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPAddressLookupTimeout = 60 * time.Second
)

Variables

This section is empty.

Functions

func ValidateCPUCount

func ValidateCPUCount(cpuCount uint) (uint, error)

ValidateCPUCount validates the CPU count and returns the validated CPU count. If the CPU count is less than the minimum allowed CPU count, the function returns the minimum allowed CPU count and an error.

func ValidateMemorySize

func ValidateMemorySize(memorySize uint64) (uint64, error)

ValidateMemorySize validates the memory size and returns the validated memory size. If the memory size is less than the minimum allowed memory size, the function returns the minimum allowed memory size and an error.

Types

type VirtualMachineInstance

type VirtualMachineInstance struct {
	IPAddress string

	CreatedAt  time.Time
	StartedAt  *time.Time
	FinishedAt *time.Time

	*vz.VirtualMachine
	// contains filtered or unexported fields
}

VirtualMachineInstance represents a virtual machine instance.

func NewVirtualMachineInstance

func NewVirtualMachineInstance(ctx context.Context, config *config.VirtualMachineConfiguration) (i *VirtualMachineInstance, err error)

NewVirtualMachineInstance creates a new virtual machine instance.

func (*VirtualMachineInstance) Start

func (i *VirtualMachineInstance) Start(ctx context.Context, opts ...vz.VirtualMachineStartOption) (err error)

Start starts the virtual machine instance and retrieves the IP address.

func (*VirtualMachineInstance) Stop

func (i *VirtualMachineInstance) Stop(ctx context.Context) (err error)

Stop stops the virtual machine instance and removes the overlay files if they exist.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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