driver

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 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 added in v1.6.1

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 added in v1.6.3

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

func (*DatastoreDriver) Delete added in v1.6.3

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

func (*DatastoreDriver) DirExists added in v1.6.5

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

func (*DatastoreDriver) FileExists added in v1.6.3

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

func (*DatastoreDriver) Info added in v1.6.3

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

func (*DatastoreDriver) MakeDirectory added in v1.6.3

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

func (*DatastoreDriver) Name added in v1.6.3

func (ds *DatastoreDriver) Name() string

func (*DatastoreDriver) Reference added in v1.6.3

func (*DatastoreDriver) ResolvePath added in v1.6.3

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

func (*DatastoreDriver) UploadFile added in v1.6.3

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

type DatastoreIsoPath added in v1.6.2

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

func (*DatastoreIsoPath) GetFilePath added in v1.6.2

func (d *DatastoreIsoPath) GetFilePath() string

func (*DatastoreIsoPath) Validate added in v1.6.2

func (d *DatastoreIsoPath) Validate() bool

type DatastoreMock added in v1.6.3

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 added in v1.6.3

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

func (*DatastoreMock) DirExists added in v1.6.5

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

func (*DatastoreMock) FileExists added in v1.6.3

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

func (*DatastoreMock) Info added in v1.6.3

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

func (*DatastoreMock) MakeDirectory added in v1.6.3

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

func (*DatastoreMock) Name added in v1.6.3

func (ds *DatastoreMock) Name() string

func (*DatastoreMock) Reference added in v1.6.3

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

func (*DatastoreMock) ResolvePath added in v1.6.3

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

func (*DatastoreMock) UploadFile added in v1.6.3

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

type Disk added in v1.5.5

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) 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)
}

func NewDriver

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

type DriverMock added in v1.6.3

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 added in v1.6.3

func NewDriverMock() *DriverMock

func (*DriverMock) CreateVM added in v1.6.3

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

func (*DriverMock) FindCluster added in v1.6.3

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

func (*DriverMock) FindContentLibraryByName added in v1.6.3

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

func (*DriverMock) FindContentLibraryFileDatastorePath added in v1.6.3

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

func (*DriverMock) FindContentLibraryItem added in v1.6.3

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

func (*DriverMock) FindDatastore added in v1.6.3

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

func (*DriverMock) FindFolder added in v1.6.3

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

func (*DriverMock) FindHost added in v1.6.3

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

func (*DriverMock) FindNetwork added in v1.6.3

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

func (*DriverMock) FindNetworks added in v1.6.3

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

func (*DriverMock) FindResourcePool added in v1.6.3

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

func (*DriverMock) FindVM added in v1.6.3

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

func (*DriverMock) GetDatastoreFilePath added in v1.6.3

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

func (*DriverMock) GetDatastoreName added in v1.6.3

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

func (*DriverMock) NewDatastore added in v1.6.3

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

func (*DriverMock) NewFolder added in v1.6.3

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

func (*DriverMock) NewHost added in v1.6.3

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

func (*DriverMock) NewNetwork added in v1.6.3

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

func (*DriverMock) NewResourcePool added in v1.6.3

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

func (*DriverMock) NewVM added in v1.6.3

func (*DriverMock) PreCleanVM added in v1.6.3

func (d *DriverMock) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) 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
	VGPUProfile         string
	Firmware            string
	ForceBIOSSetup      bool
}

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 added in v1.6.1

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

type LibraryFilePath added in v1.6.2

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

func (*LibraryFilePath) GetFileName added in v1.6.2

func (l *LibraryFilePath) GetFileName() string

func (*LibraryFilePath) GetLibraryItemName added in v1.6.2

func (l *LibraryFilePath) GetLibraryItemName() string

func (*LibraryFilePath) GetLibraryName added in v1.6.2

func (l *LibraryFilePath) GetLibraryName() string

func (*LibraryFilePath) Validate added in v1.6.2

func (l *LibraryFilePath) Validate() error

type MultipleNetworkFoundError added in v1.6.1

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

func (*MultipleNetworkFoundError) Error added in v1.6.1

func (e *MultipleNetworkFoundError) Error() string

type NIC added in v1.5.3

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 added in v1.6.2

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 to use the other features that doesn't use the rest.Client. To use the client login/logout must be done to create an authenticated session.

func (*RestClient) Login added in v1.6.2

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

func (*RestClient) Logout added in v1.6.2

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

type StorageConfig added in v1.6.6

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

func (*StorageConfig) AddStorageDevices added in v1.6.6

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

type VCenterDriver added in v1.6.3

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

