driver

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSataController = errors.New("no available SATA controller")
)

Functions

func RemoveDatastorePrefix

func RemoveDatastorePrefix(path string) string

Cuts out the datastore prefix Example: "[datastore1] file.ext" --> "file.ext"

Types

type CloneConfig

type CloneConfig struct {
	Name            string
	Folder          string
	Cluster         string
	Host            string
	ResourcePool    string
	Datastore       string
	LinkedClone     bool
	Network         string
	MacAddress      string
	Annotation      string
	VAppProperties  map[string]string
	PrimaryDiskSize int64
	StorageConfig   StorageConfig
}

type Cluster

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

type ConnectConfig

type ConnectConfig struct {
	VCenterServer      string
	Username           string
	Password           string
	InsecureConnection bool
	Datacenter         string
}

type CreateConfig

type CreateConfig struct {
	Annotation    string
	Name          string
	Folder        string
	Cluster       string
	Host          string
	ResourcePool  string
	Datastore     string
	GuestOS       string // example: otherGuest
	NICs          []NIC
	USBController []string
	Version       uint // example: 10
	StorageConfig StorageConfig
}

type Datastore

type Datastore interface {
	Info(params ...string) (*mo.Datastore, error)
	FileExists(path string) bool
	DirExists(path string) bool
	Name() string
	ResolvePath(path string) string
	UploadFile(src, dst, host string, setHost bool) error
	Delete(path string) error
	MakeDirectory(path string) error
	Reference() types.ManagedObjectReference
}

type DatastoreDriver

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

func (*DatastoreDriver) Delete

func (ds *DatastoreDriver) Delete(path string) error

func (*DatastoreDriver) DirExists

func (ds *DatastoreDriver) DirExists(filepath string) bool

func (*DatastoreDriver) FileExists

func (ds *DatastoreDriver) FileExists(path string) bool

func (*DatastoreDriver) Info

func (ds *DatastoreDriver) Info(params ...string) (*mo.Datastore, error)

func (*DatastoreDriver) MakeDirectory

func (ds *DatastoreDriver) MakeDirectory(path string) error

func (*DatastoreDriver) Name

func (ds *DatastoreDriver) Name() string

func (*DatastoreDriver) Reference

func (*DatastoreDriver) ResolvePath

func (ds *DatastoreDriver) ResolvePath(path string) string

func (*DatastoreDriver) UploadFile

func (ds *DatastoreDriver) UploadFile(src, dst, host string, setHost bool) error

type DatastoreIsoPath

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

func (*DatastoreIsoPath) GetFilePath

func (d *DatastoreIsoPath) GetFilePath() string

func (*DatastoreIsoPath) Validate

func (d *DatastoreIsoPath) Validate() bool

type DatastoreMock

type DatastoreMock struct {
	FileExistsCalled bool
	FileExistsReturn bool

	DirExistsCalled bool
	DirExistsReturn bool

	NameReturn string

	MakeDirectoryCalled bool

	ResolvePathCalled bool
	ResolvePathReturn string

	DeleteCalled bool
	DeletePath   string
	DeleteErr    error

	UploadFileCalled  bool
	UploadFileSrc     string
	UploadFileDst     string
	UploadFileHost    string
	UploadFileSetHost bool
	UploadFileErr     error
}

func (*DatastoreMock) Delete

func (ds *DatastoreMock) Delete(path string) error

func (*DatastoreMock) DirExists

func (ds *DatastoreMock) DirExists(path string) bool

func (*DatastoreMock) FileExists

func (ds *DatastoreMock) FileExists(path string) bool

func (*DatastoreMock) Info

func (ds *DatastoreMock) Info(params ...string) (*mo.Datastore, error)

func (*DatastoreMock) MakeDirectory

func (ds *DatastoreMock) MakeDirectory(path string) error

func (*DatastoreMock) Name

func (ds *DatastoreMock) Name() string

func (*DatastoreMock) Reference

func (ds *DatastoreMock) Reference() types.ManagedObjectReference

func (*DatastoreMock) ResolvePath

func (ds *DatastoreMock) ResolvePath(path string) string

func (*DatastoreMock) UploadFile

func (ds *DatastoreMock) UploadFile(src, dst, host string, setHost bool) error

type Disk

type Disk struct {
	DiskSize            int64
	DiskEagerlyScrub    bool
	DiskThinProvisioned bool
	ControllerIndex     int
}

