Versions in this module Expand all Collapse all v1 v1.0.1 Dec 1, 2025 v1.0.0 Nov 27, 2025 Changes in this version + func AddDisk(ctx context.Context, vm *object.VirtualMachine, sizeGB int, ...) error + func AddNetworkAdapter(ctx context.Context, vm *object.VirtualMachine, networkName string) error + func ChangeNetwork(ctx context.Context, vm *object.VirtualMachine, adapterLabel string, ...) error + func CloneFromRequest(ctx context.Context, client *govmomi.Client, req ServerRequest, ...) (*object.VirtualMachine, error) + func CloneVM(ctx context.Context, client *govmomi.Client, templateName string, ...) (*object.VirtualMachine, error) + func CloneVMWithCustomization(ctx context.Context, client *govmomi.Client, templateName string, ...) (*object.VirtualMachine, error) + func ConnectCDROM(ctx context.Context, vm *object.VirtualMachine) error + func CreateExcelTemplate(path string, values *ExcelValidValues) error + func CreateSnapshot(ctx context.Context, vm *object.VirtualMachine, snapshotName string, ...) error + func CreateVCenterConfigTemplate(path string) error + func DecryptString(encrypted string, ks KeySource) (string, error) + func DecryptStringWithPassword(encrypted string, password string) (string, error) + func DeleteAllSnapshots(ctx context.Context, vm *object.VirtualMachine, consolidate bool) error + func DeleteSnapshot(ctx context.Context, vm *object.VirtualMachine, snapshotName string, ...) error + func DeleteVM(ctx context.Context, vm *object.VirtualMachine, deleteFromDisk bool, ...) error + func DisconnectCDROM(ctx context.Context, vm *object.VirtualMachine) error + func DownloadDirectoryFromVM(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) error + func DownloadFileFromVM(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) error + func EncryptString(plaintext string, ks KeySource) (string, error) + func EncryptStringWithPassword(plaintext string, password string) (string, error) + func EnsureConfigFile(path string) (created bool, err error) + func ExtendDisk(ctx context.Context, vm *object.VirtualMachine, diskLabel string, ...) error + func GenerateEncryptionKey() (string, error) + func GetVM(ctx context.Context, client *govmomi.Client, vmName string, datacenter string) (*object.VirtualMachine, error) + func MountISO(ctx context.Context, vm *object.VirtualMachine, isoPath string, ...) error + func NewLinuxCustomization(cfg LinuxCustomizationConfig) *types.CustomizationSpec + func NewWindowsCustomization(cfg WindowsCustomizationConfig) *types.CustomizationSpec + func PowerOffVM(ctx context.Context, vm *object.VirtualMachine) error + func PowerOnVM(ctx context.Context, vm *object.VirtualMachine) error + func RemoveDisk(ctx context.Context, vm *object.VirtualMachine, diskLabel string) error + func RestartVM(ctx context.Context, vm *object.VirtualMachine) error + func RevertToSnapshot(ctx context.Context, vm *object.VirtualMachine, snapshotName string, ...) error + func RunScriptOnVM(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) (int64, error) + func SetVMResources(ctx context.Context, vm *object.VirtualMachine, numCPUs int32, memoryMB int64) error + func UnmountISO(ctx context.Context, vm *object.VirtualMachine, disconnect bool) error + func UnregisterVM(ctx context.Context, vm *object.VirtualMachine) error + func UploadAndRunScript(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) (int64, error) + func UploadDirectoryToVM(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) error + func UploadFileToVM(ctx context.Context, vm *object.VirtualMachine, guestUsername string, ...) error + func ValidateExcel(path string, cfg *VCenterConfig, strict bool) (bool, []string, error) + func WaitForCustomization(ctx context.Context, vm *object.VirtualMachine, timeout time.Duration) error + func WaitForIP(ctx context.Context, vm *object.VirtualMachine, timeout time.Duration) (string, error) + func WaitForTools(ctx context.Context, vm *object.VirtualMachine) error + type Client struct + func ConnectWithPassword(ctx context.Context, config ConnectConfig) (*Client, error) + func ConnectWithSSPI(ctx context.Context, host string, insecure bool, datacenter string) (*Client, error) + func ConnectWithURL(ctx context.Context, urlStr string, insecure bool, datacenter string) (*Client, error) + func (c *Client) GetDatacenter() *object.Datacenter + func (c *Client) GetDatacenterName() string + func (c *Client) GetFinder() *find.Finder + func (c *Client) Logout(ctx context.Context) error + func (c *Client) SetDatacenter(ctx context.Context, datacenterName string) error + type ConfigurationError struct + Message string + func (e *ConfigurationError) Error() string + type ConnectConfig struct + Datacenter string + Host string + Insecure bool + Password string + Username string + type Credential struct + Insecure bool + Password string + Server string + Username string + type CredentialStore struct + Credentials map[string]Credential + func LoadEncryptedCredentialStore(path string, ks KeySource) (*CredentialStore, error) + func LoadEncryptedCredentialStoreWithPassword(path string, password string) (*CredentialStore, error) + func LoadPlaintextCredentialStore(path string) (*CredentialStore, error) + func NewCredentialStore() *CredentialStore + func (s *CredentialStore) AddCredential(name string, cred Credential) + func (s *CredentialStore) GetCredential(name string) (Credential, bool) + func (s *CredentialStore) ListNames() []string + func (s *CredentialStore) SaveEncrypted(path string, ks KeySource) error + func (s *CredentialStore) SaveEncryptedWithPassword(path string, password string) error + func (s *CredentialStore) SavePlaintext(path string) error + type ExcelCustomization struct + AdminPasswordSecret string + Autologon struct{ ... } + Domain string + DomainJoin ExcelDomainJoin + Hostname string + RunOnceCommands []string + Timezone string + type ExcelDomainJoin struct + OUPath string + PasswordSecret string + Username string + type ExcelHardware struct + DiskGB []int + DiskProvisioning string + MemoryMB int + NumCPUs int + ServerRole string + type ExcelNetworkAdapter struct + DNSServers []string + Gateway string + IPAddress string + PortGroup string + SubnetMask string + type ExcelVMConfig struct + Cluster string + Customization ExcelCustomization + Datacenter string + Datastore string + Folder string + Hardware ExcelHardware + NetworkAdapters []ExcelNetworkAdapter + ResourcePool string + StorageCluster string + Template string + VMName string + func ExcelToJSON(path string, outputDir string) ([]ExcelVMConfig, error) + type ExcelValidValues struct + CPUOptions []int + ComputeClusters []string + Datacenters []string + Datastores []string + DiskOptions []int + DiskProvisioning []string + Domains []string + MemoryOptions []int + PortGroups []string + ServerRoles []string + StorageClusters []string + SubnetMasks []string + Templates []string + Timezones []string + func DefaultExcelValidValues() ExcelValidValues + type InventoryOptions struct + IncludeDatastores *bool + IncludeFolders *bool + IncludeTemplates *bool + type KeySource struct + func KeySourceDirect(secret string) KeySource + func KeySourceEnv(name string) KeySource + func KeySourceFile(path string) KeySource + type LinuxCustomizationConfig struct + Adapters []NetworkAdapter + DNSSuffixes []string + Domain string + GlobalDNS []string + Hostname string + type NetworkAdapter struct + DNSServers []string + Gateway string + IPAddress string + Network string + SubnetMask string + type NetworkInfo struct + AdapterType string + Connected bool + IPAddresses []string + Label string + MACAddress string + Network string + type NotFoundError struct + Name string + ResourceType string + func (e *NotFoundError) Error() string + type OperationError struct + Err error + Operation string + func (e *OperationError) Error() string + func (e *OperationError) Unwrap() error + type ServerRequest struct + Adapters []NetworkAdapter + AutologonCount int + CPUs int32 + DNSServers []string + DNSSuffixes []string + DiskGB int + DiskProvisioning string + DisksGB []int + Domain string + Gateway string + IPAddress string + MachineObjectOU string + MemoryGB int + Name string + SubnetMask string + Template string + func (r *ServerRequest) Validate() error + type SnapshotInfo struct + CreateTime string + Description string + ID int32 + Level int + Name string + State string + func GetCurrentSnapshot(ctx context.Context, vm *object.VirtualMachine) (*SnapshotInfo, error) + func ListSnapshots(ctx context.Context, vm *object.VirtualMachine) ([]SnapshotInfo, error) + type VCenterConfig struct + AdminPassword string + Cluster string + Datacenter string + Datastore string + DomainPassword string + DomainUser string + Folder string + Password string + ResourcePool string + StorageCluster string + Timezone int + Username string + VCenter string + VerifySSL bool + func DefaultVCenterConfig() VCenterConfig + func LoadVCenterConfig(path string) (VCenterConfig, error) + func MustLoadVCenterConfig(path string) VCenterConfig + func (cfg *VCenterConfig) MergeWithDefaults(defaults VCenterConfig) + func (cfg VCenterConfig) Save(path string) error + func (cfg VCenterConfig) Validate() error + type VCenterInventory struct + ComputeClusters map[string][]string + Datacenters []string + Datastores map[string][]string + Folders map[string][]string + PortGroups map[string][]string + StorageClusters map[string][]string + Templates map[string][]string + func ScanVCenter(ctx context.Context, client *govmomi.Client, opts InventoryOptions) (*VCenterInventory, error) + func (inv *VCenterInventory) ToFlat() map[string][]string + type VMInfo struct + Annotation string + CPUCoresPerSocket int32 + CPUCount int32 + CPUSockets int32 + Datastore string + Domain string + Folder string + GuestHostname string + GuestIPAddress string + GuestOS string + GuestOSFullName string + InstanceUUID string + MemoryGB float64 + MemoryMB int64 + Name string + Networks []NetworkInfo + PowerState string + ResourcePool string + ToolsStatus string + ToolsVersion string + UUID string + func GetVMInfo(ctx context.Context, vm *object.VirtualMachine) (*VMInfo, error) + type ValidationError struct + Field string + Message string + func (e *ValidationError) Error() string + type WindowsCustomizationConfig struct + Adapters []NetworkAdapter + AdminPassword string + AutologonCount int + ComputerName string + DNSSuffixes []string + Domain string + DomainPassword string + DomainUser string + GlobalDNS []string + MachineObjectOU string + Timezone int