func (*VCenterDriver) CreateVM added in v1.6.3

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

func (*VCenterDriver) FindCluster added in v1.6.3

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

func (*VCenterDriver) FindContentLibraryByName added in v1.6.3

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

func (*VCenterDriver) FindContentLibraryFileDatastorePath added in v1.6.3

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

func (*VCenterDriver) FindContentLibraryItem added in v1.6.3

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

func (*VCenterDriver) FindDatastore added in v1.6.3

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

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

func (*VCenterDriver) FindFolder added in v1.6.3

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

func (*VCenterDriver) FindHost added in v1.6.3

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

func (*VCenterDriver) FindNetwork added in v1.6.3

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

func (*VCenterDriver) FindNetworks added in v1.6.3

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

func (*VCenterDriver) FindResourcePool added in v1.6.3

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

func (*VCenterDriver) FindVM added in v1.6.3

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

func (*VCenterDriver) GetDatastoreFilePath added in v1.6.3

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 added in v1.6.3

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

func (*VCenterDriver) NewDatastore added in v1.6.3

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

func (*VCenterDriver) NewFolder added in v1.6.3

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

func (*VCenterDriver) NewHost added in v1.6.3

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

func (*VCenterDriver) NewNetwork added in v1.6.3

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

func (*VCenterDriver) NewResourcePool added in v1.6.3

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

func (*VCenterDriver) NewVM added in v1.6.3

func (*VCenterDriver) PreCleanVM added in v1.6.3

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

type VirtualMachine