type Driver

type Driver interface {
	NewVM(ref *types.ManagedObjectReference) VirtualMachine
	FindVM(name string) (VirtualMachine, error)
	FindCluster(name string) (*Cluster, error)
	PreCleanVM(ui packersdk.Ui, vmPath string, force bool, vsphereCluster string, vsphereHost string, vsphereResourcePool string) error
	CreateVM(config *CreateConfig) (VirtualMachine, error)

	NewDatastore(ref *types.ManagedObjectReference) Datastore
	FindDatastore(name string, host string) (Datastore, error)
	GetDatastoreName(id string) (string, error)
	GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)

	NewFolder(ref *types.ManagedObjectReference) *Folder
	FindFolder(name string) (*Folder, error)
	NewHost(ref *types.ManagedObjectReference) *Host
	FindHost(name string) (*Host, error)
	NewNetwork(ref *types.ManagedObjectReference) *Network
	FindNetwork(name string) (*Network, error)
	FindNetworks(name string) ([]*Network, error)
	NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
	FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)

	FindContentLibraryByName(name string) (*Library, error)
	FindContentLibraryItem(libraryId string, name string) (*library.Item, error)
	FindContentLibraryFileDatastorePath(isoPath string) (string, error)
	UpdateContentLibraryItem(item *library.Item, name string, description string) error
	Cleanup() (error, error)
}

func NewDriver

func NewDriver(config *ConnectConfig) (Driver, error)

type DriverMock

type DriverMock struct {
	FindDatastoreCalled bool
	DatastoreMock       *DatastoreMock
	FindDatastoreName   string
	FindDatastoreHost   string
	FindDatastoreErr    error

	PreCleanShouldFail bool
	PreCleanVMCalled   bool
	PreCleanForce      bool
	PreCleanVMPath     string

	CreateVMShouldFail bool
	CreateVMCalled     bool
	CreateConfig       *CreateConfig
	VM                 VirtualMachine

	FindVMCalled bool
	FindVMName   string
}

func NewDriverMock

func NewDriverMock() *DriverMock

func (*DriverMock) Cleanup added in v1.2.0

func (d *DriverMock) Cleanup() (error, error)

func (*DriverMock) CreateVM

func (d *DriverMock) CreateVM(config *CreateConfig) (VirtualMachine, error)

func (*DriverMock) FindCluster

func (d *DriverMock) FindCluster(name string) (*Cluster, error)

func (*DriverMock) FindContentLibraryByName

func (d *DriverMock) FindContentLibraryByName(name string) (*Library, error)

func (*DriverMock) FindContentLibraryFileDatastorePath

func (d *DriverMock) FindContentLibraryFileDatastorePath(isoPath string) (string, error)

func (*DriverMock) FindContentLibraryItem

func (d *DriverMock) FindContentLibraryItem(libraryId string, name string) (*library.Item, error)

func (*DriverMock) FindDatastore

func (d *DriverMock) FindDatastore(name string, host string) (Datastore, error)

func (*DriverMock) FindFolder

func (d *DriverMock) FindFolder(name string) (*Folder, error)

func (*DriverMock) FindHost

func (d *DriverMock) FindHost(name string) (*Host, error)

func (*DriverMock) FindNetwork

func (d *DriverMock) FindNetwork(name string) (*Network, error)

func (*DriverMock) FindNetworks

func (d *DriverMock) FindNetworks(name string) ([]*Network, error)

func (*DriverMock) FindResourcePool

func (d *DriverMock) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)

func (*DriverMock) FindVM

func (d *DriverMock) FindVM(name string) (VirtualMachine, error)

func (*DriverMock) GetDatastoreFilePath

func (d *DriverMock) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)

func (*DriverMock) GetDatastoreName

func (d *DriverMock) GetDatastoreName(id string) (string, error)

func (*DriverMock) NewDatastore

func (d *DriverMock) NewDatastore(ref *types.ManagedObjectReference) Datastore

func (*DriverMock) NewFolder

func (d *DriverMock) NewFolder(ref *types.ManagedObjectReference) *Folder

func (*DriverMock) NewHost

func (d *DriverMock) NewHost(ref *types.ManagedObjectReference) *Host

func (*DriverMock) NewNetwork

func (d *DriverMock) NewNetwork(ref *types.ManagedObjectReference) *Network

func (*DriverMock) NewResourcePool

