Help us shape the future of Go! Take the 2026 Go Developer Survey

vm

package
v7.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Sleep(time.Duration)
	Now() time.Time
}

type DiskDeployer

type DiskDeployer interface {
	Deploy(diskPool bideplmanifest.DiskPool, cloud bicloud.Cloud, vm VM, eventLoggerStage biui.Stage) ([]bidisk.Disk, error)
}

DiskDeployer is in the vm package to avoid a [disk -> vm -> disk] dependency cycle

func NewDiskDeployer

func NewDiskDeployer(diskManagerFactory bidisk.ManagerFactory, diskRepo biconfig.DiskRepo, logger boshlog.Logger, recreatePersistentDisk bool) DiskDeployer

type Manager

type Manager interface {
	FindCurrent() (VM, bool, error)
	Create(stemcell bistemcell.CloudStemcell, deploymentManifest bideplmanifest.Manifest, diskCIDs []string) (VM, error)
}

func NewManager

func NewManager(
	vmRepo biconfig.VMRepo,
	diskDeployer DiskDeployer,
	agentClient biagentclient.AgentClient,
	cloud bicloud.Cloud,
	uuidGenerator boshuuid.Generator,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
	timeService Clock,
) Manager

type ManagerFactory

type ManagerFactory interface {
	NewManager(cloud bicloud.Cloud, agentClient biagentclient.AgentClient) Manager
}

func NewManagerFactory

func NewManagerFactory(
	vmRepo biconfig.VMRepo,
	diskDeployer DiskDeployer,
	uuidGenerator boshuuid.Generator,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) ManagerFactory

type VM

type VM interface {
	CID() string
	Exists() (bool, error)
	AgentClient() biagentclient.AgentClient
	WaitUntilReady(timeout time.Duration, delay time.Duration) error
	Start() error
	Stop() error
	Drain() error
	Apply(bias.ApplySpec) error
	UpdateDisks(bideplmanifest.DiskPool, biui.Stage) ([]bidisk.Disk, error)
	WaitToBeRunning(maxAttempts int, delay time.Duration) error
	AttachDisk(bidisk.Disk) error
	DetachDisk(bidisk.Disk) error
	Disks() ([]bidisk.Disk, error)
	UnmountDisk(bidisk.Disk) error
	MigrateDisk() error
	RunScript(script string, options map[string]interface{}) error
	Delete() error
	GetState() (biagentclient.AgentState, error)
}

func NewVM

func NewVM(
	cid string,
	vmRepo biconfig.VMRepo,
	diskDeployer DiskDeployer,
	agentClient biagentclient.AgentClient,
	cloud bicloud.Cloud,
	timeService Clock,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) VM

func NewVMWithMetadata

func NewVMWithMetadata(
	cid string,
	vmRepo biconfig.VMRepo,
	diskDeployer DiskDeployer,
	agentClient biagentclient.AgentClient,
	cloud bicloud.Cloud,
	timeService Clock,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
	metadata bicloud.VMMetadata,
) VM

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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