type VirtualMachine interface {
	Info(params ...string) (*mo.VirtualMachine, error)
	Devices() (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
	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
	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
	Export() (*nfc.Lease, error)
	CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
	NewOvfManager() *ovf.Manager
	GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)

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

type VirtualMachineDriver added in v1.6.3

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

func (*VirtualMachineDriver) AddCdrom added in v1.6.3

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

func (*VirtualMachineDriver) AddConfigParams added in v1.6.3

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

func (*VirtualMachineDriver) AddFloppy added in v1.6.3

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

func (*VirtualMachineDriver) AddPublicKeys added in v1.6.3

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

func (*VirtualMachineDriver) AddSATAController added in v1.6.3

func (vm *VirtualMachineDriver) AddSATAController() error

func (*VirtualMachineDriver) Clone added in v1.6.3

func (*VirtualMachineDriver) Configure added in v1.6.3

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

func (*VirtualMachineDriver) ConvertToTemplate added in v1.6.3

func (vm *VirtualMachineDriver) ConvertToTemplate() error

func (*VirtualMachineDriver) CreateCdrom added in v1.6.3

func (*VirtualMachineDriver) CreateDescriptor added in v1.6.3

func (*VirtualMachineDriver) CreateSnapshot added in v1.6.3

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

func (*VirtualMachineDriver) Customize added in v1.6.3

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

func (*VirtualMachineDriver) Destroy added in v1.6.3

func (vm *VirtualMachineDriver) Destroy() error

func (*VirtualMachineDriver) Devices added in v1.6.3

func (*VirtualMachineDriver) EjectCdroms added in v1.6.3

func (vm *VirtualMachineDriver) EjectCdroms() error

func (*VirtualMachineDriver) Export added in v1.6.3

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

func (*VirtualMachineDriver) FindSATAController added in v1.6.3

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

func (*VirtualMachineDriver) FloppyDevices added in v1.6.3

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

func (*VirtualMachineDriver) GetDir added in v1.6.3

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

func (*VirtualMachineDriver) GetOvfExportOptions added in v1.6.3

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

func (*VirtualMachineDriver) ImportOvfToContentLibrary added in v1.6.3

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

func (*VirtualMachineDriver) ImportToContentLibrary added in v1.6.3

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

func (*VirtualMachineDriver) Info added in v1.6.3

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

func (*VirtualMachineDriver) IsPoweredOff added in v1.6.3

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

func (*VirtualMachineDriver) NewOvfManager added in v1.6.3

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

func (*VirtualMachineDriver) PowerOff added in v1.6.3

func (vm *VirtualMachineDriver) PowerOff() error

func (*VirtualMachineDriver) PowerOn added in v1.6.3

func (vm *VirtualMachineDriver) PowerOn() error

func (*VirtualMachineDriver) Properties added in v1.6.3

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

func (*VirtualMachineDriver) RemoveCdroms added in v1.6.3

func (vm *VirtualMachineDriver) RemoveCdroms() error

func (*VirtualMachineDriver) RemoveDevice added in v1.6.3

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

func (*VirtualMachineDriver) ResizeDisk added in v1.6.3

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

func (*VirtualMachineDriver) SetBootOrder added in v1.6.3

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

func (*VirtualMachineDriver) StartShutdown added in v1.6.3

func (vm *VirtualMachineDriver) StartShutdown() error

func (*VirtualMachineDriver) TypeOnKeyboard added in v1.6.3

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

func (*VirtualMachineDriver) WaitForIP added in v1.6.3

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

func (*VirtualMachineDriver) WaitForShutdown added in v1.6.3

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

type VirtualMachineMock added in v1.6.3

type VirtualMachineMock struct {
	DestroyError  error
	DestroyCalled bool

	ConfigureError          error
	ConfigureCalled         bool
	ConfigureHardwareConfig *HardwareConfig

	FindSATAControllerCalled bool
	FindSATAControllerErr    error

	AddSATAControllerCalled bool
	AddSATAControllerErr    error

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

	GetDirCalled   bool
	GetDirResponse string
	GetDirErr      error

	AddFloppyCalled    bool
	AddFloppyImagePath string
	AddFloppyErr       error

	FloppyDevicesErr    error
	FloppyDevicesReturn object.VirtualDeviceList
	FloppyDevicesCalled bool

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

	EjectCdromsCalled bool
	EjectCdromsErr    error

	RemoveCdromsCalled bool
	RemoveCdromsErr    error
	CloneCalled        bool
	CloneConfig        *CloneConfig
	CloneError         error
}

func (*VirtualMachineMock) AddCdrom added in v1.6.3

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

func (*VirtualMachineMock) AddConfigParams added in v1.6.3

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

func (*VirtualMachineMock) AddFloppy added in v1.6.3

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

func (*VirtualMachineMock) AddPublicKeys added in v1.6.3

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

func (*VirtualMachineMock) AddSATAController added in v1.6.3

func (vm *VirtualMachineMock) AddSATAController() error

func (*VirtualMachineMock) Clone added in v1.6.3

func (*VirtualMachineMock) Configure added in v1.6.3

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

func (*VirtualMachineMock) ConvertToTemplate added in v1.6.3

func (vm *VirtualMachineMock) ConvertToTemplate() error

func (*VirtualMachineMock) CreateCdrom added in v1.6.3

func (*VirtualMachineMock) CreateDescriptor added in v1.6.3

func (*VirtualMachineMock) CreateSnapshot added in v1.6.3

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

func (*VirtualMachineMock) Customize added in v1.6.3

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

func (*VirtualMachineMock) Destroy added in v1.6.3

func (vm *VirtualMachineMock) Destroy() error

func (*VirtualMachineMock) Devices added in v1.6.3

func (*VirtualMachineMock) EjectCdroms added in v1.6.3

func (vm *VirtualMachineMock) EjectCdroms() error

func (*VirtualMachineMock) Export added in v1.6.3

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

func (*VirtualMachineMock) FindSATAController added in v1.6.3

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

func (*VirtualMachineMock) FloppyDevices added in v1.6.3

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

func (*VirtualMachineMock) GetDir added in v1.6.3

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

func (*VirtualMachineMock) GetOvfExportOptions added in v1.6.3

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

func (*VirtualMachineMock) ImportOvfToContentLibrary added in v1.6.3

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

func (*VirtualMachineMock) ImportToContentLibrary added in v1.6.3

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

func (*VirtualMachineMock) Info added in v1.6.3

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

func (*VirtualMachineMock) IsPoweredOff added in v1.6.3

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

func (*VirtualMachineMock) NewOvfManager added in v1.6.3

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

func (*VirtualMachineMock) PowerOff added in v1.6.3

func (vm *VirtualMachineMock) PowerOff() error

func (*VirtualMachineMock) PowerOn added in v1.6.3

func (vm *VirtualMachineMock) PowerOn() error

func (*VirtualMachineMock) Properties added in v1.6.3

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

func (*VirtualMachineMock) RemoveCdroms added in v1.6.3

func (vm *VirtualMachineMock) RemoveCdroms() error

func (*VirtualMachineMock) RemoveDevice added in v1.6.3

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

func (*VirtualMachineMock) ResizeDisk added in v1.6.3

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

func (*VirtualMachineMock) SetBootOrder added in v1.6.3

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

func (*VirtualMachineMock) StartShutdown added in v1.6.3

func (vm *VirtualMachineMock) StartShutdown() error

func (*VirtualMachineMock) WaitForIP added in v1.6.3

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

func (*VirtualMachineMock) WaitForShutdown added in v1.6.3

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