func (d *DriverMock) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool

func (*DriverMock) NewVM

func (*DriverMock) PreCleanVM

func (d *DriverMock) PreCleanVM(ui packersdk.Ui, vmPath string, force bool, vsphereCluster string, vsphereHost string, vsphereResourcePool string) error

func (*DriverMock) UpdateContentLibraryItem added in v1.0.7

func (d *DriverMock) UpdateContentLibraryItem(item *library.Item, name string, description string) error

type Folder

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

func (*Folder) Info

func (f *Folder) Info(params ...string) (*mo.Folder, error)

func (*Folder) Path

func (f *Folder) Path() (string, error)

type HardwareConfig

type HardwareConfig struct {
	CPUs                  int32
	CpuCores              int32
	CPUReservation        int64
	CPULimit              int64
	RAM                   int64
	RAMReservation        int64
	RAMReserveAll         bool
	NestedHV              bool
	CpuHotAddEnabled      bool
	MemoryHotAddEnabled   bool
	VideoRAM              int64
	Displays              int32
	VGPUProfile           string
	Firmware              string
	ForceBIOSSetup        bool
	VTPMEnabled           bool
	VirtualPrecisionClock string
}

type Host

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

func (*Host) Info

func (h *Host) Info(params ...string) (*mo.HostSystem, error)

type KeyInput

type KeyInput struct {
	Scancode key.Code
	Alt      bool
	Ctrl     bool
	Shift    bool
}

type Library

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

type LibraryFilePath

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

func (*LibraryFilePath) GetFileName

func (l *LibraryFilePath) GetFileName() string

func (*LibraryFilePath) GetLibraryItemName

func (l *LibraryFilePath) GetLibraryItemName() string

func (*LibraryFilePath) GetLibraryName

func (l *LibraryFilePath) GetLibraryName() string

func (*LibraryFilePath) Validate

func (l *LibraryFilePath) Validate() error

type MultipleNetworkFoundError

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

func (*MultipleNetworkFoundError) Error

func (e *MultipleNetworkFoundError) Error() string

type NIC

type NIC struct {
	Network     string // "" for default network
	NetworkCard string // example: vmxnet3
	MacAddress  string // set mac if want specific address
	Passthrough *bool  // direct path i/o
}

type Network

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

func (*Network) Info

func (n *Network) Info(params ...string) (*mo.Network, error)

type ResourcePool

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

func (*ResourcePool) Info

func (p *ResourcePool) Info(params ...string) (*mo.ResourcePool, error)

func (*ResourcePool) Path

func (p *ResourcePool) Path() (string, error)

type RestClient

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

The rest.Client requires vCenter. RestClient is to modularize the rest.Client session and use it only when is necessary. This will allow users without vCenter Server to use the other features that do not use the rest.Client. To use the client login/logout must be done to create an authenticated session.

func (*RestClient) Login

func (r *RestClient) Login(ctx context.Context) error

func (*RestClient) Logout

func (r *RestClient) Logout(ctx context.Context) error

type StorageConfig

type StorageConfig struct {
	DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic"
	Storage            []Disk
}

func (*StorageConfig) AddStorageDevices

func (c *StorageConfig) AddStorageDevices(existingDevices object.VirtualDeviceList) ([]types.BaseVirtualDeviceConfigSpec, error)

type VCenterDriver

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

func NewVCenterDriver added in v1.0.2

func NewVCenterDriver(ctx context.Context, client *govmomi.Client, vimClient *vim25.Client, user *url.Userinfo, finder *find.Finder, datacenter *object.Datacenter) *VCenterDriver

func (*VCenterDriver) Cleanup added in v1.2.0

func (d *VCenterDriver) Cleanup() (error, error)

func (*VCenterDriver) CreateVM

func (d *VCenterDriver) CreateVM(config *CreateConfig) (VirtualMachine, error)

func (*VCenterDriver) FindCluster

func (d *VCenterDriver) FindCluster(name string) (*Cluster, error)

func (*VCenterDriver) FindContentLibraryByName

func (d *VCenterDriver) FindContentLibraryByName(name string) (*Library, error)

func (*VCenterDriver) FindContentLibraryFileDatastorePath

func (d *VCenterDriver) FindContentLibraryFileDatastorePath(isoPath string) (string, error)

func (*VCenterDriver) FindContentLibraryItem

func (d *VCenterDriver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error)

