vm

package
v0.0.0-...-d1d461c Latest Latest
Warning

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

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

Documentation

Overview

Package vm contains logic relevant to VMs used during an experiment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeSettings

func MergeSettings(baseSettings, runSettings interface{})

MergeSettings merges "run" settings into "base" settings

Types

type VM

type VM struct {
	// contains filtered or unexported fields
}

VM is a struct holding information about an experiment VM.

func NewMachine

func NewMachine(name, project string, settings interface{}) *VM

NewMachine prepares the machine for connection

func (*VM) CopyFilesFromVM

func (v *VM) CopyFilesFromVM(ctx context.Context, src, dest string) error

CopyFilesFromVM copies files from the VM to the local machine.

func (*VM) CopyFilesToVM

func (v *VM) CopyFilesToVM(ctx context.Context, src, dest string) error

CopyFilesToVM copies files from the local machine to the VM.

func (*VM) CreateWithDisk

func (v *VM) CreateWithDisk(ctx context.Context) error

CreateWithDisk creates the VM and attaches an image disk to it.

func (*VM) Delete

func (v *VM) Delete(ctx context.Context, dryRun bool) (string, error)

Delete deletes the VM image. If dryRun, it just returns the command that will delete the VM.

func (*VM) ImageDisk

func (v *VM) ImageDisk(ctx context.Context) error

ImageDisk takes an image from the attached disk.

func (*VM) IsVM

func (v *VM) IsVM() bool

IsVM returns true if the machine is a created virtual machine

func (*VM) IsWS

func (v *VM) IsWS() bool

IsWS returns true if the machine is a pre-existing workstation

func (*VM) Mount

func (v *VM) Mount(ctx context.Context) error

Mount mounts the attached disk to the VM.

func (*VM) Name

func (v *VM) Name() string

Name returns the name of the VM.

func (*VM) RunCommand

func (v *VM) RunCommand(ctx context.Context, cmd *epb.Command) (string, error)

RunCommand runs a command on the VM.

func (*VM) Sudo

func (v *VM) Sudo(cmd string) string

Sudo adds "sudo" to a command if possible for the machine

Jump to

Keyboard shortcuts

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