Documentation ¶
Index ¶
- Variables
- func RemoveDatastorePrefix(path string) string
- type CloneConfig
- type Cluster
- type ConnectConfig
- type CreateConfig
- type Datastore
- type DatastoreDriver
- func (ds *DatastoreDriver) Delete(path string) error
- func (ds *DatastoreDriver) DirExists(filepath string) bool
- func (ds *DatastoreDriver) FileExists(path string) bool
- func (ds *DatastoreDriver) Info(params ...string) (*mo.Datastore, error)
- func (ds *DatastoreDriver) MakeDirectory(path string) error
- func (ds *DatastoreDriver) Name() string
- func (ds *DatastoreDriver) Reference() types.ManagedObjectReference
- func (ds *DatastoreDriver) ResolvePath(path string) string
- func (ds *DatastoreDriver) UploadFile(src, dst, host string, setHost bool) error
- type DatastoreIsoPath
- type DatastoreMock
- func (ds *DatastoreMock) Delete(path string) error
- func (ds *DatastoreMock) DirExists(path string) bool
- func (ds *DatastoreMock) FileExists(path string) bool
- func (ds *DatastoreMock) Info(params ...string) (*mo.Datastore, error)
- func (ds *DatastoreMock) MakeDirectory(path string) error
- func (ds *DatastoreMock) Name() string
- func (ds *DatastoreMock) Reference() types.ManagedObjectReference
- func (ds *DatastoreMock) ResolvePath(path string) string
- func (ds *DatastoreMock) UploadFile(src, dst, host string, setHost bool) error
- type Disk
- type Driver
- type DriverMock
- func (d *DriverMock) CreateVM(config *CreateConfig) (VirtualMachine, error)
- func (d *DriverMock) FindCluster(name string) (*Cluster, error)
- func (d *DriverMock) FindContentLibraryByName(name string) (*Library, error)
- func (d *DriverMock) FindContentLibraryFileDatastorePath(isoPath string) (string, error)
- func (d *DriverMock) FindContentLibraryItem(libraryId string, name string) (*library.Item, error)
- func (d *DriverMock) FindDatastore(name string, host string) (Datastore, error)
- func (d *DriverMock) FindFolder(name string) (*Folder, error)
- func (d *DriverMock) FindHost(name string) (*Host, error)
- func (d *DriverMock) FindNetwork(name string) (*Network, error)
- func (d *DriverMock) FindNetworks(name string) ([]*Network, error)
- func (d *DriverMock) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)
- func (d *DriverMock) FindVM(name string) (VirtualMachine, error)
- func (d *DriverMock) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)
- func (d *DriverMock) GetDatastoreName(id string) (string, error)
- func (d *DriverMock) NewDatastore(ref *types.ManagedObjectReference) Datastore
- func (d *DriverMock) NewFolder(ref *types.ManagedObjectReference) *Folder
- func (d *DriverMock) NewHost(ref *types.ManagedObjectReference) *Host
- func (d *DriverMock) NewNetwork(ref *types.ManagedObjectReference) *Network
- func (d *DriverMock) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
- func (d *DriverMock) NewVM(ref *types.ManagedObjectReference) VirtualMachine
- func (d *DriverMock) PreCleanVM(ui packer.Ui, vmPath string, force bool) error
- type Folder
- type HardwareConfig
- type Host
- type KeyInput
- type Library
- type LibraryFilePath
- type MultipleNetworkFoundError
- type NIC
- type Network
- type ResourcePool
- type RestClient
- type VCenterDriver
- func (d *VCenterDriver) CreateVM(config *CreateConfig) (VirtualMachine, error)
- func (d *VCenterDriver) FindCluster(name string) (*Cluster, error)
- func (d *VCenterDriver) FindContentLibraryByName(name string) (*Library, error)
- func (d *VCenterDriver) FindContentLibraryFileDatastorePath(isoPath string) (string, error)
- func (d *VCenterDriver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error)
- func (d *VCenterDriver) FindDatastore(name string, host string) (Datastore, error)
- func (d *VCenterDriver) FindFolder(name string) (*Folder, error)
- func (d *VCenterDriver) FindHost(name string) (*Host, error)
- func (d *VCenterDriver) FindNetwork(name string) (*Network, error)
- func (d *VCenterDriver) FindNetworks(name string) ([]*Network, error)
- func (d *VCenterDriver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)
- func (d *VCenterDriver) FindVM(name string) (VirtualMachine, error)
- func (d *VCenterDriver) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)
- func (d *VCenterDriver) GetDatastoreName(id string) (string, error)
- func (d *VCenterDriver) NewDatastore(ref *types.ManagedObjectReference) Datastore
- func (d *VCenterDriver) NewFolder(ref *types.ManagedObjectReference) *Folder
- func (d *VCenterDriver) NewHost(ref *types.ManagedObjectReference) *Host
- func (d *VCenterDriver) NewNetwork(ref *types.ManagedObjectReference) *Network
- func (d *VCenterDriver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
- func (d *VCenterDriver) NewVM(ref *types.ManagedObjectReference) VirtualMachine
- func (d *VCenterDriver) PreCleanVM(ui packer.Ui, vmPath string, force bool) error
- type VirtualMachine
- type VirtualMachineDriver
- func (vm *VirtualMachineDriver) AddCdrom(controllerType string, datastoreIsoPath string) error
- func (vm *VirtualMachineDriver) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error
- func (vm *VirtualMachineDriver) AddFloppy(imgPath string) error
- func (vm *VirtualMachineDriver) AddPublicKeys(ctx context.Context, publicKeys string) error
- func (vm *VirtualMachineDriver) AddSATAController() error
- func (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error)
- func (vm *VirtualMachineDriver) Configure(config *HardwareConfig) error
- func (vm *VirtualMachineDriver) ConvertToTemplate() error
- func (vm *VirtualMachineDriver) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
- func (vm *VirtualMachineDriver) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
- func (vm *VirtualMachineDriver) CreateSnapshot(name string) error
- func (vm *VirtualMachineDriver) Customize(spec types.CustomizationSpec) error
- func (vm *VirtualMachineDriver) Destroy() error
- func (vm *VirtualMachineDriver) Devices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachineDriver) EjectCdroms() error
- func (vm *VirtualMachineDriver) Export() (*nfc.Lease, error)
- func (vm *VirtualMachineDriver) FindSATAController() (*types.VirtualAHCIController, error)
- func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachineDriver) GetDir() (string, error)
- func (vm *VirtualMachineDriver) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)
- func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error
- func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template) error
- func (vm *VirtualMachineDriver) Info(params ...string) (*mo.VirtualMachine, error)
- func (vm *VirtualMachineDriver) IsPoweredOff() (bool, error)
- func (vm *VirtualMachineDriver) NewOvfManager() *ovf.Manager
- func (vm *VirtualMachineDriver) PowerOff() error
- func (vm *VirtualMachineDriver) PowerOn() error
- func (vm *VirtualMachineDriver) Properties(ctx context.Context) (*mo.VirtualMachine, error)
- func (vm *VirtualMachineDriver) RemoveCdroms() error
- func (vm *VirtualMachineDriver) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
- func (vm *VirtualMachineDriver) ResizeDisk(diskSize int64) error
- func (vm *VirtualMachineDriver) SetBootOrder(order []string) error
- func (vm *VirtualMachineDriver) StartShutdown() error
- func (vm *VirtualMachineDriver) TypeOnKeyboard(input KeyInput) (int32, error)
- func (vm *VirtualMachineDriver) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)
- func (vm *VirtualMachineDriver) WaitForShutdown(ctx context.Context, timeout time.Duration) error
- type VirtualMachineMock
- func (vm *VirtualMachineMock) AddCdrom(cdromType string, isoPath string) error
- func (vm *VirtualMachineMock) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error
- func (vm *VirtualMachineMock) AddFloppy(imgPath string) error
- func (vm *VirtualMachineMock) AddPublicKeys(ctx context.Context, publicKeys string) error
- func (vm *VirtualMachineMock) AddSATAController() error
- func (vm *VirtualMachineMock) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error)
- func (vm *VirtualMachineMock) Configure(config *HardwareConfig) error
- func (vm *VirtualMachineMock) ConvertToTemplate() error
- func (vm *VirtualMachineMock) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
- func (vm *VirtualMachineMock) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
- func (vm *VirtualMachineMock) CreateSnapshot(name string) error
- func (vm *VirtualMachineMock) Customize(spec types.CustomizationSpec) error
- func (vm *VirtualMachineMock) Destroy() error
- func (vm *VirtualMachineMock) Devices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachineMock) EjectCdroms() error
- func (vm *VirtualMachineMock) Export() (*nfc.Lease, error)
- func (vm *VirtualMachineMock) FindSATAController() (*types.VirtualAHCIController, error)
- func (vm *VirtualMachineMock) FloppyDevices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachineMock) GetDir() (string, error)
- func (vm *VirtualMachineMock) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)
- func (vm *VirtualMachineMock) ImportOvfToContentLibrary(ovf vcenter.OVF) error
- func (vm *VirtualMachineMock) ImportToContentLibrary(template vcenter.Template) error
- func (vm *VirtualMachineMock) Info(params ...string) (*mo.VirtualMachine, error)
- func (vm *VirtualMachineMock) IsPoweredOff() (bool, error)
- func (vm *VirtualMachineMock) NewOvfManager() *ovf.Manager
- func (vm *VirtualMachineMock) PowerOff() error
- func (vm *VirtualMachineMock) PowerOn() error
- func (vm *VirtualMachineMock) Properties(ctx context.Context) (*mo.VirtualMachine, error)
- func (vm *VirtualMachineMock) RemoveCdroms() error
- func (vm *VirtualMachineMock) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
- func (vm *VirtualMachineMock) ResizeDisk(diskSize int64) error
- func (vm *VirtualMachineMock) SetBootOrder(order []string) error
- func (vm *VirtualMachineMock) StartShutdown() error
- func (vm *VirtualMachineMock) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)
- func (vm *VirtualMachineMock) WaitForShutdown(ctx context.Context, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSataController = errors.New("no available SATA controller")
)
Functions ¶
func RemoveDatastorePrefix ¶
Cuts out the datastore prefix Example: "[datastore1] file.ext" --> "file.ext"
Types ¶
type CloneConfig ¶
type ConnectConfig ¶
type CreateConfig ¶
type CreateConfig struct { DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic" 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 Storage []Disk }
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 (ds *DatastoreDriver) Reference() types.ManagedObjectReference
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 Driver ¶
type Driver interface { NewVM(ref *types.ManagedObjectReference) VirtualMachine FindVM(name string) (VirtualMachine, error) FindCluster(name string) (*Cluster, error) PreCleanVM(ui packer.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 }
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 (*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 (d *DriverMock) NewVM(ref *types.ManagedObjectReference) VirtualMachine
func (*DriverMock) PreCleanVM ¶ added in v1.6.3
type HardwareConfig ¶
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 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.
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 (*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 (d *VCenterDriver) NewVM(ref *types.ManagedObjectReference) VirtualMachine
func (*VCenterDriver) PreCleanVM ¶ added in v1.6.3
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) 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 (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error)
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 (vm *VirtualMachineDriver) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
func (*VirtualMachineDriver) CreateDescriptor ¶ added in v1.6.3
func (vm *VirtualMachineDriver) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
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 (vm *VirtualMachineDriver) Devices() (object.VirtualDeviceList, error)
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) 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) WaitForShutdown ¶ added in v1.6.3
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 }
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 (vm *VirtualMachineMock) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error)
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 (vm *VirtualMachineMock) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
func (*VirtualMachineMock) CreateDescriptor ¶ added in v1.6.3
func (vm *VirtualMachineMock) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
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 (vm *VirtualMachineMock) Devices() (object.VirtualDeviceList, error)
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) 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) WaitForShutdown ¶ added in v1.6.3
Click to show internal directories.
Click to hide internal directories.