func (*VCenterDriver) FindDatastore

func (d *VCenterDriver) FindDatastore(name string, host string) (Datastore, error)

If name is an empty string, then resolve host's one

func (*VCenterDriver) FindFolder

func (d *VCenterDriver) FindFolder(name string) (*Folder, error)

func (*VCenterDriver) FindHost

func (d *VCenterDriver) FindHost(name string) (*Host, error)

func (*VCenterDriver) FindNetwork

func (d *VCenterDriver) FindNetwork(name string) (*Network, error)

func (*VCenterDriver) FindNetworks

func (d *VCenterDriver) FindNetworks(name string) ([]*Network, error)

func (*VCenterDriver) FindResourcePool

func (d *VCenterDriver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)

func (*VCenterDriver) FindVM

func (d *VCenterDriver) FindVM(name string) (VirtualMachine, error)

func (*VCenterDriver) GetDatastoreFilePath

func (d *VCenterDriver) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)

The file ID isn't available via the API, so we use DatastoreBrowser to search

func (*VCenterDriver) GetDatastoreName

func (d *VCenterDriver) GetDatastoreName(id string) (string, error)

func (*VCenterDriver) NewDatastore

func (d *VCenterDriver) NewDatastore(ref *types.ManagedObjectReference) Datastore

func (*VCenterDriver) NewFolder

func (d *VCenterDriver) NewFolder(ref *types.ManagedObjectReference) *Folder

func (*VCenterDriver) NewHost

func (d *VCenterDriver) NewHost(ref *types.ManagedObjectReference) *Host

func (*VCenterDriver) NewNetwork

func (d *VCenterDriver) NewNetwork(ref *types.ManagedObjectReference) *Network

func (*VCenterDriver) NewResourcePool

func (d *VCenterDriver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool

func (*VCenterDriver) NewVM

func (*VCenterDriver) PreCleanVM

func (d *VCenterDriver) PreCleanVM(ui packersdk.Ui, vmPath string, force bool, vsphereCluster string, vsphereHost string, vsphereResourcePool string) error

func (*VCenterDriver) UpdateContentLibraryItem added in v1.0.7

func (d *VCenterDriver) UpdateContentLibraryItem(item *library.Item, name string, description string) error

type VirtualMachine

type VirtualMachine interface {
	Info(params ...string) (*mo.VirtualMachine, error)
	Devices() (object.VirtualDeviceList, error)
	CdromDevices() (object.VirtualDeviceList, error)
	FloppyDevices() (object.VirtualDeviceList, error)
	Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error)

	AddPublicKeys(ctx context.Context, publicKeys string) error
	Properties(ctx context.Context) (*mo.VirtualMachine, error)
	Destroy() error
	Configure(config *HardwareConfig) error
	Reconfigure(spec types.VirtualMachineConfigSpec) error
	Customize(spec types.CustomizationSpec) error
	ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error)
	WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)
	PowerOn() error
	PowerOff() error
	IsPoweredOff() (bool, error)
	StartShutdown() error
	WaitForShutdown(ctx context.Context, timeout time.Duration) error
	CreateSnapshot(name string) error
	ConvertToTemplate() error
	IsTemplate() (bool, error)
	ConvertToVirtualMachine(vsphereCluster string, vsphereHost string, vsphereResourcePool string) error
	ImportOvfToContentLibrary(ovf vcenter.OVF) error
	ImportToContentLibrary(template vcenter.Template) error
	GetDir() (string, error)
	AddFloppy(imgPath string) error
	SetBootOrder(order []string) error
	RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error

	AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error
	AddFlag(ctx context.Context, info *types.VirtualMachineFlagInfo) error
	Export() (*nfc.Lease, error)
	CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
	NewOvfManager() *ovf.Manager
	GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)
	Datacenter() *object.Datacenter

	AddCdrom(controllerType string, datastoreIsoPath string) error
	CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
	RemoveCdroms() error
	RemoveNCdroms(n_cdroms int) error
	EjectCdroms() error
	AddSATAController() error
	FindSATAController() (*types.VirtualAHCIController, error)
	// contains filtered or unexported methods
}

type VirtualMachineDriver

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

func (*VirtualMachineDriver) AddCdrom

func (vm *VirtualMachineDriver) AddCdrom(controllerType string, datastoreIsoPath string) error

func (*VirtualMachineDriver) AddConfigParams

func (vm *VirtualMachineDriver) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error

