Documentation
¶
Index ¶
- Variables
- func RemoveDatastorePrefix(path string) string
- type CloneConfig
- type Cluster
- type ConnectConfig
- type CreateConfig
- type Datastore
- func (ds *Datastore) Delete(path string) error
- func (ds *Datastore) FileExists(path string) bool
- func (ds *Datastore) Info(params ...string) (*mo.Datastore, error)
- func (ds *Datastore) MakeDirectory(path string) error
- func (ds *Datastore) Name() string
- func (ds *Datastore) ResolvePath(path string) string
- func (ds *Datastore) UploadFile(src, dst, host string, set_host_for_datastore_uploads bool) error
- type DatastoreIsoPath
- type Disk
- type Driver
- func (d *Driver) CreateVM(config *CreateConfig) (*VirtualMachine, error)
- func (d *Driver) FindCluster(name string) (*Cluster, error)
- func (d *Driver) FindContentLibraryByName(name string) (*Library, error)
- func (d *Driver) FindContentLibraryFileDatastorePath(isoPath string) (string, error)
- func (d *Driver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error)
- func (d *Driver) FindDatastore(name string, host string) (*Datastore, error)
- func (d *Driver) FindFolder(name string) (*Folder, error)
- func (d *Driver) FindHost(name string) (*Host, error)
- func (d *Driver) FindNetwork(name string) (*Network, error)
- func (d *Driver) FindNetworks(name string) ([]*Network, error)
- func (d *Driver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)
- func (d *Driver) FindVM(name string) (*VirtualMachine, error)
- func (d *Driver) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error)
- func (d *Driver) GetDatastoreName(id string) (string, error)
- func (d *Driver) NewDatastore(ref *types.ManagedObjectReference) *Datastore
- func (d *Driver) NewFolder(ref *types.ManagedObjectReference) *Folder
- func (d *Driver) NewHost(ref *types.ManagedObjectReference) *Host
- func (d *Driver) NewNetwork(ref *types.ManagedObjectReference) *Network
- func (d *Driver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
- func (d *Driver) NewVM(ref *types.ManagedObjectReference) *VirtualMachine
- func (d *Driver) 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 VirtualMachine
- func (vm *VirtualMachine) AddCdrom(controllerType string, datastoreIsoPath string) error
- func (vm *VirtualMachine) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error
- func (vm *VirtualMachine) AddFloppy(imgPath string) error
- func (vm *VirtualMachine) AddPublicKeys(ctx context.Context, publicKeys string) error
- func (vm *VirtualMachine) AddSATAController() error
- func (vm *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*VirtualMachine, error)
- func (vm *VirtualMachine) Configure(config *HardwareConfig) error
- func (vm *VirtualMachine) ConvertToTemplate() error
- func (vm *VirtualMachine) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
- func (vm *VirtualMachine) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
- func (vm *VirtualMachine) CreateSnapshot(name string) error
- func (vm *VirtualMachine) Customize(spec types.CustomizationSpec) error
- func (vm *VirtualMachine) Destroy() error
- func (vm *VirtualMachine) Devices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachine) EjectCdroms() error
- func (vm *VirtualMachine) Export() (*nfc.Lease, error)
- func (vm *VirtualMachine) FindSATAController() (*types.VirtualAHCIController, error)
- func (vm *VirtualMachine) GetDir() (string, error)
- func (vm *VirtualMachine) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)
- func (vm *VirtualMachine) ImportOvfToContentLibrary(ovf vcenter.OVF) error
- func (vm *VirtualMachine) ImportToContentLibrary(template vcenter.Template) error
- func (vm *VirtualMachine) Info(params ...string) (*mo.VirtualMachine, error)
- func (vm *VirtualMachine) IsPoweredOff() (bool, error)
- func (vm *VirtualMachine) NewOvfManager() *ovf.Manager
- func (vm *VirtualMachine) PowerOff() error
- func (vm *VirtualMachine) PowerOn() error
- func (vm *VirtualMachine) Properties(ctx context.Context) (*mo.VirtualMachine, error)
- func (vm *VirtualMachine) RemoveCdroms() error
- func (vm *VirtualMachine) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
- func (vm *VirtualMachine) ResizeDisk(diskSize int64) error
- func (vm *VirtualMachine) SetBootOrder(order []string) error
- func (vm *VirtualMachine) StartShutdown() error
- func (vm *VirtualMachine) TypeOnKeyboard(input KeyInput) (int32, error)
- func (vm *VirtualMachine) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error)
- func (vm *VirtualMachine) 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", "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 struct {
// contains filtered or unexported fields
}
func (*Datastore) FileExists ¶
func (*Datastore) MakeDirectory ¶
func (*Datastore) ResolvePath ¶
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 Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(config *ConnectConfig) (*Driver, error)
func (*Driver) CreateVM ¶
func (d *Driver) CreateVM(config *CreateConfig) (*VirtualMachine, error)
func (*Driver) FindCluster ¶ added in v1.6.1
func (*Driver) FindContentLibraryByName ¶ added in v1.6.2
func (*Driver) FindContentLibraryFileDatastorePath ¶ added in v1.6.2
func (*Driver) FindContentLibraryItem ¶ added in v1.6.2
func (*Driver) FindDatastore ¶
If name is an empty string, then resolve host's one
func (*Driver) FindNetworks ¶ added in v1.6.1
func (*Driver) FindResourcePool ¶
func (*Driver) GetDatastoreFilePath ¶ added in v1.6.2
The file ID isn't available via the API, so we use DatastoreBrowser to search
func (*Driver) GetDatastoreName ¶ added in v1.6.2
func (*Driver) NewDatastore ¶
func (d *Driver) NewDatastore(ref *types.ManagedObjectReference) *Datastore
func (*Driver) NewNetwork ¶
func (d *Driver) NewNetwork(ref *types.ManagedObjectReference) *Network
func (*Driver) NewResourcePool ¶
func (d *Driver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
func (*Driver) NewVM ¶
func (d *Driver) NewVM(ref *types.ManagedObjectReference) *VirtualMachine
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 VirtualMachine ¶
type VirtualMachine struct {
// contains filtered or unexported fields
}
func (*VirtualMachine) AddCdrom ¶
func (vm *VirtualMachine) AddCdrom(controllerType string, datastoreIsoPath string) error
func (*VirtualMachine) AddConfigParams ¶
func (vm *VirtualMachine) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error
func (*VirtualMachine) AddFloppy ¶
func (vm *VirtualMachine) AddFloppy(imgPath string) error
func (*VirtualMachine) AddPublicKeys ¶ added in v1.6.1
func (vm *VirtualMachine) AddPublicKeys(ctx context.Context, publicKeys string) error
func (*VirtualMachine) AddSATAController ¶
func (vm *VirtualMachine) AddSATAController() error
func (*VirtualMachine) Clone ¶
func (vm *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*VirtualMachine, error)
func (*VirtualMachine) Configure ¶
func (vm *VirtualMachine) Configure(config *HardwareConfig) error
func (*VirtualMachine) ConvertToTemplate ¶
func (vm *VirtualMachine) ConvertToTemplate() error
func (*VirtualMachine) CreateCdrom ¶
func (vm *VirtualMachine) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error)
func (*VirtualMachine) CreateDescriptor ¶ added in v1.5.5
func (vm *VirtualMachine) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error)
func (*VirtualMachine) CreateSnapshot ¶
func (vm *VirtualMachine) CreateSnapshot(name string) error
func (*VirtualMachine) Customize ¶ added in v1.6.2
func (vm *VirtualMachine) Customize(spec types.CustomizationSpec) error
func (*VirtualMachine) Destroy ¶
func (vm *VirtualMachine) Destroy() error
func (*VirtualMachine) Devices ¶
func (vm *VirtualMachine) Devices() (object.VirtualDeviceList, error)
func (*VirtualMachine) EjectCdroms ¶
func (vm *VirtualMachine) EjectCdroms() error
func (*VirtualMachine) Export ¶ added in v1.5.5
func (vm *VirtualMachine) Export() (*nfc.Lease, error)
func (*VirtualMachine) FindSATAController ¶
func (vm *VirtualMachine) FindSATAController() (*types.VirtualAHCIController, error)
func (*VirtualMachine) GetDir ¶
func (vm *VirtualMachine) GetDir() (string, error)
func (*VirtualMachine) GetOvfExportOptions ¶ added in v1.5.5
func (vm *VirtualMachine) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error)
func (*VirtualMachine) ImportOvfToContentLibrary ¶ added in v1.6.2
func (vm *VirtualMachine) ImportOvfToContentLibrary(ovf vcenter.OVF) error
func (*VirtualMachine) ImportToContentLibrary ¶ added in v1.6.1
func (vm *VirtualMachine) ImportToContentLibrary(template vcenter.Template) error
func (*VirtualMachine) Info ¶
func (vm *VirtualMachine) Info(params ...string) (*mo.VirtualMachine, error)
func (*VirtualMachine) IsPoweredOff ¶ added in v1.5.6
func (vm *VirtualMachine) IsPoweredOff() (bool, error)
func (*VirtualMachine) NewOvfManager ¶ added in v1.5.5
func (vm *VirtualMachine) NewOvfManager() *ovf.Manager
func (*VirtualMachine) PowerOff ¶
func (vm *VirtualMachine) PowerOff() error
func (*VirtualMachine) PowerOn ¶
func (vm *VirtualMachine) PowerOn() error
func (*VirtualMachine) Properties ¶ added in v1.6.1
func (vm *VirtualMachine) Properties(ctx context.Context) (*mo.VirtualMachine, error)
func (*VirtualMachine) RemoveCdroms ¶ added in v1.5.3
func (vm *VirtualMachine) RemoveCdroms() error
func (*VirtualMachine) RemoveDevice ¶
func (vm *VirtualMachine) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
func (*VirtualMachine) ResizeDisk ¶
func (vm *VirtualMachine) ResizeDisk(diskSize int64) error
func (*VirtualMachine) SetBootOrder ¶
func (vm *VirtualMachine) SetBootOrder(order []string) error
func (*VirtualMachine) StartShutdown ¶
func (vm *VirtualMachine) StartShutdown() error
func (*VirtualMachine) TypeOnKeyboard ¶
func (vm *VirtualMachine) TypeOnKeyboard(input KeyInput) (int32, error)
func (*VirtualMachine) WaitForShutdown ¶
Click to show internal directories.
Click to hide internal directories.