func (*VirtualMachineDriver) AddFlag added in v1.2.3

func (*VirtualMachineDriver) AddFloppy

func (vm *VirtualMachineDriver) AddFloppy(imgPath string) error

func (*VirtualMachineDriver) AddPublicKeys

func (vm *VirtualMachineDriver) AddPublicKeys(ctx context.Context, publicKeys string) error

func (*VirtualMachineDriver) AddSATAController

func (vm *VirtualMachineDriver) AddSATAController() error

func (*VirtualMachineDriver) CdromDevices added in v1.2.7

func (vm *VirtualMachineDriver) CdromDevices() (object.VirtualDeviceList, error)

func (*VirtualMachineDriver) Clone

func (*VirtualMachineDriver) Configure

func (vm *VirtualMachineDriver) Configure(config *HardwareConfig) error

func (*VirtualMachineDriver) ConvertToTemplate

func (vm *VirtualMachineDriver) ConvertToTemplate() error

func (*VirtualMachineDriver) ConvertToVirtualMachine added in v1.0.1

func (vm *VirtualMachineDriver) ConvertToVirtualMachine(vsphereCluster string, vsphereHost string, vsphereResourcePool string) error

func (*VirtualMachineDriver) CreateCdrom

func (*VirtualMachineDriver) CreateDescriptor

func (*VirtualMachineDriver) CreateSnapshot

func (vm *VirtualMachineDriver) CreateSnapshot(name string) error

func (*VirtualMachineDriver) Customize

func (vm *VirtualMachineDriver) Customize(spec types.CustomizationSpec) error

func (*VirtualMachineDriver) Datacenter added in v1.0.2

func (vm *VirtualMachineDriver) Datacenter() *object.Datacenter

func (*VirtualMachineDriver) Destroy

func (vm *VirtualMachineDriver) Destroy() error

func (*VirtualMachineDriver) Devices

func (*VirtualMachineDriver) EjectCdroms

func (vm *VirtualMachineDriver) EjectCdroms() error

func (*VirtualMachineDriver) Export

func (vm *VirtualMachineDriver) Export() (*nfc.Lease, error)

func (*VirtualMachineDriver) FindContentLibraryTemplateDatastoreName added in v1.0.2

func (vm *VirtualMachineDriver) FindContentLibraryTemplateDatastoreName(library string) ([]string, error)

func (*VirtualMachineDriver) FindSATAController

func (vm *VirtualMachineDriver) FindSATAController() (*types.VirtualAHCIController, error)

func (*VirtualMachineDriver) FloppyDevices

func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error)

func (*VirtualMachineDriver) GetDir

func (vm *VirtualMachineDriver) GetDir() (string, error)

func (*VirtualMachineDriver) GetOvfExportOptions

func (vm *VirtualMachineDriver) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)

func (*VirtualMachineDriver) ImportOvfToContentLibrary

func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error

func (*VirtualMachineDriver) ImportToContentLibrary

func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template) error

func (*VirtualMachineDriver) Info

func (vm *VirtualMachineDriver) Info(params ...string) (*mo.VirtualMachine, error)

func (*VirtualMachineDriver) IsPoweredOff

func (vm *VirtualMachineDriver) IsPoweredOff() (bool, error)

func (*VirtualMachineDriver) IsTemplate added in v1.0.1

func (vm *VirtualMachineDriver) IsTemplate() (bool, error)

func (*VirtualMachineDriver) MountCdrom added in v1.2.5

func (vm *VirtualMachineDriver) MountCdrom(controllerType string, datastoreIsoPath string, _cdrom types.BaseVirtualDevice) error

func (*VirtualMachineDriver) NewDatastore added in v1.0.2

func (*VirtualMachineDriver) NewHost added in v1.0.2

func (*VirtualMachineDriver) NewNetwork added in v1.0.2

func (*VirtualMachineDriver) NewOvfManager

func (vm *VirtualMachineDriver) NewOvfManager() *ovf.Manager

func (*VirtualMachineDriver) NewResourcePool added in v1.0.2

func (*VirtualMachineDriver) PowerOff

func (vm *VirtualMachineDriver) PowerOff() error

func (*VirtualMachineDriver) PowerOn

func (vm *VirtualMachineDriver) PowerOn() error

func (*VirtualMachineDriver) Properties

func (vm *VirtualMachineDriver) Properties(ctx context.Context) (*mo.VirtualMachine, error)

func (*VirtualMachineDriver) Reconfigure added in v1.0.2

func (vm *VirtualMachineDriver) Reconfigure(confSpec types.VirtualMachineConfigSpec) error

func (*VirtualMachineDriver) RemoveCdroms

func (vm *VirtualMachineDriver) RemoveCdroms() error

func (*VirtualMachineDriver) RemoveDevice

func (vm *VirtualMachineDriver) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error

func (*VirtualMachineDriver) RemoveNCdroms added in v1.2.5

func (vm *VirtualMachineDriver) RemoveNCdroms(n int) error

RemoveNCdroms removes up to n CD-ROMs from the image. An error will occur If n is larger then the attached CD-ROM count. n == 0 results in no CD-ROMs being removed.

func (*VirtualMachineDriver) ResizeDisk

func (vm *VirtualMachineDriver) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error)

func (*VirtualMachineDriver) SetBootOrder

func (vm *VirtualMachineDriver) SetBootOrder(order []string) error

func (*VirtualMachineDriver) StartShutdown

func (vm *VirtualMachineDriver) StartShutdown() error

func (*VirtualMachineDriver) TypeOnKeyboard

func (vm *VirtualMachineDriver) TypeOnKeyboard(input KeyInput) (int32, error)

func (*VirtualMachineDriver) WaitForIP

func (vm *VirtualMachineDriver) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)

func (*VirtualMachineDriver) WaitForShutdown

func (vm *VirtualMachineDriver) WaitForShutdown(ctx context.Context, timeout time.Duration) error

type VirtualMachineMock

type VirtualMachineMock struct {
	DestroyError  error
	DestroyCalled bool

	ConfigureError          error
	ConfigureCalled         bool
	ConfigureHardwareConfig *HardwareConfig

	FindSATAControllerCalled bool
	FindSATAControllerErr    error

	AddSATAControllerCalled bool
	AddSATAControllerErr    error

	AddCdromCalledTimes int
	AddCdromErr         error
	AddCdromTypes       []string
	AddCdromPaths       []string

	AddFlagCalled            bool
	AddFlagCalledTimes       int
	AddFlagErr               error
	AddFlagVbsEnabledValues  bool
	AddFlagVvtdEnabledValues bool

	GetDirCalled   bool
	GetDirResponse string
	GetDirErr      error

	AddFloppyCalled    bool
	AddFloppyImagePath string
	AddFloppyErr       error

	FloppyDevicesErr    error
	FloppyDevicesReturn object.VirtualDeviceList
	FloppyDevicesCalled bool

	CdromDevicesErr    error
	CdromDevicesList   object.VirtualDeviceList
	CdromDevicesCalled bool

	RemoveDeviceErr       error
	RemoveDeviceCalled    bool
	RemoveDeviceKeepFiles bool
	RemoveDeviceDevices   []types.BaseVirtualDevice

	EjectCdromsCalled bool
	EjectCdromsErr    error

	RemoveCdromsCalled bool
	RemoveCdromsErr    error

	RemoveNCdromsCalled bool
	RemoveNCdromsErr    error

	ReattachCDRomsCalled bool
	ReattachCDRomsErr    error

	CloneCalled bool
	CloneConfig *CloneConfig
	CloneError  error
}

func (*VirtualMachineMock) AddCdrom

func (vm *VirtualMachineMock) AddCdrom(controllerType string, isoPath string) error

func (*VirtualMachineMock) AddConfigParams

func (vm *VirtualMachineMock) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error

func (*VirtualMachineMock) AddFlag added in v1.2.3

func (*VirtualMachineMock) AddFloppy

func (vm *VirtualMachineMock) AddFloppy(imgPath string) error

func (*VirtualMachineMock) AddPublicKeys

func (vm *VirtualMachineMock) AddPublicKeys(ctx context.Context, publicKeys string) error

func (*VirtualMachineMock) AddSATAController

func (vm *VirtualMachineMock) AddSATAController() error

func (*VirtualMachineMock) CdromDevices added in v1.2.7

func (vm *VirtualMachineMock) CdromDevices() (object.VirtualDeviceList, error)

func (*VirtualMachineMock) Clone

func (*VirtualMachineMock) Configure

func (vm *VirtualMachineMock) Configure(config *HardwareConfig) error

func (*VirtualMachineMock) ConvertToTemplate

func (vm *VirtualMachineMock) ConvertToTemplate() error

func (*VirtualMachineMock) ConvertToVirtualMachine added in v1.0.1

func (vm *VirtualMachineMock) ConvertToVirtualMachine(vsphereCluster string, vsphereHost string, vsphereResourcePool string) error

func (*VirtualMachineMock) CreateCdrom

func (*VirtualMachineMock) CreateDescriptor

func (*VirtualMachineMock) CreateSnapshot

func (vm *VirtualMachineMock) CreateSnapshot(name string) error

func (*VirtualMachineMock) Customize

func (vm *VirtualMachineMock) Customize(spec types.CustomizationSpec) error

func (*VirtualMachineMock) Datacenter added in v1.0.2

func (vm *VirtualMachineMock) Datacenter() *object.Datacenter

func (*VirtualMachineMock) Destroy

func (vm *VirtualMachineMock) Destroy() error

func (*VirtualMachineMock) Devices

func (*VirtualMachineMock) EjectCdroms

func (vm *VirtualMachineMock) EjectCdroms() error

func (*VirtualMachineMock) Export

func (vm *VirtualMachineMock) Export() (*nfc.Lease, error)

func (*VirtualMachineMock) FindSATAController

func (vm *VirtualMachineMock) FindSATAController() (*types.VirtualAHCIController, error)

func (*VirtualMachineMock) FloppyDevices

func (vm *VirtualMachineMock) FloppyDevices() (object.VirtualDeviceList, error)

func (*VirtualMachineMock) GetDir

func (vm *VirtualMachineMock) GetDir() (string, error)

func (*VirtualMachineMock) GetOvfExportOptions

func (vm *VirtualMachineMock) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)

func (*VirtualMachineMock) ImportOvfToContentLibrary

func (vm *VirtualMachineMock) ImportOvfToContentLibrary(ovf vcenter.OVF) error

func (*VirtualMachineMock) ImportToContentLibrary

func (vm *VirtualMachineMock) ImportToContentLibrary(template vcenter.Template) error

func (*VirtualMachineMock) Info

func (vm *VirtualMachineMock) Info(params ...string) (*mo.VirtualMachine, error)

func (*VirtualMachineMock) IsPoweredOff

func (vm *VirtualMachineMock) IsPoweredOff() (bool, error)

func (*VirtualMachineMock) IsTemplate added in v1.0.1

func (vm *VirtualMachineMock) IsTemplate() (bool, error)

func (*VirtualMachineMock) NewOvfManager

func (vm *VirtualMachineMock) NewOvfManager() *ovf.Manager

func (*VirtualMachineMock) PowerOff

func (vm *VirtualMachineMock) PowerOff() error

func (*VirtualMachineMock) PowerOn

func (vm *VirtualMachineMock) PowerOn() error

func (*VirtualMachineMock) Properties

func (vm *VirtualMachineMock) Properties(ctx context.Context) (*mo.VirtualMachine, error)

func (*VirtualMachineMock) ReattachCDRoms added in v1.2.4

func (vm *VirtualMachineMock) ReattachCDRoms() error

func (*VirtualMachineMock) Reconfigure added in v1.0.2

func (vm *VirtualMachineMock) Reconfigure(confSpec types.VirtualMachineConfigSpec) error

func (*VirtualMachineMock) RemoveCdroms

func (vm *VirtualMachineMock) RemoveCdroms() error

func (*VirtualMachineMock) RemoveDevice

func (vm *VirtualMachineMock) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error

func (*VirtualMachineMock) RemoveNCdroms added in v1.2.5

func (vm *VirtualMachineMock) RemoveNCdroms(n_cdroms int) error

func (*VirtualMachineMock) ResizeDisk

func (vm *VirtualMachineMock) ResizeDisk(diskSize int64) ([]types.BaseVirtualDeviceConfigSpec, error)

func (*VirtualMachineMock) SetBootOrder

func (vm *VirtualMachineMock) SetBootOrder(order []string) error

func (*VirtualMachineMock) StartShutdown

func (vm *VirtualMachineMock) StartShutdown() error

func (*VirtualMachineMock) WaitForIP

func (vm *VirtualMachineMock) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)

func (*VirtualMachineMock) WaitForShutdown

func (vm *VirtualMachineMock) WaitForShutdown(ctx context.Context, timeout time.Duration) error

Jump to

Keyboard shortcuts

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