From 273f163d21cebaa3f9a5bb736c9e6d1b4f1dd186 Mon Sep 17 00:00:00 2001 From: Mark Old Date: Wed, 6 May 2026 10:50:18 -0700 Subject: [PATCH] Bump govmomi to 0.53.0 --- go.mod | 2 +- go.sum | 4 +- pkg/controller/vsphere/reconciler.go | 2 +- .../vmware/govmomi/crypto/keylocator.go | 699 +++++++ .../vmware/govmomi/crypto/url_helpers.go | 233 +++ .../vmware/govmomi/fault/meta_types.go | 8 + .../govmomi/internal/version/version.go | 2 +- .../github.com/vmware/govmomi/list/lister.go | 2 +- .../vmware/govmomi/object/datastore.go | 2 +- .../vmware/govmomi/object/folder.go | 2 - .../vmware/govmomi/object/host_system.go | 22 + .../govmomi/object/virtual_device_list.go | 1 + vendor/github.com/vmware/govmomi/ovf/cim.go | 561 ++++++ .../vmware/govmomi/ovf/configspec.go | 48 +- .../simulator/container_virtual_machine.go | 8 +- .../govmomi/simulator/environment_browser.go | 10 +- .../govmomi/simulator/esx/host_config_info.go | 4 +- .../simulator/esx/host_hardware_info.go | 2 +- .../govmomi/simulator/esx/host_system.go | 2 +- .../govmomi/simulator/esx/virtual_device.go | 287 ++- .../govmomi/simulator/fault_injection.go | 218 +- .../vmware/govmomi/simulator/folder.go | 2 +- .../simulator/host_datastore_browser.go | 2 +- .../simulator/host_datastore_system.go | 4 +- .../vmware/govmomi/simulator/ovf_manager.go | 2 +- .../vmware/govmomi/simulator/registry.go | 10 +- .../govmomi/simulator/session_manager.go | 2 +- .../vmware/govmomi/simulator/simulator.go | 7 +- .../vmware/govmomi/simulator/snapshot.go | 6 + .../govmomi/simulator/virtual_disk_manager.go | 150 +- .../govmomi/simulator/virtual_machine.go | 319 ++- .../simulator/vstorage_object_manager.go | 78 +- .../vmware/govmomi/vapi/internal/internal.go | 22 + .../vmware/govmomi/vapi/library/library.go | 19 +- .../vapi/library/library_configuration.go | 10 + .../govmomi/vapi/library/library_usage.go | 73 + .../vmware/govmomi/vapi/rest/client.go | 2 + .../vmware/govmomi/vapi/rest/errors.go | 69 + .../vmware/govmomi/vapi/rest/notifications.go | 33 + .../govmomi/vapi/simulator/simulator.go | 331 +++- .../github.com/vmware/govmomi/vim25/client.go | 2 +- .../vmware/govmomi/vim25/methods/methods.go | 20 + .../govmomi/vim25/methods/unreleased.go | 20 + .../vmware/govmomi/vim25/mo/extra.go | 4 + .../vmware/govmomi/vim25/mo/registry.go | 16 +- .../vmware/govmomi/vim25/types/enum.go | 830 ++++---- .../vmware/govmomi/vim25/types/guest.go | 42 + .../govmomi/vim25/types/hardware_version.go | 48 +- .../vmware/govmomi/vim25/types/helpers.go | 4 + .../vmware/govmomi/vim25/types/types.go | 1751 +++++++++++------ .../vmware/govmomi/vim25/types/unreleased.go | 99 +- .../vmware/govmomi/vmdk/descriptor.go | 27 +- .../github.com/vmware/govmomi/vmdk/writer.go | 367 ++++ vendor/modules.txt | 4 +- 54 files changed, 5165 insertions(+), 1329 deletions(-) create mode 100644 vendor/github.com/vmware/govmomi/crypto/keylocator.go create mode 100644 vendor/github.com/vmware/govmomi/crypto/url_helpers.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_configuration.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/library/library_usage.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/rest/errors.go create mode 100644 vendor/github.com/vmware/govmomi/vapi/rest/notifications.go create mode 100644 vendor/github.com/vmware/govmomi/vim25/types/guest.go create mode 100644 vendor/github.com/vmware/govmomi/vmdk/writer.go diff --git a/go.mod b/go.mod index b06acbc06d..e53b1c0a8f 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 - github.com/vmware/govmomi v0.52.0 + github.com/vmware/govmomi v0.53.0 golang.org/x/net v0.56.0 // indirect golang.org/x/time v0.15.0 gopkg.in/gcfg.v1 v1.2.3 // indirect diff --git a/go.sum b/go.sum index b17cf80fbb..abaa05e8d5 100644 --- a/go.sum +++ b/go.sum @@ -691,8 +691,8 @@ github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYR github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU= github.com/uudashr/iface v1.3.1 h1:bA51vmVx1UIhiIsQFSNq6GZ6VPTk3WNMZgRiCe9R29U= github.com/uudashr/iface v1.3.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= -github.com/vmware/govmomi v0.52.0 h1:JyxQ1IQdllrY7PJbv2am9mRsv3p9xWlIQ66bv+XnyLw= -github.com/vmware/govmomi v0.52.0/go.mod h1:Yuc9xjznU3BH0rr6g7MNS1QGvxnJlE1vOvTJ7Lx7dqI= +github.com/vmware/govmomi v0.53.0 h1:e1bZCotAq7wm4xy95ePN2uoWwz28pNp/ewZZhpBY7/4= +github.com/vmware/govmomi v0.53.0/go.mod h1:EWfuzPfxT5NV+aS2we02SLFdhvJkgeY7t7+TszgBSMY= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= diff --git a/pkg/controller/vsphere/reconciler.go b/pkg/controller/vsphere/reconciler.go index 7af805f43a..2e8c0d0dd1 100644 --- a/pkg/controller/vsphere/reconciler.go +++ b/pkg/controller/vsphere/reconciler.go @@ -1046,7 +1046,7 @@ func clone(s *machineScope) (string, error) { ExtraConfig: extraConfig, DeviceChange: deviceSpecs, NumCPUs: numCPUs, - NumCoresPerSocket: numCoresPerSocket, + NumCoresPerSocket: &numCoresPerSocket, MemoryMB: s.providerSpec.MemoryMiB, }, Location: types.VirtualMachineRelocateSpec{ diff --git a/vendor/github.com/vmware/govmomi/crypto/keylocator.go b/vendor/github.com/vmware/govmomi/crypto/keylocator.go new file mode 100644 index 0000000000..75c08ce474 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/crypto/keylocator.go @@ -0,0 +1,699 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package crypto + +import ( + "bytes" + "encoding/base64" + "fmt" + "io" + "strconv" + "strings" +) + +// KeyLocatorType identifies different types of key locators +type KeyLocatorType int + +const ( + KeyLocatorTypeInvalid KeyLocatorType = iota + + // Atomic types + KeyLocatorTypeNull // the null key locator + KeyLocatorTypeKey // encodes a key directly + + // Indirect types + KeyLocatorTypePassphrase // generates a key from a passphrase + KeyLocatorTypeLDAP // data in an LDAP server + KeyLocatorTypeScript // get key from external script + KeyLocatorTypeRole // data at a well known location + KeyLocatorTypeFQID // fully-qualified key ID + + // Compound types + KeyLocatorTypeList // list of KLs (KeySafe possibly) + KeyLocatorTypePair // A KL and associated encrypted data +) + +// KeyLocatorClass represents the class of a key locator +type KeyLocatorClass int + +const ( + KeyLocatorClassAtomic KeyLocatorClass = iota + KeyLocatorClassIndirect + KeyLocatorClassCompound +) + +// KeyLocatorRole identifies well-known keys managed by this module +type KeyLocatorRole int + +const ( + KeyLocatorRoleObfuscation KeyLocatorRole = iota + KeyLocatorRoleAdminIdent + KeyLocatorRoleAdminRecovery + KeyLocatorRoleServer +) + +// URL constants +const ( + VMwareURLPrefix = "vmware:" + VMwareURLDelim = '/' + VMwareURLCategoryKL = "key" + VMwareURLCompoundLeftDelim = '(' + VMwareURLCompoundRightDelim = ')' + VMwareURLCompoundDelim = ',' + VMwareURLNullElem = "" + VMwareURLEmptyStringElem = "" +) + +// Type name mappings +var klTypeNames = map[KeyLocatorType]string{ + KeyLocatorTypeNull: "null", + KeyLocatorTypeKey: "rawkey", + KeyLocatorTypePassphrase: "phrase", + KeyLocatorTypeLDAP: "ldap", + KeyLocatorTypeScript: "script", + KeyLocatorTypeRole: "role", + KeyLocatorTypeFQID: "fqid", + KeyLocatorTypeList: "list", + KeyLocatorTypePair: "pair", +} + +var klTypeNameReverse = make(map[string]KeyLocatorType) + +// Role name mappings +var klRoleNames = map[KeyLocatorRole]string{ + KeyLocatorRoleObfuscation: "obfuscation", + KeyLocatorRoleAdminIdent: "adminIdent", + KeyLocatorRoleAdminRecovery: "adminRecovery", + KeyLocatorRoleServer: "server", +} + +var klRoleNameReverse = make(map[string]KeyLocatorRole) + +func init() { + // Initialize reverse mappings + for k, v := range klTypeNames { + klTypeNameReverse[v] = k + } + for k, v := range klRoleNames { + klRoleNameReverse[v] = k + } +} + +// KeyLocatorPassphraseParams holds parameters for passphrase-based key locators +type KeyLocatorPassphraseParams struct { + KeyGenData []byte + KeyGenDataSize int +} + +// KeyLocatorLDAPParams holds parameters for LDAP-based key locators +type KeyLocatorLDAPParams struct { + Server string + Domain string + Port uint32 + UseSSL bool + Path string +} + +// KeyLocatorScriptParams holds parameters for script-based key locators +type KeyLocatorScriptParams struct { + RelPath string + Signature []byte + SignatureSize int +} + +// KeyLocatorFQIDParams holds parameters for FQID-based key locators +type KeyLocatorFQIDParams struct { + KeyServerID string + KeyID string +} + +// KeyLocatorIndirect represents the contents of an indirect key locator +type KeyLocatorIndirect struct { + Type KeyLocatorType + UniqueID string + + // Union of type-specific parameters + Phrase KeyLocatorPassphraseParams + LDAP KeyLocatorLDAPParams + Script KeyLocatorScriptParams + Role KeyLocatorRole + FQID KeyLocatorFQIDParams +} + +// KeyLocatorPair represents the contents of a pair key locator +type KeyLocatorPair struct { + Locker *KeyLocator + CryptoMAC string // Name of the MAC algorithm + LockedData []byte + LockedDataSize int +} + +// KeyLocator represents a key locator +type KeyLocator struct { + Type KeyLocatorType + + // Union of type-specific data + Key []byte // for atomic class (raw key data) + Indirect *KeyLocatorIndirect // for indirect class + Pair *KeyLocatorPair // for compound class, pair type + List []*KeyLocator // for compound class, list type +} + +// GetClass returns the class of the key locator type +func (kl *KeyLocator) GetClass() KeyLocatorClass { + return KeyLocatorTypeToClass(kl.Type) +} + +// KeyLocatorTypeToClass returns the class for a given type +func KeyLocatorTypeToClass(klType KeyLocatorType) KeyLocatorClass { + switch klType { + case KeyLocatorTypeNull, KeyLocatorTypeKey: + return KeyLocatorClassAtomic + case KeyLocatorTypePassphrase, KeyLocatorTypeLDAP, KeyLocatorTypeScript, KeyLocatorTypeRole, KeyLocatorTypeFQID: + return KeyLocatorClassIndirect + case KeyLocatorTypeList, KeyLocatorTypePair: + return KeyLocatorClassCompound + default: + return KeyLocatorClassAtomic // default fallback + } +} + +// keyLocatorTypeToName returns the name for a key locator type. +func KeyLocatorTypeToName(klType KeyLocatorType) string { + return klTypeNames[klType] +} + +// KeyLocatorNameToType returns the type for a key locator name +func KeyLocatorNameToType(name string) (KeyLocatorType, bool) { + klType, ok := klTypeNameReverse[strings.ToLower(name)] + return klType, ok +} + +// KeyLocatorRoleToName returns the name for a key locator role +func KeyLocatorRoleToName(role KeyLocatorRole) string { + return klRoleNames[role] +} + +// KeyLocatorNameToRole returns the role for a key locator name +func KeyLocatorNameToRole(name string) (KeyLocatorRole, bool) { + role, ok := klRoleNameReverse[strings.ToLower(name)] + return role, ok +} + +// ImportKeyLocator constructs a KeyLocator from the specified opaque string, +// which was originally exported by KeyLocator.String. +func ImportKeyLocator(s string) (*KeyLocator, error) { + var kl KeyLocator + if err := kl.UnmarshalText([]byte(s)); err != nil { + return nil, err + } + return &kl, nil +} + +func (kl KeyLocator) String() string { + data, err := kl.MarshalText() + if err != nil { + return err.Error() + } + return string(data) +} + +func (kl KeyLocator) MarshalText() ([]byte, error) { + var buf bytes.Buffer + + // Add URL prefix and category + buf.WriteString(VMwareURLPrefix) + buf.WriteString(VMwareURLCategoryKL) + buf.WriteByte(VMwareURLDelim) + + // Export the key locator + err := exportKeyLocator(&kl, &buf) + if err != nil { + return nil, fmt.Errorf("failed to export key locator: %v", err) + } + + return buf.Bytes(), nil +} + +func (kl *KeyLocator) UnmarshalText(text []byte) error { + if len(text) == 0 { + return fmt.Errorf("empty input string") + } + + curS := string(text) + + // Consume prefix and category + consumed, err := consumeToDelim(false, byte(VMwareURLDelim), &curS) + if err != nil { + return fmt.Errorf("failed to parse URL prefix: %v", err) + } + + expectedPrefix := VMwareURLPrefix + VMwareURLCategoryKL + if !strings.EqualFold(consumed, expectedPrefix) { + return fmt.Errorf("invalid URL prefix, expected %s, got %s", expectedPrefix, consumed) + } + + // Import the key locator. + if err := importKeyLocator(false, &curS, kl); err != nil { + return fmt.Errorf("failed to import key locator: %v", err) + } + + return nil +} + +// importKeyLocator imports a key locator from a URL string +func importKeyLocator( + compound bool, + s *string, + kl *KeyLocator) error { + + // Consume type + typeName, err := consumeToDelim(false, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to parse type: %v", err) + } + + // Match type + klType, ok := KeyLocatorNameToType(typeName) + if !ok { + return fmt.Errorf("unknown key locator type: %s", typeName) + } + + // Create skeleton key locator + kl.Type = klType + + // Continue importing based on class + switch kl.GetClass() { + case KeyLocatorClassAtomic: + return importAtomicKL(compound, s, kl) + case KeyLocatorClassIndirect: + return importIndirectKL(compound, s, kl) + case KeyLocatorClassCompound: + return importCompoundKL(compound, s, kl) + default: + return fmt.Errorf("unknown key locator class for type %s", typeName) + } +} + +// importAtomicKL imports an atomic key locator +func importAtomicKL(compound bool, s *string, kl *KeyLocator) error { + delim := byte(VMwareURLDelim) + if compound { + delim = byte(VMwareURLCompoundDelim) + } + + if kl.Type == KeyLocatorTypeKey { + // Consume exported key + consumed, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume key data: %v", err) + } + + // For now, store the consumed data as raw bytes + // In a real implementation, this would be imported using the crypto library + kl.Key = []byte(consumed) + + } else if kl.Type == KeyLocatorTypeNull { + // Should consume empty string + consumed, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume null element: %v", err) + } + + if consumed != "" { + return fmt.Errorf("null key locator should have empty content, got: %s", consumed) + } + } else { + return fmt.Errorf("unsupported atomic key locator type: %d", kl.Type) + } + + return nil +} + +// importIndirectKL imports an indirect key locator +func importIndirectKL(compound bool, s *string, kl *KeyLocator) error { + kl.Indirect = &KeyLocatorIndirect{Type: kl.Type} + + // Read unique ID (can be null for some types) + // Allow null elements for cacheable types (all except passphrase) + allowNull := kl.Type != KeyLocatorTypePassphrase + uniqueID, err := consumeToDelim(allowNull, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume unique ID: %v", err) + } + kl.Indirect.UniqueID = uniqueID + + delim := byte(VMwareURLDelim) + if compound { + delim = byte(VMwareURLCompoundDelim) + } + + // Read rest based on type + switch kl.Type { + case KeyLocatorTypePassphrase: + keyGenData, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume key generation data: %v", err) + } + kl.Indirect.Phrase.KeyGenData = []byte(keyGenData) + kl.Indirect.Phrase.KeyGenDataSize = len(keyGenData) + + case KeyLocatorTypeLDAP: + // Read server + server, err := consumeToDelim(true, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume LDAP server: %v", err) + } + kl.Indirect.LDAP.Server = server + + // Read domain + domain, err := consumeToDelim(true, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume LDAP domain: %v", err) + } + kl.Indirect.LDAP.Domain = domain + + // Read port + portStr, err := consumeToDelim(false, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume LDAP port: %v", err) + } + port, err := strconv.ParseUint(portStr, 10, 32) + if err != nil { + return fmt.Errorf("failed to parse LDAP port: %v", err) + } + kl.Indirect.LDAP.Port = uint32(port) + + // Read useSSL + useSSLStr, err := consumeToDelim(false, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume LDAP useSSL: %v", err) + } + useSSL, err := parseBool(useSSLStr) + if err != nil { + return fmt.Errorf("failed to parse LDAP useSSL: %v", err) + } + kl.Indirect.LDAP.UseSSL = useSSL + + // Read path + path, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume LDAP path: %v", err) + } + kl.Indirect.LDAP.Path = path + + case KeyLocatorTypeScript: + // Read relative path + relPath, err := consumeToDelim(false, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume script relative path: %v", err) + } + kl.Indirect.Script.RelPath = relPath + + // Read signature + signature, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume script signature: %v", err) + } + kl.Indirect.Script.Signature = []byte(signature) + kl.Indirect.Script.SignatureSize = len(signature) + + case KeyLocatorTypeRole: + // Read role + roleName, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume role name: %v", err) + } + role, ok := KeyLocatorNameToRole(roleName) + if !ok { + return fmt.Errorf("unknown role name: %s", roleName) + } + kl.Indirect.Role = role + + case KeyLocatorTypeFQID: + // Read key server ID + keyServerID, err := consumeToDelim(true, byte(VMwareURLDelim), s) + if err != nil { + return fmt.Errorf("failed to consume key server ID: %v", err) + } + kl.Indirect.FQID.KeyServerID = keyServerID + + // Read key ID + keyID, err := consumeToDelim(false, delim, s) + if err != nil { + return fmt.Errorf("failed to consume key ID: %v", err) + } + kl.Indirect.FQID.KeyID = keyID + + default: + return fmt.Errorf("unsupported indirect key locator type: %d", kl.Type) + } + + return nil +} + +// importCompoundKL imports a compound key locator +func importCompoundKL(compound bool, s *string, kl *KeyLocator) error { + delim := byte(VMwareURLDelim) + if compound { + delim = byte(VMwareURLCompoundDelim) + } + + // Extract content from parentheses + content, err := consumeInNested(false, byte(VMwareURLCompoundLeftDelim), byte(VMwareURLCompoundRightDelim), delim, s) + if err != nil { + return fmt.Errorf("failed to consume nested content: %v", err) + } + + curS := content + + switch kl.Type { + case KeyLocatorTypeList: + kl.List = make([]*KeyLocator, 0) + + // Parse all locators in the list + for len(curS) > 0 { + var newKL KeyLocator + if err := importKeyLocator(true, &curS, &newKL); err != nil { + return fmt.Errorf("failed to import list element: %v", err) + } + kl.List = append(kl.List, &newKL) + } + + case KeyLocatorTypePair: + kl.Pair = &KeyLocatorPair{} + + // Import locker + var locker KeyLocator + if err := importKeyLocator(true, &curS, &locker); err != nil { + return fmt.Errorf("failed to import pair locker: %v", err) + } + kl.Pair.Locker = &locker + + // Import crypto MAC name + cryptoMAC, err := consumeToDelim(false, byte(VMwareURLCompoundDelim), &curS) + if err != nil { + return fmt.Errorf("failed to consume crypto MAC: %v", err) + } + kl.Pair.CryptoMAC = cryptoMAC + + // Import locked data (base64 encoded) + base64LockedData, err := consumeToDelim(false, 0, &curS) + if err != nil { + return fmt.Errorf("failed to consume locked data: %v", err) + } + + lockedData, err := base64.StdEncoding.DecodeString(base64LockedData) + if err != nil { + return fmt.Errorf("failed to decode base64 locked data: %v", err) + } + + kl.Pair.LockedData = lockedData + kl.Pair.LockedDataSize = len(lockedData) + + default: + return fmt.Errorf("unsupported compound key locator type: %d", kl.Type) + } + + return nil +} + +// exportKeyLocator exports a key locator to a string buffer +func exportKeyLocator(kl *KeyLocator, buf io.Writer) error { + // Add type name + typeName := KeyLocatorTypeToName(kl.Type) + if typeName == "" { + return fmt.Errorf("unknown key locator type: %d", kl.Type) + } + + err := escapeAndAddString(typeName, byte(VMwareURLDelim), buf) + if err != nil { + return fmt.Errorf("failed to add type name: %v", err) + } + + // Add content based on class + switch kl.GetClass() { + case KeyLocatorClassAtomic: + return exportAtomicKL(kl, buf) + case KeyLocatorClassIndirect: + return exportIndirectKL(kl, buf) + case KeyLocatorClassCompound: + return exportCompoundKL(kl, buf) + default: + return fmt.Errorf("unknown key locator class") + } +} + +// exportAtomicKL exports an atomic key locator +func exportAtomicKL(kl *KeyLocator, buf io.Writer) error { + if kl.Type == KeyLocatorTypeKey { + // Export key data + // In a real implementation, this would use the crypto library to export the key + return escapeAndAdd(kl.Key, 0, buf) + } else if kl.Type == KeyLocatorTypeNull { + // Export empty string element + return escapeAndAddString(VMwareURLEmptyStringElem, 0, buf) + } + + return fmt.Errorf("unsupported atomic key locator type: %d", kl.Type) +} + +// exportIndirectKL exports an indirect key locator +func exportIndirectKL(kl *KeyLocator, buf io.Writer) error { + if kl.Indirect == nil { + return fmt.Errorf("indirect key locator has nil indirect data") + } + + // Add unique ID (can be null) + err := escapeAndAddString(kl.Indirect.UniqueID, byte(VMwareURLDelim), buf) + if err != nil { + return fmt.Errorf("failed to add unique ID: %v", err) + } + + // Add type-dependent contents + switch kl.Type { + case KeyLocatorTypePassphrase: + return escapeAndAdd(kl.Indirect.Phrase.KeyGenData, 0, buf) + + case KeyLocatorTypeLDAP: + // Add server + err := escapeAndAddString(kl.Indirect.LDAP.Server, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add domain + err = escapeAndAddString(kl.Indirect.LDAP.Domain, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add port + portStr := strconv.FormatUint(uint64(kl.Indirect.LDAP.Port), 10) + err = escapeAndAddString(portStr, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add useSSL + useSSLStr := formatBool(kl.Indirect.LDAP.UseSSL) + err = escapeAndAddString(useSSLStr, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add path + return escapeAndAddString(kl.Indirect.LDAP.Path, 0, buf) + + case KeyLocatorTypeScript: + // Add relative path + err := escapeAndAddString(kl.Indirect.Script.RelPath, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add signature + return escapeAndAdd(kl.Indirect.Script.Signature, 0, buf) + + case KeyLocatorTypeRole: + // Add role name + roleName := KeyLocatorRoleToName(kl.Indirect.Role) + if roleName == "" { + return fmt.Errorf("unknown role: %d", kl.Indirect.Role) + } + return escapeAndAddString(roleName, 0, buf) + + case KeyLocatorTypeFQID: + // Add key server ID + err := escapeAndAddString(kl.Indirect.FQID.KeyServerID, byte(VMwareURLDelim), buf) + if err != nil { + return err + } + + // Add key ID + return escapeAndAddString(kl.Indirect.FQID.KeyID, 0, buf) + + default: + return fmt.Errorf("unsupported indirect key locator type: %d", kl.Type) + } +} + +// exportCompoundKL exports a compound key locator +func exportCompoundKL(kl *KeyLocator, buf io.Writer) error { + // Add left delimiter + buf.Write([]byte{VMwareURLCompoundLeftDelim}) + + // Add compound contents + switch kl.Type { + case KeyLocatorTypeList: + for i, elem := range kl.List { + // Add separator between elements + if i > 0 { + buf.Write([]byte{VMwareURLCompoundDelim}) + } + + // Export this element + err := exportKeyLocator(elem, buf) + if err != nil { + return fmt.Errorf("failed to export list element %d: %v", i, err) + } + } + + case KeyLocatorTypePair: + if kl.Pair == nil { + return fmt.Errorf("pair key locator has nil pair data") + } + + // Export the locker + err := exportKeyLocator(kl.Pair.Locker, buf) + if err != nil { + return fmt.Errorf("failed to export pair locker: %v", err) + } + + // Add separator + buf.Write([]byte{VMwareURLCompoundDelim}) + + // Add crypto MAC name + err = escapeAndAddString(kl.Pair.CryptoMAC, byte(VMwareURLCompoundDelim), buf) + if err != nil { + return fmt.Errorf("failed to add crypto MAC: %v", err) + } + + // Add base64-encoded locked data + base64Data := base64.StdEncoding.EncodeToString(kl.Pair.LockedData) + err = escapeAndAddString(base64Data, 0, buf) + if err != nil { + return fmt.Errorf("failed to add locked data: %v", err) + } + + default: + return fmt.Errorf("unsupported compound key locator type: %d", kl.Type) + } + + // Add right delimiter + buf.Write([]byte{VMwareURLCompoundRightDelim}) + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/crypto/url_helpers.go b/vendor/github.com/vmware/govmomi/crypto/url_helpers.go new file mode 100644 index 0000000000..78c515da6f --- /dev/null +++ b/vendor/github.com/vmware/govmomi/crypto/url_helpers.go @@ -0,0 +1,233 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package crypto + +import ( + "fmt" + "io" + "strconv" + "strings" +) + +// URLEscape escapes all non-alphanumeric characters in the string for URL +// inclusion. +func URLEscape(input []byte) string { + if len(input) == 0 { + return "" + } + + var result strings.Builder + result.Grow(len(input) * 3) // Worst case: every byte needs escaping + + for _, b := range input { + if isAlnum(b) { + result.WriteByte(b) + } else { + result.WriteString(fmt.Sprintf("%%%02x", b)) + } + } + + return result.String() +} + +// URLUnescape unescapes a URL-encoded string. +func URLUnescape(input string) ([]byte, error) { + if len(input) == 0 { + return nil, nil + } + + result := make([]byte, 0, len(input)) + i := 0 + + for i < len(input) { + if input[i] == '%' { + if i+2 >= len(input) { + return nil, fmt.Errorf("invalid URL escape sequence") + } + + hex := input[i+1 : i+3] + if !isHexDigit(input[i+1]) || !isHexDigit(input[i+2]) { + return nil, fmt.Errorf("invalid hex digits in escape sequence: %s", hex) + } + + val, err := strconv.ParseUint(hex, 16, 8) + if err != nil { + return nil, fmt.Errorf("failed to parse hex value %s: %v", hex, err) + } + + result = append(result, byte(val)) + i += 3 + } else { + result = append(result, input[i]) + i++ + } + } + + return result, nil +} + +// isAlnum checks if a byte is alphanumeric +func isAlnum(b byte) bool { + return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9') +} + +// isHexDigit checks if a byte is a hex digit +func isHexDigit(b byte) bool { + return (b >= '0' && b <= '9') || (b >= 'a' && b <= 'f') || (b >= 'A' && b <= 'F') +} + +// escapeAndAdd escapes a string and adds it to the buffer with optional delimiter +func escapeAndAdd(s []byte, delim byte, buf io.Writer) error { + var escaped string + + if s == nil { + // Add NULL identifier + escaped = VMwareURLNullElem + } else if len(s) == 0 { + // Add empty string identifier + escaped = VMwareURLEmptyStringElem + } else { + // Escape the string + escaped = URLEscape(s) + } + + buf.Write([]byte(escaped)) + + // Add delimiter if specified + if delim != 0 { + buf.Write([]byte{delim}) + } + + return nil +} + +// escapeAndAddString is a convenience wrapper for string inputs +func escapeAndAddString(s string, delim byte, buf io.Writer) error { + if s == "" { + return escapeAndAdd(nil, delim, buf) + } + return escapeAndAdd([]byte(s), delim, buf) +} + +// consumeToDelim advances through the string until the specified delimiter +func consumeToDelim(allowNullElems bool, delim byte, s *string) (string, error) { + if len(*s) == 0 { + return "", fmt.Errorf("empty string") + } + + // Find delimiter or end of string + pos := 0 + for pos < len(*s) && (*s)[pos] != delim { + pos++ + } + + if pos == 0 { + return "", fmt.Errorf("no characters consumed") + } + + // Extract the consumed portion + consumed := (*s)[:pos] + + // Advance the string pointer + *s = (*s)[pos:] + if len(*s) > 0 && (*s)[0] == delim { + *s = (*s)[1:] // Skip delimiter + } + + // Unescape the consumed string + unescaped, err := URLUnescape(consumed) + if err != nil { + return "", err + } + + consumedStr := string(unescaped) + + // Handle special cases + if consumedStr == VMwareURLNullElem { + if !allowNullElems { + return "", fmt.Errorf("null elements not allowed") + } + return "", nil // Return empty string for null + } else if consumedStr == VMwareURLEmptyStringElem { + return "", nil + } + + return consumedStr, nil +} + +// consumeInNested consumes a nested delimited string (e.g., parentheses) +func consumeInNested(allowNullElems bool, left, right, delim byte, s *string) (string, error) { + if len(*s) == 0 || (*s)[0] != left { + return "", fmt.Errorf("string does not start with left delimiter") + } + + level := 1 + pos := 1 + + // Find matching right delimiter + for pos < len(*s) && level > 0 { + if (*s)[pos] == left { + level++ + } else if (*s)[pos] == right { + level-- + } + if level > 0 { + pos++ + } + } + + if level > 0 { + return "", fmt.Errorf("unmatched left delimiter") + } + + // pos now points to the matching right delimiter + if pos >= len(*s) { + return "", fmt.Errorf("unexpected end of string") + } + + // Extract content between delimiters (excluding the delimiters themselves) + content := (*s)[1:pos] + + // Advance past the right delimiter + pos++ + *s = (*s)[pos:] + + // Skip trailing delimiter if present + if delim != 0 && len(*s) > 0 && (*s)[0] == delim { + *s = (*s)[1:] + } + + // Handle special cases + if content == VMwareURLNullElem { + if !allowNullElems { + return "", fmt.Errorf("null elements not allowed") + } + return "", nil + } else if content == VMwareURLEmptyStringElem { + return "", nil + } + + return content, nil +} + +// parseBool parses a boolean string (case-insensitive) +func parseBool(s string) (bool, error) { + switch strings.ToUpper(s) { + case "TRUE": + return true, nil + case "FALSE": + return false, nil + default: + return false, fmt.Errorf("invalid boolean value: %s", s) + } +} + +// formatBool formats a boolean as a string +func formatBool(b bool) string { + if b { + return "TRUE" + } + return "FALSE" +} diff --git a/vendor/github.com/vmware/govmomi/fault/meta_types.go b/vendor/github.com/vmware/govmomi/fault/meta_types.go index aa952a77da..70b6de8f2c 100644 --- a/vendor/github.com/vmware/govmomi/fault/meta_types.go +++ b/vendor/github.com/vmware/govmomi/fault/meta_types.go @@ -9,6 +9,10 @@ import "github.com/vmware/govmomi/vim25/types" // IsAlreadyPoweredOffError verifies that the error is an InvalidPowerState // error and returns true if the existing state from the error is powered off func IsAlreadyPoweredOffError(err any) bool { + if err == nil { + return false + } + var existingState types.VirtualMachinePowerState In(err, func( @@ -33,6 +37,10 @@ func IsAlreadyPoweredOffError(err any) bool { // potentially longer term, such as HostCommunication; they are inherently // transient but may not resolve in a short time frame. func IsTransientError(err any) bool { + if err == nil { + return false + } + return Is(err, &types.TaskInProgress{}) || Is(err, &types.NetworkDisruptedAndConfigRolledBack{}) || Is(err, &types.VAppTaskInProgress{}) || diff --git a/vendor/github.com/vmware/govmomi/internal/version/version.go b/vendor/github.com/vmware/govmomi/internal/version/version.go index fa1e157a5f..bf88453cc1 100644 --- a/vendor/github.com/vmware/govmomi/internal/version/version.go +++ b/vendor/github.com/vmware/govmomi/internal/version/version.go @@ -9,5 +9,5 @@ const ( ClientName = "govmomi" // ClientVersion is the version of this SDK - ClientVersion = "0.52.0" + ClientVersion = "0.53.0" ) diff --git a/vendor/github.com/vmware/govmomi/list/lister.go b/vendor/github.com/vmware/govmomi/list/lister.go index 5dc93e9c5e..06bd9fe18e 100644 --- a/vendor/github.com/vmware/govmomi/list/lister.go +++ b/vendor/github.com/vmware/govmomi/list/lister.go @@ -152,7 +152,7 @@ func (l Lister) List(ctx context.Context) ([]Element, error) { case "VmwareDistributedVirtualSwitch", "DistributedVirtualSwitch": return l.ListDistributedVirtualSwitch(ctx) default: - return nil, fmt.Errorf("cannot traverse type " + l.Reference.Type) + return nil, fmt.Errorf("cannot traverse type %s", l.Reference.Type) } } diff --git a/vendor/github.com/vmware/govmomi/object/datastore.go b/vendor/github.com/vmware/govmomi/object/datastore.go index d8192b00ff..c0d9e132b3 100644 --- a/vendor/github.com/vmware/govmomi/object/datastore.go +++ b/vendor/github.com/vmware/govmomi/object/datastore.go @@ -452,7 +452,7 @@ func (d Datastore) Stat(ctx context.Context, file string) (types.BaseFileInfo, e FileType: true, FileSize: true, Modification: true, - FileOwner: types.NewBool(true), + FileOwner: true, }, MatchPattern: []string{path.Base(file)}, } diff --git a/vendor/github.com/vmware/govmomi/object/folder.go b/vendor/github.com/vmware/govmomi/object/folder.go index 29fcbd6bba..00fbe44d3f 100644 --- a/vendor/github.com/vmware/govmomi/object/folder.go +++ b/vendor/github.com/vmware/govmomi/object/folder.go @@ -6,7 +6,6 @@ package object import ( "context" - "reflect" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" @@ -216,7 +215,6 @@ func (f Folder) MoveInto(ctx context.Context, list []types.ManagedObjectReferenc } func (f Folder) PlaceVmsXCluster(ctx context.Context, spec types.PlaceVmsXClusterSpec) (*types.PlaceVmsXClusterResult, error) { - types.Add("ClusterClusterInitialPlacementAction", reflect.TypeOf((*types.ClusterClusterInitialPlacementActionEx)(nil)).Elem()) req := types.PlaceVmsXCluster{ This: f.Reference(), PlacementSpec: spec, diff --git a/vendor/github.com/vmware/govmomi/object/host_system.go b/vendor/github.com/vmware/govmomi/object/host_system.go index 9ef257e60f..24e3cb9e53 100644 --- a/vendor/github.com/vmware/govmomi/object/host_system.go +++ b/vendor/github.com/vmware/govmomi/object/host_system.go @@ -140,3 +140,25 @@ func (h HostSystem) ExitMaintenanceMode(ctx context.Context, timeout int32) (*Ta return NewTask(h.c, res.Returnval), nil } + +func (h HostSystem) UpdatePodVMProperty(ctx context.Context, propertyPath string, + podVMInfo types.HostRuntimeInfoPodVMInfo) error { + req := types.UpdatePodVMProperty{ + This: h.Reference(), + PropertyPath: propertyPath, + } + + switch propertyPath { + case "podVMOverheadInfo": + req.Property = podVMInfo.PodVMOverheadInfo + case "hasPageSharingPodVM": + req.Property = podVMInfo.HasPageSharingPodVM + case "podVMInfo": + req.Property = podVMInfo + default: + return fmt.Errorf("unsupported propertyPath: %s", propertyPath) + } + + _, err := methods.UpdatePodVMProperty(ctx, h.c, &req) + return err +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go index 714df2f236..761dacea75 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go @@ -50,6 +50,7 @@ func EthernetCardTypes() VirtualDeviceList { return VirtualDeviceList([]types.BaseVirtualDevice{ &types.VirtualE1000{}, &types.VirtualE1000e{}, + &types.VirtualVmxnet{}, &types.VirtualVmxnet2{}, &types.VirtualVmxnet3{}, &types.VirtualVmxnet3Vrdma{}, diff --git a/vendor/github.com/vmware/govmomi/ovf/cim.go b/vendor/github.com/vmware/govmomi/ovf/cim.go index 4120d4ec57..43cb25c09d 100644 --- a/vendor/github.com/vmware/govmomi/ovf/cim.go +++ b/vendor/github.com/vmware/govmomi/ovf/cim.go @@ -159,3 +159,564 @@ type CIMStorageAllocationSettingData struct { VirtualResourceBlockSize *uint64 `xml:"VirtualResourceBlockSize" json:"virtualResourceBlockSize,omitempty"` Weight *uint `xml:"Weight" json:"weight,omitempty"` } + +// CIMOSType represents the CIM (Common Information Model) OSType enumeration +// values. These values are defined by the DMTF CIM schema and used in various +// management standards. Please refer to the following URL for more information: +// https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/cim-operatingsystem +type CIMOSType int + +const ( + CIMOSTypeUnknown CIMOSType = 0 + CIMOSTypeOther CIMOSType = 1 + CIMOSTypeMACOS CIMOSType = 2 + CIMOSTypeATTUNIX CIMOSType = 3 + CIMOSTypeDGUX CIMOSType = 4 + CIMOSTypeDECNT CIMOSType = 5 + CIMOSTypeTru64UNIX CIMOSType = 6 + CIMOSTypeOpenVMS CIMOSType = 7 + CIMOSTypeHPUX CIMOSType = 8 + CIMOSTypeAIX CIMOSType = 9 + CIMOSTypeMVS CIMOSType = 10 + CIMOSTypeOS400 CIMOSType = 11 + CIMOSTypeOS2 CIMOSType = 12 + CIMOSTypeJavaMachine CIMOSType = 13 + CIMOSTypeMSDOS CIMOSType = 14 + CIMOSTypeWIN3x CIMOSType = 15 + CIMOSTypeWIN95 CIMOSType = 16 + CIMOSTypeWIN98 CIMOSType = 17 + CIMOSTypeWINNT CIMOSType = 18 + CIMOSTypeWINCE CIMOSType = 19 + CIMOSTypeNCR3000 CIMOSType = 20 + CIMOSTypeNetWare CIMOSType = 21 + CIMOSTypeOSF CIMOSType = 22 + CIMOSTypeDCOS CIMOSType = 23 + CIMOSTypeReliantUNIX CIMOSType = 24 + CIMOSTypeSCOUnixWare CIMOSType = 25 + CIMOSTypeSCOOpenServer CIMOSType = 26 + CIMOSTypeSequent CIMOSType = 27 + CIMOSTypeIRIX CIMOSType = 28 + CIMOSTypeSolaris CIMOSType = 29 + CIMOSTypeSunOS CIMOSType = 30 + CIMOSTypeU6000 CIMOSType = 31 + CIMOSTypeASERIES CIMOSType = 32 + CIMOSTypeTandemNSK CIMOSType = 33 + CIMOSTypeTandemNT CIMOSType = 34 + CIMOSTypeBS2000 CIMOSType = 35 + CIMOSTypeLINUX CIMOSType = 36 + CIMOSTypeLynx CIMOSType = 37 + CIMOSTypeXENIX CIMOSType = 38 + CIMOSTypeVMESA CIMOSType = 39 + CIMOSTypeInteractive CIMOSType = 40 + CIMOSTypeBSDUNIX CIMOSType = 41 + CIMOSTypeFreeBSD CIMOSType = 42 + CIMOSTypeNetBSD CIMOSType = 43 + CIMOSTypeGNUHurd CIMOSType = 44 + CIMOSTypeOS9 CIMOSType = 45 + CIMOSTypeMACHKernel CIMOSType = 46 + CIMOSTypeInferno CIMOSType = 47 + CIMOSTypeQNX CIMOSType = 48 + CIMOSTypeEPOC CIMOSType = 49 + CIMOSTypeIXWorks CIMOSType = 50 + CIMOSTypeVxWorks CIMOSType = 51 + CIMOSTypeMiNT CIMOSType = 52 + CIMOSTypeBeOS CIMOSType = 53 + CIMOSTypeHPMPE CIMOSType = 54 + CIMOSTypeNextStep CIMOSType = 55 + CIMOSTypePalmPilot CIMOSType = 56 + CIMOSTypeRhapsody CIMOSType = 57 + CIMOSTypeWindows2000 CIMOSType = 58 + CIMOSTypeDedicated CIMOSType = 59 + CIMOSTypeOS390 CIMOSType = 60 + CIMOSTypeVSE CIMOSType = 61 + CIMOSTypeTPF CIMOSType = 62 + CIMOSTypeWindowsMe CIMOSType = 63 + CIMOSTypeCalderaOpenUNIX CIMOSType = 64 + CIMOSTypeOpenBSD CIMOSType = 65 + CIMOSTypeNotApplicable CIMOSType = 66 + CIMOSTypeWindowsXP CIMOSType = 67 + CIMOSTypezOS CIMOSType = 68 + CIMOSTypeMicrosoftWindowsServer2003 CIMOSType = 69 + CIMOSTypeMicrosoftWindowsServer2003_64Bit CIMOSType = 70 + CIMOSTypeWindowsXP64Bit CIMOSType = 71 + CIMOSTypeWindowsXPEmbedded CIMOSType = 72 + CIMOSTypeWindowsVista CIMOSType = 73 + CIMOSTypeWindowsVista64Bit CIMOSType = 74 + CIMOSTypeWindowsEmbeddedforPointofService CIMOSType = 75 + CIMOSTypeMicrosoftWindowsServer2008 CIMOSType = 76 + CIMOSTypeMicrosoftWindowsServer2008_64Bit CIMOSType = 77 + CIMOSTypeFreeBSD64Bit CIMOSType = 78 + CIMOSTypeRedHatEnterpriseLinux CIMOSType = 79 + CIMOSTypeRedHatEnterpriseLinux64Bit CIMOSType = 80 + CIMOSTypeSolaris64Bit CIMOSType = 81 + CIMOSTypeSUSE CIMOSType = 82 + CIMOSTypeSUSE64Bit CIMOSType = 83 + CIMOSTypeSLES CIMOSType = 84 + CIMOSTypeSLES64Bit CIMOSType = 85 + CIMOSTypeNovellOES CIMOSType = 86 + CIMOSTypeNovellLinuxDesktop CIMOSType = 87 + CIMOSTypeSunJavaDesktopSystem CIMOSType = 88 + CIMOSTypeMandriva CIMOSType = 89 + CIMOSTypeMandriva64Bit CIMOSType = 90 + CIMOSTypeTurboLinux CIMOSType = 91 + CIMOSTypeTurboLinux64Bit CIMOSType = 92 + CIMOSTypeUbuntu CIMOSType = 93 + CIMOSTypeUbuntu64Bit CIMOSType = 94 + CIMOSTypeDebian CIMOSType = 95 + CIMOSTypeDebian64Bit CIMOSType = 96 + CIMOSTypeLinux24x CIMOSType = 97 + CIMOSTypeLinux24x64Bit CIMOSType = 98 + CIMOSTypeLinux26x CIMOSType = 99 + CIMOSTypeLinux26x64Bit CIMOSType = 100 + CIMOSTypeLinux64Bit CIMOSType = 101 + CIMOSTypeOther64Bit CIMOSType = 102 + CIMOSTypeMicrosoftWindowsServer2008R2 CIMOSType = 103 + CIMOSTypeVMwareESXi CIMOSType = 104 + CIMOSTypeMicrosoftWindows7 CIMOSType = 105 + CIMOSTypeCentOS32bit CIMOSType = 106 + CIMOSTypeCentOS64bit CIMOSType = 107 + CIMOSTypeOracle32bit CIMOSType = 108 + CIMOSTypeOracle64bit CIMOSType = 109 + CIMOSTypeeComStation32bitx CIMOSType = 110 + CIMOSTypeMicrosoftWindowsServer2011 CIMOSType = 111 + CIMOSTypeMicrosoftWindowsServer2012 CIMOSType = 112 + CIMOSTypeMicrosoftWindows8 CIMOSType = 113 + CIMOSTypeMicrosoftWindows81 CIMOSType = 114 + CIMOSTypeMicrosoftWindowsServer2012R2 CIMOSType = 115 +) + +// GuestIDToCIMOSType translates a vSphere Guest OS identifier to a CIM +// OSType value. +func GuestIDToCIMOSType[T ~string](guestID T) CIMOSType { + switch types.VirtualMachineGuestOsIdentifier(guestID) { + // Windows Desktop + case types.VirtualMachineGuestOsIdentifierDosGuest: + return CIMOSTypeMSDOS + case types.VirtualMachineGuestOsIdentifierWin31Guest: + return CIMOSTypeWIN3x + case types.VirtualMachineGuestOsIdentifierWin95Guest: + return CIMOSTypeWIN95 + case types.VirtualMachineGuestOsIdentifierWin98Guest: + return CIMOSTypeWIN98 + case types.VirtualMachineGuestOsIdentifierWinMeGuest: + return CIMOSTypeWindowsMe + case types.VirtualMachineGuestOsIdentifierWinNTGuest: + return CIMOSTypeWINNT + case types.VirtualMachineGuestOsIdentifierWin2000ProGuest: + return CIMOSTypeWindows2000 + case types.VirtualMachineGuestOsIdentifierWin2000ServGuest: + return CIMOSTypeWindows2000 + case types.VirtualMachineGuestOsIdentifierWin2000AdvServGuest: + return CIMOSTypeWindows2000 + case types.VirtualMachineGuestOsIdentifierWinXPHomeGuest: + return CIMOSTypeWindowsXP + case types.VirtualMachineGuestOsIdentifierWinXPProGuest: + return CIMOSTypeWindowsXP + case types.VirtualMachineGuestOsIdentifierWinXPPro64Guest: + return CIMOSTypeWindowsXP64Bit + case types.VirtualMachineGuestOsIdentifierWinVistaGuest: + return CIMOSTypeWindowsVista + case types.VirtualMachineGuestOsIdentifierWinVista64Guest: + return CIMOSTypeWindowsVista64Bit + case types.VirtualMachineGuestOsIdentifierWindows7Guest: + return CIMOSTypeMicrosoftWindows7 + case types.VirtualMachineGuestOsIdentifierWindows7_64Guest: + return CIMOSTypeMicrosoftWindows7 + case types.VirtualMachineGuestOsIdentifierWindows8Guest: + return CIMOSTypeMicrosoftWindows8 + case types.VirtualMachineGuestOsIdentifierWindows8_64Guest: + return CIMOSTypeMicrosoftWindows8 + // TODO(akutz) The following guest IDs do not exist. + /* + case types.VirtualMachineGuestOsIdentifierWindows81Guest: + return CIMOSTypeMicrosoftWindows81 + case types.VirtualMachineGuestOsIdentifierWindows81_64Guest: + return CIMOSTypeMicrosoftWindows81 + */ + case types.VirtualMachineGuestOsIdentifierWindows9Guest: + return CIMOSTypeOther // Windows 10/11 - no specific CIM type + case types.VirtualMachineGuestOsIdentifierWindows9_64Guest: + return CIMOSTypeOther64Bit + case types.VirtualMachineGuestOsIdentifierWindows11_64Guest: + return CIMOSTypeOther64Bit + case types.VirtualMachineGuestOsIdentifierWindows12_64Guest: + return CIMOSTypeOther64Bit + case types.VirtualMachineGuestOsIdentifierWindowsHyperVGuest: + return CIMOSTypeOther64Bit + + // Windows Server + case types.VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest: + return CIMOSTypeMicrosoftWindowsServer2003 + case types.VirtualMachineGuestOsIdentifierWinNetDatacenterGuest: + return CIMOSTypeMicrosoftWindowsServer2003 + case types.VirtualMachineGuestOsIdentifierWinNetBusinessGuest: + return CIMOSTypeMicrosoftWindowsServer2003 + case types.VirtualMachineGuestOsIdentifierWinNetStandardGuest: + return CIMOSTypeMicrosoftWindowsServer2003 + case types.VirtualMachineGuestOsIdentifierWinNetWebGuest: + return CIMOSTypeMicrosoftWindowsServer2003 + case types.VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest: + return CIMOSTypeMicrosoftWindowsServer2003_64Bit + case types.VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest: + return CIMOSTypeMicrosoftWindowsServer2003_64Bit + case types.VirtualMachineGuestOsIdentifierWinNetStandard64Guest: + return CIMOSTypeMicrosoftWindowsServer2003_64Bit + case types.VirtualMachineGuestOsIdentifierWinLonghornGuest: + return CIMOSTypeMicrosoftWindowsServer2008 + case types.VirtualMachineGuestOsIdentifierWinLonghorn64Guest: + return CIMOSTypeMicrosoftWindowsServer2008_64Bit + case types.VirtualMachineGuestOsIdentifierWindows7Server64Guest: + return CIMOSTypeMicrosoftWindowsServer2008R2 + case types.VirtualMachineGuestOsIdentifierWindows8Server64Guest: + return CIMOSTypeMicrosoftWindowsServer2012 + case types.VirtualMachineGuestOsIdentifierWindows9Server64Guest: + return CIMOSTypeMicrosoftWindowsServer2012R2 + case types.VirtualMachineGuestOsIdentifierWindows2019srv_64Guest: + return CIMOSTypeOther64Bit // No specific CIM type for 2019+ + case types.VirtualMachineGuestOsIdentifierWindows2019srvNext_64Guest: + return CIMOSTypeOther64Bit + case types.VirtualMachineGuestOsIdentifierWindows2022srvNext_64Guest: + return CIMOSTypeOther64Bit + + // Linux + case types.VirtualMachineGuestOsIdentifierAsianux3Guest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierAsianux3_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAsianux4Guest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierAsianux4_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAsianux5_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAsianux7_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAsianux8_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAsianux9_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierCentos6Guest: + return CIMOSTypeCentOS32bit + case types.VirtualMachineGuestOsIdentifierCentos6_64Guest: + return CIMOSTypeCentOS64bit + case types.VirtualMachineGuestOsIdentifierCentos7Guest: + return CIMOSTypeCentOS32bit + case types.VirtualMachineGuestOsIdentifierCentos7_64Guest: + return CIMOSTypeCentOS64bit + case types.VirtualMachineGuestOsIdentifierCentos8_64Guest: + return CIMOSTypeCentOS64bit + case types.VirtualMachineGuestOsIdentifierCentos9_64Guest: + return CIMOSTypeCentOS64bit + case types.VirtualMachineGuestOsIdentifierCoreos64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierDebian4Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian4_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian5Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian5_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian6Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian6_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian7Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian7_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian8Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian8_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian9Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian9_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian10Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian10_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian11Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian11_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierDebian12Guest: + return CIMOSTypeDebian + case types.VirtualMachineGuestOsIdentifierDebian12_64Guest: + return CIMOSTypeDebian64Bit + case types.VirtualMachineGuestOsIdentifierFedoraGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierFedora64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierFreebsd11Guest: + return CIMOSTypeFreeBSD + case types.VirtualMachineGuestOsIdentifierFreebsd11_64Guest: + return CIMOSTypeFreeBSD64Bit + case types.VirtualMachineGuestOsIdentifierFreebsd12Guest: + return CIMOSTypeFreeBSD + case types.VirtualMachineGuestOsIdentifierFreebsd12_64Guest: + return CIMOSTypeFreeBSD64Bit + case types.VirtualMachineGuestOsIdentifierFreebsd13Guest: + return CIMOSTypeFreeBSD + case types.VirtualMachineGuestOsIdentifierFreebsd13_64Guest: + return CIMOSTypeFreeBSD64Bit + case types.VirtualMachineGuestOsIdentifierFreebsd14Guest: + return CIMOSTypeFreeBSD + case types.VirtualMachineGuestOsIdentifierFreebsd14_64Guest: + return CIMOSTypeFreeBSD64Bit + case types.VirtualMachineGuestOsIdentifierFreebsdGuest: + return CIMOSTypeFreeBSD + case types.VirtualMachineGuestOsIdentifierFreebsd64Guest: + return CIMOSTypeFreeBSD64Bit + case types.VirtualMachineGuestOsIdentifierGenericLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierMandrakeGuest: + return CIMOSTypeMandriva + case types.VirtualMachineGuestOsIdentifierMandriva64Guest: + return CIMOSTypeMandriva64Bit + case types.VirtualMachineGuestOsIdentifierMandrivaGuest: + return CIMOSTypeMandriva + // TODO(akutz) The following guest IDs do not exist. + /* + case types.VirtualMachineGuestOsIdentifierNetbsd7Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierNetbsd7_64Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierNetbsd8Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierNetbsd8_64Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierNetbsd9Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierNetbsd9_64Guest: + return CIMOSTypeNetBSD + case types.VirtualMachineGuestOsIdentifierOpenbsd7Guest: + return CIMOSTypeOpenBSD + case types.VirtualMachineGuestOsIdentifierOpenbsd7_64Guest: + return CIMOSTypeOpenBSD + case types.VirtualMachineGuestOsIdentifierOpenbsd8Guest: + return CIMOSTypeOpenBSD + case types.VirtualMachineGuestOsIdentifierOpenbsd8_64Guest: + return CIMOSTypeOpenBSD + */ + case types.VirtualMachineGuestOsIdentifierOpensuse64Guest: + return CIMOSTypeSUSE64Bit + case types.VirtualMachineGuestOsIdentifierOpensuseGuest: + return CIMOSTypeSUSE + case types.VirtualMachineGuestOsIdentifierOracleLinux6Guest: + return CIMOSTypeOracle32bit + case types.VirtualMachineGuestOsIdentifierOracleLinux6_64Guest: + return CIMOSTypeOracle64bit + case types.VirtualMachineGuestOsIdentifierOracleLinux7Guest: + return CIMOSTypeOracle32bit + case types.VirtualMachineGuestOsIdentifierOracleLinux7_64Guest: + return CIMOSTypeOracle64bit + case types.VirtualMachineGuestOsIdentifierOracleLinux8_64Guest: + return CIMOSTypeOracle64bit + case types.VirtualMachineGuestOsIdentifierOracleLinux9_64Guest: + return CIMOSTypeOracle64bit + case types.VirtualMachineGuestOsIdentifierOracleLinuxGuest: + return CIMOSTypeOracle32bit + case types.VirtualMachineGuestOsIdentifierOracleLinux64Guest: + return CIMOSTypeOracle64bit + case types.VirtualMachineGuestOsIdentifierOther24xLinux64Guest: + return CIMOSTypeLinux24x64Bit + case types.VirtualMachineGuestOsIdentifierOther24xLinuxGuest: + return CIMOSTypeLinux24x + case types.VirtualMachineGuestOsIdentifierOther26xLinux64Guest: + return CIMOSTypeLinux26x64Bit + case types.VirtualMachineGuestOsIdentifierOther26xLinuxGuest: + return CIMOSTypeLinux26x + case types.VirtualMachineGuestOsIdentifierOther3xLinux64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierOther3xLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierOther4xLinux64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierOther4xLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierOther5xLinux64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierOther5xLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierOther6xLinux64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierOther6xLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierOtherLinux64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierOtherLinuxGuest: + return CIMOSTypeLINUX + case types.VirtualMachineGuestOsIdentifierRedhatGuest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel2Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel3Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel3_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel4Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel4_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel5Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel5_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel6Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel6_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel7Guest: + return CIMOSTypeRedHatEnterpriseLinux + case types.VirtualMachineGuestOsIdentifierRhel7_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel8_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRhel9_64Guest: + return CIMOSTypeRedHatEnterpriseLinux64Bit + case types.VirtualMachineGuestOsIdentifierRockylinux_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierSles10Guest: + return CIMOSTypeSLES + case types.VirtualMachineGuestOsIdentifierSles10_64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSles11Guest: + return CIMOSTypeSLES + case types.VirtualMachineGuestOsIdentifierSles11_64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSles12Guest: + return CIMOSTypeSLES + case types.VirtualMachineGuestOsIdentifierSles12_64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSles15_64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSles16_64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSlesGuest: + return CIMOSTypeSLES + case types.VirtualMachineGuestOsIdentifierSles64Guest: + return CIMOSTypeSLES64Bit + case types.VirtualMachineGuestOsIdentifierSuse64Guest: + return CIMOSTypeSUSE64Bit + case types.VirtualMachineGuestOsIdentifierSuseGuest: + return CIMOSTypeSUSE + case types.VirtualMachineGuestOsIdentifierTurboLinux64Guest: + return CIMOSTypeTurboLinux64Bit + case types.VirtualMachineGuestOsIdentifierTurboLinuxGuest: + return CIMOSTypeTurboLinux + case types.VirtualMachineGuestOsIdentifierUbuntu64Guest: + return CIMOSTypeUbuntu64Bit + case types.VirtualMachineGuestOsIdentifierUbuntuGuest: + return CIMOSTypeUbuntu + case types.VirtualMachineGuestOsIdentifierUnixWare7Guest: + return CIMOSTypeSCOUnixWare + + // macOS + case types.VirtualMachineGuestOsIdentifierDarwin10Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin10_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin11Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin11_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin12_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin13_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin14_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin15_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin16_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin17_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin18_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin19_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin20_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin21_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin22_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin23_64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwin64Guest: + return CIMOSTypeMACOS + case types.VirtualMachineGuestOsIdentifierDarwinGuest: + return CIMOSTypeMACOS + + // Solaris + case types.VirtualMachineGuestOsIdentifierSolaris10Guest: + return CIMOSTypeSolaris + case types.VirtualMachineGuestOsIdentifierSolaris10_64Guest: + return CIMOSTypeSolaris64Bit + case types.VirtualMachineGuestOsIdentifierSolaris11_64Guest: + return CIMOSTypeSolaris64Bit + case types.VirtualMachineGuestOsIdentifierSolaris6Guest: + return CIMOSTypeSolaris + case types.VirtualMachineGuestOsIdentifierSolaris7Guest: + return CIMOSTypeSolaris + case types.VirtualMachineGuestOsIdentifierSolaris8Guest: + return CIMOSTypeSolaris + case types.VirtualMachineGuestOsIdentifierSolaris9Guest: + return CIMOSTypeSolaris + + // Netware + case types.VirtualMachineGuestOsIdentifierNetware4Guest: + return CIMOSTypeNetWare + case types.VirtualMachineGuestOsIdentifierNetware5Guest: + return CIMOSTypeNetWare + case types.VirtualMachineGuestOsIdentifierNetware6Guest: + return CIMOSTypeNetWare + case types.VirtualMachineGuestOsIdentifierNld9Guest: + return CIMOSTypeNovellLinuxDesktop + case types.VirtualMachineGuestOsIdentifierOesGuest: + return CIMOSTypeNovellOES + + // VMware + case types.VirtualMachineGuestOsIdentifierVmkernelGuest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmkernel5Guest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmkernel6Guest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmkernel65Guest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmkernel7Guest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmkernel8Guest: + return CIMOSTypeVMwareESXi + case types.VirtualMachineGuestOsIdentifierVmwarePhoton64Guest: + return CIMOSTypeLinux64Bit + + // OS/2 + case types.VirtualMachineGuestOsIdentifierEComStationGuest: + return CIMOSTypeeComStation32bitx + case types.VirtualMachineGuestOsIdentifierEComStation2Guest: + return CIMOSTypeeComStation32bitx + case types.VirtualMachineGuestOsIdentifierOs2Guest: + return CIMOSTypeOS2 + + // Other + case types.VirtualMachineGuestOsIdentifierOtherGuest: + return CIMOSTypeOther + case types.VirtualMachineGuestOsIdentifierOtherGuest64: + return CIMOSTypeOther64Bit + case types.VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierAmazonlinux3_64Guest: + return CIMOSTypeLinux64Bit + case types.VirtualMachineGuestOsIdentifierCrxPod1Guest: + return CIMOSTypeOther + + // Default to Unknown if not found + default: + return CIMOSTypeUnknown + } +} diff --git a/vendor/github.com/vmware/govmomi/ovf/configspec.go b/vendor/github.com/vmware/govmomi/ovf/configspec.go index c832eab20f..20a5acb4a2 100644 --- a/vendor/github.com/vmware/govmomi/ovf/configspec.go +++ b/vendor/github.com/vmware/govmomi/ovf/configspec.go @@ -142,6 +142,10 @@ type ToConfigSpecOptions struct { // a VirtualHardware section that have an unknown ResourceType, i.e. a value // that falls outside the range of the enum CIMResourceType. Strict bool + + // VirtualSystemCollectionIndex specifies the index of the VirtualSystem in + // the OVF's VirtualSystemCollection to transform into the ConfigSpec. + VirtualSystemCollectionIndex *int } // ToConfigSpec calls ToConfigSpecWithOptions with an empty ToConfigSpecOptions @@ -165,7 +169,16 @@ func (e Envelope) ToConfigSpecWithOptions( vs := e.VirtualSystem if vs == nil { - return configSpec{}, errors.New("no VirtualSystem") + if i := opts.VirtualSystemCollectionIndex; i != nil { + if vsc := e.VirtualSystemCollection; vsc != nil { + if len(vsc.VirtualSystem) > *i { + vs = &vsc.VirtualSystem[*i] + } + } + } + if vs == nil { + return configSpec{}, errors.New("no VirtualSystem") + } } // Determine if there is a default configuration. @@ -215,8 +228,10 @@ func (e Envelope) toHardware( hw = vs.VirtualHardware[0] // Set the hardware version. - if vmx := hw.System.VirtualSystemType; vmx != nil { - dst.Version = *vmx + if hw.System != nil { + if vmx := hw.System.VirtualSystemType; vmx != nil { + dst.Version = *vmx + } } // Parse the config @@ -271,7 +286,7 @@ func (e Envelope) toHardware( } dst.NumCPUs = int32(*item.VirtualQuantity) if cps := item.CoresPerSocket; cps != nil { - dst.NumCoresPerSocket = cps.Value + dst.NumCoresPerSocket = &cps.Value } case Memory: // 4 @@ -1042,7 +1057,24 @@ func (e Envelope) toVAppConfig( // configuration. continue } - vapp.Property = append(vapp.Property, types.VAppPropertySpec{ + + // Get the default values for the current configuration from the + // list of default values that are per-config. + var value string + if p.Default != nil { + value = *p.Default + } + for _, v := range p.Values { + if v.Configuration == nil || *v.Configuration == configName { + value = v.Value + break + } + } + + if p.UserConfigurable == nil { + p.UserConfigurable = types.NewBool(false) + } + np := types.VAppPropertySpec{ ArrayUpdateSpec: types.ArrayUpdateSpec{ Operation: types.ArrayUpdateOperationAdd, }, @@ -1055,11 +1087,13 @@ func (e Envelope) toVAppConfig( Label: deref(p.Label), Type: p.Type, UserConfigurable: p.UserConfigurable, - DefaultValue: deref(p.Default), + DefaultValue: value, Value: "", Description: deref(p.Description), }, - }) + } + + vapp.Property = append(vapp.Property, np) index++ } } diff --git a/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go b/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go index 10fdc57d04..e6278c5da8 100644 --- a/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/simulator/container_virtual_machine.go @@ -8,7 +8,6 @@ import ( "archive/tar" "encoding/hex" "encoding/json" - "errors" "fmt" "io" "log" @@ -318,10 +317,9 @@ func (svm *simVM) start(ctx *Context) error { // Wait for the task to complete and see if there is an error. task.Wait() if task.Info.Error != nil { - msg := fmt.Sprintf("failed to destroy vm: err=%v", *task.Info.Error) - svm.vm.logPrintf(msg) - - return errors.New(msg) + err := fmt.Errorf("failed to destroy vm: %v", task.Info.Error) + svm.vm.logPrintf("%s", err.Error()) + return err } } diff --git a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go b/vendor/github.com/vmware/govmomi/simulator/environment_browser.go index a4ffb442dc..7cf13e29ce 100644 --- a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go +++ b/vendor/github.com/vmware/govmomi/simulator/environment_browser.go @@ -95,10 +95,10 @@ func (b *EnvironmentBrowser) initDescriptorReturnVal( cod := types.VirtualMachineConfigOptionDescriptor{ Key: hv.String(), Description: hv.String(), - DefaultConfigOption: types.NewBool(dco), - CreateSupported: types.NewBool(true), - RunSupported: types.NewBool(true), - UpgradeSupported: types.NewBool(true), + DefaultConfigOption: dco, + CreateSupported: true, + RunSupported: true, + UpgradeSupported: true, } for hostRef, hostVer := range maxHardwareVersionForHost { if hostVer >= hv { @@ -232,7 +232,7 @@ func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryCon } target := &types.ConfigTarget{ - SmcPresent: types.NewBool(false), + SmcPresent: false, } body.Res.Returnval = target diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go index 306d1ec91d..e127b1ee7a 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go @@ -788,13 +788,13 @@ var HostConfigInfo = types.HostConfigInfo{ IpRouteConfigSupported: true, DnsConfigSupported: true, DhcpOnVnicSupported: true, - IpV6Supported: types.NewBool(true), + IpV6Supported: true, }, DatastoreCapabilities: &types.HostDatastoreSystemCapabilities{ NfsMountCreationRequired: true, NfsMountCreationSupported: true, LocalDatastoreSupported: false, - VmfsExtentExpansionSupported: types.NewBool(true), + VmfsExtentExpansionSupported: true, }, OffloadCapabilities: &types.HostNetOffloadCapabilities{ CsumOffload: types.NewBool(true), diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go index bd294d98b0..fa175a4ed7 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/host_hardware_info.go @@ -187,7 +187,7 @@ var HostHardwareInfo = &types.HostHardwareInfo{ }, }, }, - SmcPresent: types.NewBool(false), + SmcPresent: false, PciDevice: []types.HostPciDevice{ { Id: "0000:00:00.0", diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go index a10e0e9ee0..c8734da889 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go @@ -1708,7 +1708,7 @@ var HostSystem = mo.HostSystem{ SslThumbprint: "", Product: &HostConfigInfo.Product, VmotionEnabled: false, - FaultToleranceEnabled: types.NewBool(true), + FaultToleranceEnabled: true, FeatureVersion: nil, AgentVmDatastore: (*types.ManagedObjectReference)(nil), AgentVmNetwork: (*types.ManagedObjectReference)(nil), diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go b/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go index 01ce2e81de..0e906ff1d0 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/virtual_device.go @@ -6,193 +6,156 @@ package esx import "github.com/vmware/govmomi/vim25/types" -// VirtualDevice is the default set of VirtualDevice types created for a VirtualMachine -// Capture method: -// -// govc vm.create foo -// govc object.collect -s -dump vm/foo config.hardware.device -var VirtualDevice = []types.BaseVirtualDevice{ - &types.VirtualIDEController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 200, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "IDE 0", - Summary: "IDE 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: (*int32)(nil), - }, - BusNumber: 0, - Device: nil, - }, - }, - &types.VirtualIDEController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 201, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "IDE 1", - Summary: "IDE 1", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: (*int32)(nil), - }, - BusNumber: 1, - Device: nil, - }, - }, - &types.VirtualPS2Controller{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 300, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "PS2 controller 0", - Summary: "PS2 controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: (*int32)(nil), +const ( + VirtualMachineDefaultDevicePCIControllerKey = int32(100) + VirtualMachineDefaultDevicePS2ControllerKey = int32(300) +) + +var VirtualMachineDefaultDevicePCIController = &types.VirtualPCIController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + Key: VirtualMachineDefaultDevicePCIControllerKey, + DeviceInfo: &types.Description{ + Label: "PCI controller 0", + Summary: "PCI controller 0", }, - BusNumber: 0, - Device: []int32{600, 700}, }, - }, - &types.VirtualPCIController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 100, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "PCI controller 0", - Summary: "PCI controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: (*int32)(nil), - }, - BusNumber: 0, - Device: []int32{500, 12000}, + Device: []int32{ + VirtualMachineDefaultDeviceVideoCard.Key, + VirtualMachineDefaultDeviceVMCIDevice.Key, }, }, - &types.VirtualSIOController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 400, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "SIO controller 0", - Summary: "SIO controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: (*int32)(nil), +} + +var VirtualMachineDefaultDeviceIDEControllerBus0 = &types.VirtualIDEController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + Key: 200, + DeviceInfo: &types.Description{ + Label: "IDE 0", + Summary: "IDE 0", }, - BusNumber: 0, - Device: nil, }, + BusNumber: 0, }, - &types.VirtualKeyboard{ +} + +var VirtualMachineDefaultDeviceIDEControllerBus1 = &types.VirtualIDEController{ + VirtualController: types.VirtualController{ VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 600, + Key: 201, DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Keyboard ", - Summary: "Keyboard", + Label: "IDE 1", + Summary: "IDE 1", }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 300, - UnitNumber: types.NewInt32(0), }, + BusNumber: 1, }, - &types.VirtualPointingDevice{ +} + +var VirtualMachineDefaultDevicePS2Controller = &types.VirtualPS2Controller{ + VirtualController: types.VirtualController{ VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 700, + Key: VirtualMachineDefaultDevicePS2ControllerKey, DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Pointing device", - Summary: "Pointing device; Device", - }, - Backing: &types.VirtualPointingDeviceDeviceBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - DeviceName: "", - UseAutoDetect: types.NewBool(false), - }, - HostPointingDevice: "autodetect", + Label: "PS2 controller 0", + Summary: "PS2 controller 0", }, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 300, - UnitNumber: types.NewInt32(1), + }, + Device: []int32{ + VirtualMachineDefaultDeviceVirtualKeyboard.Key, + VirtualMachineDefaultDeviceVirtualPointingDevice.Key, }, }, - &types.VirtualMachineVideoCard{ +} + +var VirtualMachineDefaultDeviceSIOController = &types.VirtualSIOController{ + VirtualController: types.VirtualController{ VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 500, + Key: 400, DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Video card ", - Summary: "Video card", + Label: "SIO controller 0", + Summary: "SIO controller 0", }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 100, - UnitNumber: types.NewInt32(0), }, - VideoRamSizeInKB: 4096, - NumDisplays: 1, - UseAutoDetect: types.NewBool(false), - Enable3DSupport: types.NewBool(false), - Use3dRenderer: "automatic", - GraphicsMemorySizeInKB: 262144, }, - &types.VirtualMachineVMCIDevice{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 12000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "VMCI device", - Summary: "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface", +} +var VirtualMachineDefaultDeviceVirtualKeyboard = &types.VirtualKeyboard{ + VirtualDevice: types.VirtualDevice{ + Key: 600, + DeviceInfo: &types.Description{ + Label: "Keyboard ", + Summary: "Keyboard", + }, + ControllerKey: VirtualMachineDefaultDevicePS2ControllerKey, + UnitNumber: types.NewInt32(0), + }, +} +var VirtualMachineDefaultDeviceVirtualPointingDevice = &types.VirtualPointingDevice{ + VirtualDevice: types.VirtualDevice{ + Key: 700, + DeviceInfo: &types.Description{ + Label: "Pointing device", + Summary: "Pointing device; Device", + }, + Backing: &types.VirtualPointingDeviceDeviceBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + UseAutoDetect: types.NewBool(false), }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 100, - UnitNumber: types.NewInt32(17), + HostPointingDevice: "autodetect", + }, + ControllerKey: VirtualMachineDefaultDevicePS2ControllerKey, + UnitNumber: types.NewInt32(1), + }, +} +var VirtualMachineDefaultDeviceVideoCard = &types.VirtualMachineVideoCard{ + VirtualDevice: types.VirtualDevice{ + Key: 500, + DeviceInfo: &types.Description{ + Label: "Video card ", + Summary: "Video card", + }, + ControllerKey: VirtualMachineDefaultDevicePCIControllerKey, + UnitNumber: types.NewInt32(0), + }, + VideoRamSizeInKB: 4096, + NumDisplays: 1, + UseAutoDetect: types.NewBool(false), + Enable3DSupport: types.NewBool(false), + Use3dRenderer: "automatic", + GraphicsMemorySizeInKB: 262144, +} + +var VirtualMachineDefaultDeviceVMCIDevice = &types.VirtualMachineVMCIDevice{ + VirtualDevice: types.VirtualDevice{ + Key: 12000, + DeviceInfo: &types.Description{ + Label: "VMCI device", + Summary: "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface", }, - Id: -1, - AllowUnrestrictedCommunication: types.NewBool(false), - FilterEnable: types.NewBool(true), - FilterInfo: (*types.VirtualMachineVMCIDeviceFilterInfo)(nil), + ControllerKey: VirtualMachineDefaultDevicePCIControllerKey, + UnitNumber: types.NewInt32(17), }, + Id: -1, + AllowUnrestrictedCommunication: types.NewBool(false), + FilterEnable: types.NewBool(true), +} + +// VirtualDevice is the default set of VirtualDevice types created for a VirtualMachine +// Capture method: +// +// govc vm.create foo +// govc object.collect -s -dump vm/foo config.hardware.device +var VirtualDevice = []types.BaseVirtualDevice{ + VirtualMachineDefaultDevicePCIController, + VirtualMachineDefaultDeviceIDEControllerBus0, + VirtualMachineDefaultDeviceIDEControllerBus1, + VirtualMachineDefaultDevicePS2Controller, + VirtualMachineDefaultDeviceSIOController, + VirtualMachineDefaultDeviceVirtualKeyboard, + VirtualMachineDefaultDeviceVirtualPointingDevice, + VirtualMachineDefaultDeviceVideoCard, + VirtualMachineDefaultDeviceVMCIDevice, } // EthernetCard template for types.VirtualEthernetCard diff --git a/vendor/github.com/vmware/govmomi/simulator/fault_injection.go b/vendor/github.com/vmware/govmomi/simulator/fault_injection.go index 10b1a59d6e..97b96266f5 100644 --- a/vendor/github.com/vmware/govmomi/simulator/fault_injection.go +++ b/vendor/github.com/vmware/govmomi/simulator/fault_injection.go @@ -7,13 +7,95 @@ package simulator import ( "fmt" "math/rand" + "strings" "sync" "time" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) +// FaultFilterCallback evaluates whether a managed object is a "match", allowing arbitrarily complex +// filters by implementing this function directly. +// For convenience, use FaultFilterAll() or FaultFilterAny() to create filters from string expressions. +type FaultFilterCallback func(obj mo.Reference) bool + +// FaultFilterAll (AND) takes a set of strings expressing propertyPath:value pairs using the property.Match format. +// Only equality matches are currently supported: "property.path == value" +// Examples: +// - FaultFilterAll("config.name == DC0_C0_RP0_VM0") +// - FaultFilterAll("config.name == DC0_C0*", "runtime.powerState == poweredOn") +// - FaultFilterAll("config.name == *") // match all objects where the property exists +// +// Panics on code-level usage errors: +// - Empty filter strings +// - Invalid filter format (missing " == " separator) +// - Empty property path +// - Multiple filters targeting the same property path ( combine them into a single pattern) +func FaultFilterAll(filterStrs ...string) FaultFilterCallback { + match := parsePropertyFilters(filterStrs) + + propertyPaths := make([]string, 0, len(match)) + for path := range match { + propertyPaths = append(propertyPaths, path) + } + + // Return a closure that captures the match and paths + return func(obj mo.Reference) bool { + if obj == nil { + return false + } + + props := getProperties(obj, propertyPaths) + // AND match + return match.List(props) + } +} + +// FaultFilterAny (OR) takes a set of strings expressing propertyPath:value pairs using the property.Match format. +// See FaultFilterAll for details. +func FaultFilterAny(filterStrs ...string) FaultFilterCallback { + // For exclusion matches, we need to handle each filter separately + // since multiple matches can target the same property path with different values + matches := make([]property.Match, 0, len(filterStrs)) + allPaths := make(map[string]bool) + for _, filterStr := range filterStrs { + match := parsePropertyFilters([]string{filterStr}) + if len(match) > 0 { + matches = append(matches, match) + + for path := range match { + // deduplicate paths for collection + allPaths[path] = true + } + } + } + + paths := make([]string, 0, len(allPaths)) + for path := range allPaths { + paths = append(paths, path) + } + + // Return a closure that captures the matches and paths + return func(obj mo.Reference) bool { + if obj == nil { + return false + } + + props := getProperties(obj, paths) + + // OR match + for _, match := range matches { + if match.AnyList(props) { + return true + } + } + return false + } +} + // FaultInjectionRule defines a rule for injecting faults into method responses. type FaultInjectionRule struct { // MethodName is the SOAP method name to inject faults into @@ -30,6 +112,31 @@ type FaultInjectionRule struct { // Use "*" to match all object names ObjectName string + // InclusionPropertyFilter is a callback function that evaluates whether the managed object matches the filter. + // ObjectName above is a convenience as it's such a common filter, but can be expressed here. + // Use FaultFilterAll (AND) or FaultFilterAny (OR) helper functions to create from string expressions for common cases. + // Examples: + // - InclusionPropertyFilter: FaultFilterAll("config.name == DC0_C0_RP0_VM0") + // - InclusionPropertyFilter: FaultFilterAll("config.name == DC0_C0*", "runtime.powerState == poweredOn") + // - InclusionPropertyFilter: FaultFilterAll("config.name == *") // match all objects where the property exists + // - InclusionPropertyFilter: func(obj mo.Reference) bool { ... } // custom filter logic + // Note: To express "property != value", use an exclusion filter: FaultFilterAny("property == value") + // The order of evaluation is: + // 1. ObjectName + // 2. InclusionPropertyFilter (all must match) + // 3. ExclusionPropertyFilter (none must match) + InclusionPropertyFilter FaultFilterCallback + + // ExclusionPropertyFilter is a callback function that evaluates whether the managed object should be excluded. + // This is evaluated after the name and inclusion filters. + // If the function returns true, the object is excluded. + // Use FaultFilterAll (AND) or FaultFilterAny (OR) helper functions to create from string expressions for common cases. + // Examples: + // - ExclusionPropertyFilter: FaultFilterAny("config.name == test-vm") to exclude objects with name "test-vm" + // - ExclusionPropertyFilter: FaultFilterAny("config.name == ", "runtime.powerState == ") to exclude objects where Name or PowerState are empty + // - ExclusionPropertyFilter: func(obj mo.Reference) bool { ... } // custom exclusion logic + ExclusionPropertyFilter FaultFilterCallback + // Probability is the probability (0.0 to 1.0) that a fault will be // injected. Probability float64 @@ -51,12 +158,16 @@ type FaultInjectionRule struct { // (0 = unlimited) MaxCount int + // SkipCount is the number of times to skip this rule before it is triggered + SkipCount int + // Enabled controls whether this rule is active Enabled bool // Internal fields - count int64 - rng *rand.Rand + count int64 + skipCount int64 + rng *rand.Rand } // FaultType represents the type of fault to inject @@ -148,7 +259,7 @@ func (f *FaultInjector) GetRules() []*FaultInjectionRule { } // ShouldInjectFault determines if a fault should be injected for the given method call -func (f *FaultInjector) ShouldInjectFault(method *Method, objectName string) *FaultInjectionRule { +func (f *FaultInjector) ShouldInjectFault(method *Method, handler mo.Reference) *FaultInjectionRule { f.mu.RLock() defer f.mu.RUnlock() @@ -172,9 +283,30 @@ func (f *FaultInjector) ShouldInjectFault(method *Method, objectName string) *Fa continue } - // Check object name match - if rule.ObjectName != "*" && rule.ObjectName != objectName { - continue + // Check object name match (order 1) + if rule.ObjectName != "*" { + var objectName string + if entity, ok := handler.(mo.Entity); ok { + objectName = entityName(entity) + } + + if rule.ObjectName != objectName { + continue + } + } + + // Check inclusion property filter (order 2) + if rule.InclusionPropertyFilter != nil { + if !rule.InclusionPropertyFilter(handler) { + continue + } + } + + // Check exclusion property filter (order 3) + if rule.ExclusionPropertyFilter != nil { + if rule.ExclusionPropertyFilter(handler) { + continue + } } // Check probability @@ -182,6 +314,12 @@ func (f *FaultInjector) ShouldInjectFault(method *Method, objectName string) *Fa continue } + // At this point, the rule matches. Check if we need to skip this match + if rule.SkipCount > 0 && rule.skipCount < int64(rule.SkipCount) { + rule.skipCount++ + continue + } + // This rule matches, increment count and return it rule.count++ return rule @@ -320,5 +458,73 @@ func (f *FaultInjector) ResetStats() { for _, rule := range f.rules { rule.count = 0 + rule.skipCount = 0 } } + +// parsePropertyFilters parses an array of string filter expressions and consolidates them +// into a single property.Match map. Only equality matches are supported: "property.path == value" +// Property paths should be in camelCase format (e.g., "config.name", "runtime.powerState"). +// Panics on code-level usage errors: +// - Empty filter strings +// - Invalid filter format (missing " == " separator) +// - Empty property path or expected value +// - Multiple filters targeting the same property path (user should combine them into a single pattern) +func parsePropertyFilters(filterStrs []string) property.Match { + match := make(property.Match) + + for _, filterStr := range filterStrs { + filterStr = strings.TrimSpace(filterStr) + if filterStr == "" { + panic("empty filter string in property filter - remove empty entries from filter array") + } + + parts := strings.SplitN(filterStr, " == ", 2) + if len(parts) != 2 { + panic(fmt.Sprintf("invalid property filter format %q - expected format: \"property.path == value\"", filterStr)) + } + + propertyPath := strings.TrimSpace(parts[0]) + expectedValue := strings.TrimSpace(parts[1]) + if propertyPath == "" { + panic(fmt.Sprintf("empty property path in filter %q - expected format: \"property.path == value\"", filterStr)) + } + // nil expected values are ok - that's how we expect to match empty properties + + // Panic if this property path already exists (multiple filters for same property) + if _, exists := match[propertyPath]; exists { + panic(fmt.Sprintf("multiple inclusion filters specified for property %q - combine them into a single pattern", propertyPath)) + } + + match[propertyPath] = expectedValue + } + + return match +} + +// getProperties collects the specified properties from a managed object. +func getProperties(obj mo.Reference, paths []string) []types.DynamicProperty { + if obj == nil || len(paths) == 0 { + return nil + } + + rval := getManagedObject(obj) + props := make([]types.DynamicProperty, 0, len(paths)) + + for _, propPath := range paths { + propValue, err := fieldValue(rval, propPath) + var val types.AnyType + if err == nil { + val = propValue + } + // Note: If property doesn't exist or is empty, val will be nil. + // property.Match.Property() will return false for nil values. + + props = append(props, types.DynamicProperty{ + Name: propPath, + Val: val, + }) + } + + return props +} diff --git a/vendor/github.com/vmware/govmomi/simulator/folder.go b/vendor/github.com/vmware/govmomi/simulator/folder.go index 25f7e534b7..8a59b994dc 100644 --- a/vendor/github.com/vmware/govmomi/simulator/folder.go +++ b/vendor/github.com/vmware/govmomi/simulator/folder.go @@ -1026,7 +1026,7 @@ func fillConfigSpecWithDatastore(ctx *Context, inputConfigSpec, configSpec *type func generateInitialPlacementAction(ctx *Context, vmSpec *types.PlaceVmsXClusterSpecVmPlacementSpec, pool *ResourcePool, cluster *ClusterComputeResource, hostRequired, datastoreRequired bool) types.BaseClusterAction { - placementAction := &types.ClusterClusterInitialPlacementActionEx{ + placementAction := &types.ClusterClusterInitialPlacementAction{ Pool: pool.Self, } diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go index 06060def06..6cd35eb0f4 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go @@ -55,7 +55,7 @@ func (s *searchDatastore) addFile(fname string, file os.FileInfo, res *types.Hos info.Modification = &mtime } - if isTrue(details.FileOwner) { + if details.FileOwner { // Assume for now this process created all files in the datastore user := os.Getenv("USER") diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go index 1ff3909b21..ea789af0b4 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go @@ -27,8 +27,8 @@ var defaultDatastoreCapability = types.DatastoreCapability{ DirectoryHierarchySupported: true, RawDiskMappingsSupported: false, PerFileThinProvisioningSupported: true, - StorageIORMSupported: types.NewBool(false), - NativeSnapshotSupported: types.NewBool(false), + StorageIORMSupported: false, + NativeSnapshotSupported: false, SeSparseSupported: types.NewBool(false), TopLevelDirectoryCreateSupported: types.NewBool(true), } diff --git a/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go b/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go index fce1c4eb7a..67bf1884b8 100644 --- a/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go @@ -113,7 +113,7 @@ func (m *OvfManager) CreateImportSpec(ctx *Context, req *types.CreateImportSpec) VmPathName: path.String(), }, NumCPUs: 1, - NumCoresPerSocket: 1, + NumCoresPerSocket: types.NewInt32(1), MemoryMB: 32, VAppConfig: vapp, }, diff --git a/vendor/github.com/vmware/govmomi/simulator/registry.go b/vendor/github.com/vmware/govmomi/simulator/registry.go index ae4d2b4655..0ca01124a1 100644 --- a/vendor/github.com/vmware/govmomi/simulator/registry.go +++ b/vendor/github.com/vmware/govmomi/simulator/registry.go @@ -77,10 +77,12 @@ type Registry struct { // tagManager is an interface to simplify internal interaction with the vapi tag manager simulator. type tagManager interface { - AttachedObjects(types.VslmTagEntry) ([]types.ManagedObjectReference, types.BaseMethodFault) - AttachedTags(id types.ManagedObjectReference) ([]types.VslmTagEntry, types.BaseMethodFault) - AttachTag(types.ManagedObjectReference, types.VslmTagEntry) types.BaseMethodFault - DetachTag(types.ManagedObjectReference, types.VslmTagEntry) types.BaseMethodFault + AttachedObjects(string) ([]types.ManagedObjectReference, types.BaseMethodFault) + AttachedTags(id types.ManagedObjectReference) ([]string, types.BaseMethodFault) + AttachTag(types.ManagedObjectReference, string) types.BaseMethodFault + DetachTag(types.ManagedObjectReference, string) types.BaseMethodFault + GetTagByCategoryAndName(string, string) (string, types.BaseMethodFault) + GetTagCategoryAndName(string) (string, string, types.BaseMethodFault) } // NewRegistry creates a new instances of Registry diff --git a/vendor/github.com/vmware/govmomi/simulator/session_manager.go b/vendor/github.com/vmware/govmomi/simulator/session_manager.go index 0a66729277..ead9ff4951 100644 --- a/vendor/github.com/vmware/govmomi/simulator/session_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/session_manager.go @@ -67,7 +67,7 @@ func createSession(ctx *Context, name string, locale string) types.UserSession { LastActiveTime: now, Locale: locale, MessageLocale: locale, - ExtensionSession: types.NewBool(false), + ExtensionSession: false, }, Registry: NewRegistry(), Map: ctx.Map, diff --git a/vendor/github.com/vmware/govmomi/simulator/simulator.go b/vendor/github.com/vmware/govmomi/simulator/simulator.go index f9056b3382..5cef779234 100644 --- a/vendor/github.com/vmware/govmomi/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/simulator/simulator.go @@ -250,13 +250,8 @@ func (s *Service) call(ctx *Context, method *Method) soap.HasFault { } // We have a valid call. Check for fault injection first - var objectName string - if entity, ok := handler.(mo.Entity); ok { - objectName = entityName(entity) - } - if s.faultInjector != nil { - if rule := s.faultInjector.ShouldInjectFault(method, objectName); rule != nil { + if rule := s.faultInjector.ShouldInjectFault(method, handler); rule != nil { return s.faultInjector.CreateFault(rule, method) } } diff --git a/vendor/github.com/vmware/govmomi/simulator/snapshot.go b/vendor/github.com/vmware/govmomi/simulator/snapshot.go index 2ffe51665c..12bfe9083a 100644 --- a/vendor/github.com/vmware/govmomi/simulator/snapshot.go +++ b/vendor/github.com/vmware/govmomi/simulator/snapshot.go @@ -218,3 +218,9 @@ func (v *VirtualMachineSnapshot) ExportSnapshot(ctx *Context, req *types.ExportS }, } } + +func copyConfigFromVmConfig(src *types.VirtualMachineConfigInfo) types.VirtualMachineConfigInfo { + var dest types.VirtualMachineConfigInfo + deepCopy(*src, &dest) + return dest +} diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go b/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go index 1506c3c762..2fdb8e45a2 100644 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go @@ -11,6 +11,7 @@ import ( "path/filepath" "strings" + "github.com/vmware/govmomi/crypto" "github.com/vmware/govmomi/internal" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -38,12 +39,16 @@ func vdmNames(name string) []string { } } -func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOperation, req *types.CreateVirtualDisk_Task) types.BaseMethodFault { +func vdmCreateVirtualDisk( + ctx *Context, + op types.VirtualDeviceConfigSpecFileOperation, + req *types.CreateVirtualDisk_Task) (*vmdk.Descriptor, types.BaseMethodFault) { + fm := ctx.Map.FileManager() file, fault := fm.resolve(ctx, req.Datacenter, req.Name) if fault != nil { - return fault + return nil, fault } shouldReplace := op == types.VirtualDeviceConfigSpecFileOperationReplace @@ -52,13 +57,13 @@ func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOper _, err := os.Stat(file) if err == nil { if shouldExist { - return nil + return nil, nil // TODO } if !shouldReplace { - return fm.fault(file, nil, new(types.FileAlreadyExists)) + return nil, fm.fault(file, nil, new(types.FileAlreadyExists)) } } else if shouldExist { - return fm.fault(file, nil, new(types.FileNotFound)) + return nil, fm.fault(file, nil, new(types.FileNotFound)) } backing := VirtualDiskBackingFileName(file) @@ -69,7 +74,7 @@ func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOper f, err := os.Create(file) if err != nil { - return fm.fault(file, err, new(types.CannotCreateFile)) + return nil, fm.fault(file, err, new(types.CannotCreateFile)) } defer f.Close() @@ -77,7 +82,7 @@ func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOper if req.Spec != nil { spec, ok := req.Spec.(types.BaseFileBackedVirtualDiskSpec) if !ok { - return fm.fault(file, nil, new(types.FileFault)) + return nil, fm.fault(file, nil, new(types.FileFault)) } fileSpec := spec.GetFileBackedVirtualDiskSpec() @@ -85,17 +90,70 @@ func vdmCreateVirtualDisk(ctx *Context, op types.VirtualDeviceConfigSpecFileOper } desc := vmdk.NewDescriptor(extent) + + if req != nil && req.Spec != nil { + if s, ok := req.Spec.(*types.FileBackedVirtualDiskSpec); ok { + var ( + providerID string + keyID string + ) + + switch c := s.Crypto.(type) { + case *types.CryptoSpecEncrypt: + keyID = c.CryptoKeyId.KeyId + if c.CryptoKeyId.ProviderId != nil { + providerID = c.CryptoKeyId.ProviderId.Id + } + + case *types.CryptoSpecDeepRecrypt: + keyID = c.NewKeyId.KeyId + if c.NewKeyId.ProviderId != nil { + providerID = c.NewKeyId.ProviderId.Id + } + case *types.CryptoSpecShallowRecrypt: + keyID = c.NewKeyId.KeyId + if c.NewKeyId.ProviderId != nil { + providerID = c.NewKeyId.ProviderId.Id + } + } + + if providerID != "" || keyID != "" { + desc.EncryptionKeys = &crypto.KeyLocator{ + Type: crypto.KeyLocatorTypeList, + List: []*crypto.KeyLocator{ + { + Type: crypto.KeyLocatorTypePair, + Pair: &crypto.KeyLocatorPair{ + CryptoMAC: "HMAC-SHA-256", + LockedData: []byte("Cg=="), + Locker: &crypto.KeyLocator{ + Type: crypto.KeyLocatorTypeFQID, + Indirect: &crypto.KeyLocatorIndirect{ + Type: crypto.KeyLocatorTypeFQID, + FQID: crypto.KeyLocatorFQIDParams{ + KeyServerID: providerID, + KeyID: keyID, + }, + }, + }, + }, + }, + }, + } + } + } + } if err := desc.Write(f); err != nil { - return fm.fault(file, err, new(types.FileFault)) + return nil, fm.fault(file, err, new(types.FileFault)) } b, err := os.Create(backing) if err != nil { - return fm.fault(backing, err, new(types.CannotCreateFile)) + return nil, fm.fault(backing, err, new(types.CannotCreateFile)) } _ = b.Close() - return nil + return desc, nil } func vdmExtendVirtualDisk(ctx *Context, req *types.ExtendVirtualDisk_Task) types.BaseMethodFault { @@ -118,7 +176,7 @@ func vdmExtendVirtualDisk(ctx *Context, req *types.ExtendVirtualDisk_Task) types func (m *VirtualDiskManager) CreateVirtualDiskTask(ctx *Context, req *types.CreateVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "createVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - if err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, req); err != nil { + if _, err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, req); err != nil { return "", err } return req.Name, nil @@ -203,25 +261,81 @@ func (m *VirtualDiskManager) MoveVirtualDiskTask(ctx *Context, req *types.MoveVi func (m *VirtualDiskManager) CopyVirtualDiskTask(ctx *Context, req *types.CopyVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "copyVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - if req.DestSpec != nil { - // TODO: apply to destination vmdk.Descriptor - } fm := ctx.Map.FileManager() dest := vdmNames(req.DestName) for i, name := range vdmNames(req.SourceName) { - err := fm.copyDatastoreFile(ctx, &types.CopyDatastoreFile_Task{ + + if fault := fm.copyDatastoreFile(ctx, &types.CopyDatastoreFile_Task{ SourceName: name, SourceDatacenter: req.SourceDatacenter, DestinationName: dest[i], DestinationDatacenter: req.DestDatacenter, Force: req.Force, - }) + }); fault != nil { + return nil, fault + } - if err != nil { - return nil, err + if req.DestSpec != nil { + desc, descPath, fault := fm.DiskDescriptor(ctx, req.DestDatacenter, dest[i]) + if fault != nil { + return nil, fault + } + if s, ok := req.DestSpec.(*types.FileBackedVirtualDiskSpec); ok { + + var ( + keyID string + providerID string + ) + switch c := s.Crypto.(type) { + case *types.CryptoSpecEncrypt: + keyID = c.CryptoKeyId.KeyId + if c.CryptoKeyId.ProviderId != nil { + providerID = c.CryptoKeyId.ProviderId.Id + } + case *types.CryptoSpecDeepRecrypt: + keyID = c.NewKeyId.KeyId + if c.NewKeyId.ProviderId != nil { + providerID = c.NewKeyId.ProviderId.Id + } + case *types.CryptoSpecShallowRecrypt: + keyID = c.NewKeyId.KeyId + if c.NewKeyId.ProviderId != nil { + providerID = c.NewKeyId.ProviderId.Id + } + } + + if providerID != "" || keyID != "" { + desc.EncryptionKeys = &crypto.KeyLocator{ + Type: crypto.KeyLocatorTypeList, + List: []*crypto.KeyLocator{ + { + Type: crypto.KeyLocatorTypePair, + Pair: &crypto.KeyLocatorPair{ + CryptoMAC: "HMAC-SHA-256", + LockedData: []byte("Cg=="), + Locker: &crypto.KeyLocator{ + Type: crypto.KeyLocatorTypeFQID, + Indirect: &crypto.KeyLocatorIndirect{ + Type: crypto.KeyLocatorTypeFQID, + FQID: crypto.KeyLocatorFQIDParams{ + KeyServerID: providerID, + KeyID: keyID, + }, + }, + }, + }, + }, + }, + } + } + } + + if fault := fm.SaveDiskDescriptor(ctx, desc, descPath); fault != nil { + return nil, fault + } } } diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go b/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go index 0637e1d06d..d99199c20f 100644 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go @@ -30,6 +30,7 @@ import ( "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vmdk" ) type VirtualMachine struct { @@ -127,7 +128,7 @@ func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec * defaults := types.VirtualMachineConfigSpec{ NumCPUs: 1, - NumCoresPerSocket: 1, + NumCoresPerSocket: types.NewInt32(1), MemoryMB: 32, Uuid: vm.uid.String(), InstanceUuid: newUUID(strings.ToUpper(spec.Files.VmPathName)), @@ -141,8 +142,8 @@ func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec * }, } - // Add the default devices - defaults.DeviceChange, _ = object.VirtualDeviceList(esx.VirtualDevice).ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + // Add the default devices. + vm.addDefaultDevices(&defaults, spec) err := vm.configure(ctx, &defaults) if err != nil { @@ -153,7 +154,7 @@ func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec * vm.Runtime.ConnectionState = types.VirtualMachineConnectionStateConnected vm.Summary.Runtime = vm.Runtime - vm.Capability.ChangeTrackingSupported = types.NewBool(changeTrackingSupported(spec)) + vm.Capability.ChangeTrackingSupported = changeTrackingSupported(spec) vm.Summary.QuickStats.GuestHeartbeatStatus = types.ManagedEntityStatusGray vm.Summary.OverallStatus = types.ManagedEntityStatusGreen @@ -167,6 +168,98 @@ func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec * return vm, nil } +func (o VirtualMachine) addDefaultDevices( + dst, src *types.VirtualMachineConfigSpec) { + + var ( + oldControllerKeysToNew = map[int32]int32{} + existingDefaultDeviceMap = map[int32]struct{}{} + ) + + for i := range src.DeviceChange { + var ( + dc = src.DeviceChange[i] + vd = dc.GetVirtualDeviceConfigSpec() + de = vd.Device.GetVirtualDevice() + oldKey = de.Key + ) + + fn := func(bvd types.BaseVirtualDevice) { + d := bvd.GetVirtualDevice() + vd.Device = bvd + existingDefaultDeviceMap[d.Key] = struct{}{} + dst.DeviceChange = append(dst.DeviceChange, dc) + if _, ok := bvd.(types.BaseVirtualController); ok { + oldControllerKeysToNew[oldKey] = d.Key + } + } + + switch td := vd.Device.(type) { + case *types.VirtualIDEController: + switch td.BusNumber { + case 0: + fn(esx.VirtualMachineDefaultDeviceIDEControllerBus0) + case 1: + fn(esx.VirtualMachineDefaultDeviceIDEControllerBus1) + } + case *types.VirtualPS2Controller: + fn(esx.VirtualMachineDefaultDevicePS2Controller) + case *types.VirtualPCIController: + fn(esx.VirtualMachineDefaultDevicePCIController) + case *types.VirtualSIOController: + fn(esx.VirtualMachineDefaultDeviceSIOController) + case *types.VirtualKeyboard: + fn(esx.VirtualMachineDefaultDeviceVirtualKeyboard) + case *types.VirtualPointingDevice: + fn(esx.VirtualMachineDefaultDeviceVirtualPointingDevice) + case *types.VirtualMachineVideoCard: + fn(esx.VirtualMachineDefaultDeviceVideoCard) + case *types.VirtualMachineVMCIDevice: + fn(esx.VirtualMachineDefaultDeviceVMCIDevice) + } + } + + // Add any of the missing default devices. + for i := range esx.VirtualDevice { + vd := esx.VirtualDevice[i].GetVirtualDevice() + if _, ok := existingDefaultDeviceMap[vd.Key]; !ok { + dst.DeviceChange = append( + dst.DeviceChange, + &types.VirtualDeviceConfigSpec{ + Operation: types.VirtualDeviceConfigSpecOperationAdd, + Device: esx.VirtualDevice[i], + }) + } + } + + // Remove the default devices from the source config spec so they are not + // added twice. + src.DeviceChange = slices.DeleteFunc( + src.DeviceChange, + func(bdc types.BaseVirtualDeviceConfigSpec) bool { + var ( + vd = bdc.GetVirtualDeviceConfigSpec() + de = vd.Device.GetVirtualDevice() + ) + _, ok := existingDefaultDeviceMap[de.Key] + return ok + }) + + // Update the source config spec so any children point to any updated + // controller keys. + for i := range src.DeviceChange { + var ( + dc = src.DeviceChange[i] + vd = dc.GetVirtualDeviceConfigSpec() + de = vd.Device.GetVirtualDevice() + ck = de.ControllerKey + ) + if nk, ok := oldControllerKeysToNew[ck]; ok { + de.ControllerKey = nk + } + } +} + func (o *VirtualMachine) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { return RenameTask(ctx, o, r) } @@ -324,7 +417,7 @@ func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { vm.Summary.Config.NumCpu = vm.Config.Hardware.NumCPU } - if spec.NumCoresPerSocket != 0 { + if spec.NumCoresPerSocket != nil { vm.Config.Hardware.NumCoresPerSocket = spec.NumCoresPerSocket } @@ -598,6 +691,10 @@ func (vm *VirtualMachine) configure(ctx *Context, spec *types.VirtualMachineConf } } + if err := vm.updateTagSpec(ctx, spec.TagSpecs); err != nil { + return err + } + return vm.configureDevices(ctx, spec) } @@ -762,13 +859,17 @@ func (vm *VirtualMachine) updateDiskLayouts(ctx *Context) types.BaseMethodFault disks := object.VirtualDeviceList(vm.Config.Hardware.Device).SelectByType((*types.VirtualDisk)(nil)) for _, disk := range disks { disk := disk.(*types.VirtualDisk) - diskBacking := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + diskBacking, ok := disk.Backing.(types.BaseVirtualDeviceFileBackingInfo) + if !ok { + continue + } diskLayout := &types.VirtualMachineFileLayoutDiskLayout{Key: disk.Key} diskLayoutEx := &types.VirtualMachineFileLayoutExDiskLayout{Key: disk.Key} // Iterate through disk and its parents - for { + for diskBacking != nil { + dFileName := diskBacking.GetVirtualDeviceFileBackingInfo().FileName var fileKeys []int32 @@ -799,10 +900,39 @@ func (vm *VirtualMachine) updateDiskLayouts(ctx *Context) types.BaseMethodFault FileKey: fileKeys, }) - if parent := diskBacking.Parent; parent != nil { - diskBacking = parent - } else { - break + switch tBack := diskBacking.(type) { + case *types.VirtualDiskFlatVer1BackingInfo: + if tBack.Parent == nil { + diskBacking = nil + } else { + diskBacking = tBack.Parent + } + case *types.VirtualDiskFlatVer2BackingInfo: + if tBack.Parent == nil { + diskBacking = nil + } else { + diskBacking = tBack.Parent + } + case *types.VirtualDiskSeSparseBackingInfo: + if tBack.Parent == nil { + diskBacking = nil + } else { + diskBacking = tBack.Parent + } + case *types.VirtualDiskSparseVer1BackingInfo: + if tBack.Parent == nil { + diskBacking = nil + } else { + diskBacking = tBack.Parent + } + case *types.VirtualDiskSparseVer2BackingInfo: + if tBack.Parent == nil { + diskBacking = nil + } else { + diskBacking = tBack.Parent + } + default: + diskBacking = nil } } @@ -1403,6 +1533,45 @@ func (vm *VirtualMachine) configureDevice( } } + getCryptoKeyID := func(desc *vmdk.Descriptor) *types.CryptoKeyId { + if desc == nil { + return nil + } + if ek := desc.EncryptionKeys; ek != nil { + if l := ek.List; len(l) > 0 { + if p := l[0].Pair; p != nil { + if l := p.Locker; l != nil { + if i := l.Indirect; i != nil { + var ( + keyID = i.FQID.KeyID + providerID = i.FQID.KeyServerID + ) + + if keyID == "" && providerID == "" { + return nil + } + + cki := &types.CryptoKeyId{ + KeyId: i.FQID.KeyID, + } + + if providerID != "" { + cki.ProviderId = &types.KeyProviderId{ + Id: providerID, + } + } + + return cki + } + } + } + } + } + return nil + } + + var setCryptoKeyID func(desc *vmdk.Descriptor) + switch b := d.Backing.(type) { case *types.VirtualDiskSparseVer2BackingInfo: // Sparse disk creation not supported in ESX @@ -1412,21 +1581,72 @@ func (vm *VirtualMachine) configureDevice( }, } case types.BaseVirtualDeviceFileBackingInfo: - parent := "" + var ( + parent string + crypto types.BaseCryptoSpec + ) switch backing := d.Backing.(type) { case *types.VirtualDiskFlatVer2BackingInfo: if backing.Parent != nil { parent = backing.Parent.FileName } + if spec.Backing != nil { + crypto = spec.Backing.Crypto + switch tCrypto := crypto.(type) { + case *types.CryptoSpecEncrypt: + backing.KeyId = &tCrypto.CryptoKeyId + case *types.CryptoSpecShallowRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDeepRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDecrypt: + backing.KeyId = nil + } + } + setCryptoKeyID = func(desc *vmdk.Descriptor) { + backing.KeyId = getCryptoKeyID(desc) + } case *types.VirtualDiskSeSparseBackingInfo: if backing.Parent != nil { parent = backing.Parent.FileName } + if spec.Backing != nil { + crypto = spec.Backing.Crypto + switch tCrypto := crypto.(type) { + case *types.CryptoSpecEncrypt: + backing.KeyId = &tCrypto.CryptoKeyId + case *types.CryptoSpecShallowRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDeepRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDecrypt: + backing.KeyId = nil + } + } + setCryptoKeyID = func(desc *vmdk.Descriptor) { + backing.KeyId = getCryptoKeyID(desc) + } case *types.VirtualDiskSparseVer2BackingInfo: if backing.Parent != nil { parent = backing.Parent.FileName } + if spec.Backing != nil { + crypto = spec.Backing.Crypto + switch tCrypto := crypto.(type) { + case *types.CryptoSpecEncrypt: + backing.KeyId = &tCrypto.CryptoKeyId + case *types.CryptoSpecShallowRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDeepRecrypt: + backing.KeyId = &tCrypto.NewKeyId + case *types.CryptoSpecDecrypt: + backing.KeyId = nil + } + } + setCryptoKeyID = func(desc *vmdk.Descriptor) { + backing.KeyId = getCryptoKeyID(desc) + } } if parent != "" { @@ -1459,15 +1679,22 @@ func (vm *VirtualMachine) configureDevice( info.FileName = filename } - err := vdmCreateVirtualDisk(ctx, spec.FileOperation, &types.CreateVirtualDisk_Task{ + desc, err := vdmCreateVirtualDisk(ctx, spec.FileOperation, &types.CreateVirtualDisk_Task{ Datacenter: &dc.Self, Name: info.FileName, - Spec: &types.FileBackedVirtualDiskSpec{CapacityKb: x.CapacityInKB}, + Spec: &types.FileBackedVirtualDiskSpec{ + CapacityKb: x.CapacityInKB, + Crypto: crypto, + }, }) if err != nil { return err } + if desc != nil && setCryptoKeyID != nil { + setCryptoKeyID(desc) + } + ctx.Update(vm, []types.PropertyChange{ {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks + 1}, }) @@ -1509,7 +1736,10 @@ func (vm *VirtualMachine) configureDevice( *prop = types.NewBool(false) } } - disk.Uuid = virtualDiskUUID(&dc.Self, info.FileName) + + if disk.Uuid == "" { + disk.Uuid = virtualDiskUUID(&dc.Self, info.FileName) + } } } case *types.VirtualCdrom: @@ -2226,7 +2456,7 @@ func (vm *VirtualMachine) UpgradeVMTask(ctx *Context, req *types.UpgradeVM_Task) supportedHardwareVersions[cod.Key] = struct{}{} } if latestHardwareVersion == "" { - if def := cod.DefaultConfigOption; def != nil && *def { + if def := cod.DefaultConfigOption; def { latestHardwareVersion = cod.Key } } @@ -2487,6 +2717,8 @@ func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soa // Leave FileName empty so CreateVM will just create a new one under VmPathName disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo).FileName = "" disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo).Parent = nil + // Clear UUID so a new unique UUID is generated for the cloned disk + disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo).Uuid = "" } config.DeviceChange = append(config.DeviceChange, &types.VirtualDeviceConfigSpec{ @@ -2787,7 +3019,7 @@ func (vm *VirtualMachine) CreateSnapshotExTask(ctx *Context, req *types.CreateSn snapshot := &VirtualMachineSnapshot{} snapshot.Vm = vm.Reference() - snapshot.Config = *vm.Config + snapshot.Config = copyConfigFromVmConfig(vm.Config) snapshot.DataSets = copyDataSetsForVmClone(vm.DataSets) ctx.Map.Put(snapshot) @@ -2797,6 +3029,11 @@ func (vm *VirtualMachine) CreateSnapshotExTask(ctx *Context, req *types.CreateSn quiesced = true } + snapPowerState := vm.Runtime.PowerState + if !req.Memory { + snapPowerState = types.VirtualMachinePowerStatePoweredOff + } + treeItem := types.VirtualMachineSnapshotTree{ Snapshot: snapshot.Self, Vm: snapshot.Vm, @@ -2804,7 +3041,7 @@ func (vm *VirtualMachine) CreateSnapshotExTask(ctx *Context, req *types.CreateSn Description: req.Description, Id: atomic.AddInt32(&vm.sid, 1), CreateTime: time.Now(), - State: vm.Runtime.PowerState, + State: snapPowerState, Quiesced: quiesced, BackupManifest: "", ReplaySupported: types.NewBool(false), @@ -3246,3 +3483,49 @@ func (vm *VirtualMachine) updateLastModifiedAndChangeVersion(ctx *Context) { }, }) } + +func (vm *VirtualMachine) updateTagSpec( + ctx *Context, + specs []types.TagSpec) types.BaseMethodFault { + + if len(specs) == 0 { + return nil + } + + // If the VAPI simulator is not loaded, the tagManager will be nil. + if ctx.Map.tagManager == nil { + return nil + } + + vmRef := vm.Reference() + + for _, spec := range specs { + tagID := spec.Id.Uuid + if spec.Id.NameId != nil { + t, err := ctx.Map.tagManager.GetTagByCategoryAndName( + spec.Id.NameId.Category, + spec.Id.NameId.Tag) + if err != nil { + return err + } + tagID = t + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if err := ctx.Map.tagManager.AttachTag(vmRef, tagID); err != nil { + return err + } + case types.ArrayUpdateOperationRemove: + if err := ctx.Map.tagManager.DetachTag(vmRef, tagID); err != nil { + return err + } + default: + return &types.InvalidArgument{ + InvalidProperty: "tagSpecs.operation", + } + } + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go b/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go index f947cceaf6..3eeafd96af 100644 --- a/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go @@ -231,7 +231,7 @@ func (m *VcenterVStorageObjectManager) createObject(ctx *Context, req *types.Cre } if !register { - err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ + _, err := vdmCreateVirtualDisk(ctx, types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ Datacenter: &dc.Self, Name: path.String(), Spec: &types.FileBackedVirtualDiskSpec{CapacityKb: req.Spec.CapacityInMB * 1024}, @@ -395,15 +395,15 @@ func (m *VcenterVStorageObjectManager) AttachTagToVStorageObject(ctx *Context, r body := new(methods.AttachTagToVStorageObjectBody) ref := m.tagID(req.Id) - err := ctx.Map.tagManager.AttachTag(ref, types.VslmTagEntry{ - ParentCategoryName: req.Category, - TagName: req.Tag, - }) - - if err == nil { - body.Res = new(types.AttachTagToVStorageObjectResponse) - } else { + t, err := ctx.Map.tagManager.GetTagByCategoryAndName(req.Category, req.Tag) + if err != nil { body.Fault_ = Fault("", err) + } else { + if err := ctx.Map.tagManager.AttachTag(ref, t); err != nil { + body.Fault_ = Fault("", err) + } else { + body.Res = new(types.AttachTagToVStorageObjectResponse) + } } return body @@ -413,15 +413,15 @@ func (m *VcenterVStorageObjectManager) DetachTagFromVStorageObject(ctx *Context, body := new(methods.DetachTagFromVStorageObjectBody) ref := m.tagID(req.Id) - err := ctx.Map.tagManager.DetachTag(ref, types.VslmTagEntry{ - ParentCategoryName: req.Category, - TagName: req.Tag, - }) - - if err == nil { - body.Res = new(types.DetachTagFromVStorageObjectResponse) - } else { + t, err := ctx.Map.tagManager.GetTagByCategoryAndName(req.Category, req.Tag) + if err != nil { body.Fault_ = Fault("", err) + } else { + if err := ctx.Map.tagManager.DetachTag(ref, t); err != nil { + body.Fault_ = Fault("", err) + } else { + body.Res = new(types.DetachTagFromVStorageObjectResponse) + } } return body @@ -430,18 +430,18 @@ func (m *VcenterVStorageObjectManager) DetachTagFromVStorageObject(ctx *Context, func (m *VcenterVStorageObjectManager) ListVStorageObjectsAttachedToTag(ctx *Context, req *types.ListVStorageObjectsAttachedToTag) soap.HasFault { body := new(methods.ListVStorageObjectsAttachedToTagBody) - refs, err := ctx.Map.tagManager.AttachedObjects(types.VslmTagEntry{ - ParentCategoryName: req.Category, - TagName: req.Tag, - }) - - if err == nil { - body.Res = new(types.ListVStorageObjectsAttachedToTagResponse) - for _, ref := range refs { - body.Res.Returnval = append(body.Res.Returnval, types.ID{Id: ref.Value}) - } - } else { + t, err := ctx.Map.tagManager.GetTagByCategoryAndName(req.Category, req.Tag) + if err != nil { body.Fault_ = Fault("", err) + } else { + if refs, err := ctx.Map.tagManager.AttachedObjects(t); err != nil { + body.Fault_ = Fault("", err) + } else { + body.Res = new(types.ListVStorageObjectsAttachedToTagResponse) + for _, ref := range refs { + body.Res.Returnval = append(body.Res.Returnval, types.ID{Id: ref.Value}) + } + } } return body @@ -451,14 +451,22 @@ func (m *VcenterVStorageObjectManager) ListTagsAttachedToVStorageObject(ctx *Con body := new(methods.ListTagsAttachedToVStorageObjectBody) ref := m.tagID(req.Id) - tags, err := ctx.Map.tagManager.AttachedTags(ref) - - if err == nil { - body.Res = &types.ListTagsAttachedToVStorageObjectResponse{ - Returnval: tags, - } - } else { + if tags, err := ctx.Map.tagManager.AttachedTags(ref); err != nil { body.Fault_ = Fault("", err) + } else { + body.Res = &types.ListTagsAttachedToVStorageObjectResponse{} + for _, t := range tags { + c, n, err := ctx.Map.tagManager.GetTagCategoryAndName(t) + if err != nil { + body.Res = nil + body.Fault_ = Fault("", err) + return body + } + body.Res.Returnval = append(body.Res.Returnval, types.VslmTagEntry{ + ParentCategoryName: c, + TagName: n, + }) + } } return body diff --git a/vendor/github.com/vmware/govmomi/vapi/internal/internal.go b/vendor/github.com/vmware/govmomi/vapi/internal/internal.go index 753f47925e..9356f3e3a6 100644 --- a/vendor/github.com/vmware/govmomi/vapi/internal/internal.go +++ b/vendor/github.com/vmware/govmomi/vapi/internal/internal.go @@ -15,6 +15,7 @@ const ( CategoryPath = "/com/vmware/cis/tagging/category" TagPath = "/com/vmware/cis/tagging/tag" AssociationPath = "/com/vmware/cis/tagging/tag-association" + APILibraryPath = "/api/content/library" LibraryPath = "/com/vmware/content/library" LibraryItemFileData = "/com/vmware/cis/data" LibraryItemPath = "/com/vmware/content/library/item" @@ -24,6 +25,7 @@ const ( LibraryItemUpdateSessionFile = "/com/vmware/content/library/item/updatesession/file" LibraryItemDownloadSession = "/com/vmware/content/library/item/download-session" LibraryItemDownloadSessionFile = "/com/vmware/content/library/item/downloadsession/file" + LibraryUsages = "usages" LocalLibraryPath = "/com/vmware/content/local-library" SubscribedLibraryPath = "/com/vmware/content/subscribed-library" SecurityPoliciesPath = "/api/content/security-policies" @@ -37,6 +39,22 @@ const ( DebugEcho = "/vc-sim/debug/echo" ) +// VAPI sub path +const ( + LibraryUsagesSubPath = "usages" +) + +// VAPI URL params +const ( + LibraryParam = "library" + LibraryUsageParam = "usage" +) + +// VAPI actions +const ( + LibraryUsageAddAction = "add" +) + // AssociatedObject is the same structure as types.ManagedObjectReference, // just with a different field name (ID instead of Value). // In the API we use mo.Reference, this type is only used for wire transfer. @@ -80,3 +98,7 @@ type SubscriptionItemDestinationSpec struct { Force bool `json:"force_sync_content"` Subscriptions []SubscriptionDestination `json:"subscriptions,omitempty"` } + +type LibraryUsageDestination struct { + ID string `json:"usage"` +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library.go b/vendor/github.com/vmware/govmomi/vapi/library/library.go index 53948b5888..01283fce0e 100644 --- a/vendor/github.com/vmware/govmomi/vapi/library/library.go +++ b/vendor/github.com/vmware/govmomi/vapi/library/library.go @@ -40,6 +40,7 @@ type Library struct { UnsetSecurityPolicyID bool `json:"unset_security_policy_id,omitempty"` ServerGUID string `json:"server_guid,omitempty"` StateInfo *StateInfo `json:"state_info,omitempty"` + Configuration *Configuration `json:"configuration_info,omitempty"` } // StateInfo provides the state info of a content library. @@ -122,6 +123,9 @@ func (l *Library) Patch(src *Library) { if src.Version != "" { l.Version = src.Version } + if src.Configuration != nil { + l.Configuration = src.Configuration + } } // Manager extends rest.Client, adding content library related methods. @@ -216,8 +220,9 @@ func (c *Manager) UpdateLibrary(ctx context.Context, l *Library) error { Library `json:"update_spec"` }{ Library{ - Name: l.Name, - Description: l.Description, + Name: l.Name, + Description: l.Description, + Configuration: l.Configuration, }, } url := c.Resource(internal.LibraryPath).WithID(l.ID) @@ -234,6 +239,16 @@ func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error { return c.Do(ctx, url.Request(http.MethodDelete), nil) } +// ForceDeleteLibrary Force deletes the specified library by skipping the usage check. +func (c *Manager) ForceDeleteLibrary(ctx context.Context, library *Library) error { + path := internal.LocalLibraryPath + if library.Type == "SUBSCRIBED" { + path = internal.SubscribedLibraryPath + } + url := c.Resource(path).WithID(library.ID).WithAction("force-delete") + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + // ListLibraries returns a list of all content library IDs in the system. func (c *Manager) ListLibraries(ctx context.Context) ([]string, error) { url := c.Resource(internal.LibraryPath) diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_configuration.go b/vendor/github.com/vmware/govmomi/vapi/library/library_configuration.go new file mode 100644 index 0000000000..a30b6a6d62 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_configuration.go @@ -0,0 +1,10 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package library + +// Configuration represents the configuration at individual Content Library level and applies to all types of libraries. +type Configuration struct { + ApplyLibraryUsageToItems *bool `json:"apply_library_usage_to_items,omitempty"` +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_usage.go b/vendor/github.com/vmware/govmomi/vapi/library/library_usage.go new file mode 100644 index 0000000000..64e2f411d0 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_usage.go @@ -0,0 +1,73 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package library + +import ( + "context" + "net/http" + "time" + + "github.com/vmware/govmomi/vapi/internal" +) + +// Usage provides methods to get usage information on content library. +type Usage struct { + ID string `json:"usage,omitempty"` + ResourceUrn string `json:"resource_urn,omitempty"` + AdditionTime *time.Time `json:"addition_time,omitempty"` +} + +// UsageSummary contains commonly used information about the usage of a content library. +type UsageSummary struct { + ID string `json:"usage,omitempty"` + ResourceUrn string `json:"resource_urn,omitempty"` +} + +// UsageList lists the usage by resource(s) on a content library. +type UsageList struct { + LibraryUsageList []UsageSummary `json:"library_usage_list,omitempty"` +} + +// GetLibraryUsage retrieves the library usage information for a given usage identifier. +func (c *Manager) GetLibraryUsage(ctx context.Context, libraryID, usageID string) (Usage, error) { + url := c.Resource(internal.APILibraryPath). + WithSubpath(libraryID). + WithSubpath(internal.LibraryUsages). + WithSubpath(usageID) + var res Usage + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// ListLibraryUsage retrieves the list of resources currently using a content library. +// A content library can be safely deleted if no usage is present for that library. +func (c *Manager) ListLibraryUsage(ctx context.Context, libraryID string) (UsageList, error) { + url := c.Resource(internal.APILibraryPath).WithSubpath(libraryID).WithSubpath(internal.LibraryUsages) + var res UsageList + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// RemoveLibraryUsage removes a resource usage on a content library. +func (c *Manager) RemoveLibraryUsage(ctx context.Context, libraryID string, usageID string) error { + url := c.Resource(internal.APILibraryPath). + WithSubpath(libraryID). + WithSubpath(internal.LibraryUsages). + WithSubpath(usageID) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// AddUsage defines the information required to add a resource usage on a content library. +type AddUsage struct { + ResourceUrn string `json:"resource_urn,omitempty"` +} + +// AddLibraryUsage adds a resource usage on a content library. +func (c *Manager) AddLibraryUsage(ctx context.Context, libraryID string, addUsage AddUsage) (string, error) { + url := c.Resource(internal.APILibraryPath). + WithSubpath(libraryID). + WithSubpath(internal.LibraryUsages) + + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, addUsage), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/client.go b/vendor/github.com/vmware/govmomi/vapi/rest/client.go index 770b367138..1866c88477 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/client.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/client.go @@ -197,6 +197,8 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody any) error { case http.StatusCreated: case http.StatusAccepted: case http.StatusNoContent: + // NoContent means there is no body to read. + return nil case http.StatusBadRequest: // TODO: structured error types detail, err := io.ReadAll(res.Body) diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/errors.go b/vendor/github.com/vmware/govmomi/vapi/rest/errors.go new file mode 100644 index 0000000000..f8fc110736 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/rest/errors.go @@ -0,0 +1,69 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package rest + +import "encoding/json" + +type Type string + +const ( + ErrError Type = "ERROR" + + ErrorAlreadyExists Type = "ALREADY_EXISTS" + + ErrAlreadyInDesiredState Type = "ALREADY_IN_DESIRED_STATE" + + ErrCanceled Type = "CANCELED" + + ErrConcurrentChange Type = "CONCURRENT_CHANGE" + + ErrFeatureInUse Type = "FEATURE_IN_USE" + + ErrInternalServer Type = "INTERNAL_SERVER_ERROR" + + ErrInvalidArgument Type = "INVALID_ARGUMENT" + + ErrInvalidElementConfiguration Type = "INVALID_ELEMENT_CONFIGURATION" + + ErrInvalidElementType Type = "INVALID_ELEMENT_TYPE" + + ErrInvalidRequest Type = "INVALID_REQUEST" + + ErrNotAllowedInCurrentState Type = "NOT_ALLOWED_IN_CURRENT_STATE" + + ErrNotFound Type = "NOT_FOUND" + + ErrOperationNotFound Type = "OPERATION_NOT_FOUND" + + ErrResourceBusy Type = "RESOURCE_BUSY" + + ErrResourceInUse Type = "RESOURCE_IN_USE" + + ErrResourceInaccessible Type = "RESOURCE_INACCESSIBLE" + + ErrServiceUnavailable Type = "SERVICE_UNAVAILABLE" + + ErrTimedOut Type = "TIMED_OUT" + + ErrUnableToAllocateResource Type = "UNABLE_TO_ALLOCATE_RESOURCE" + + ErrUnauthenticated Type = "UNAUTHENTICATED" + + ErrUnauthorized Type = "UNAUTHORIZED" + + ErrUnexpectedInput Type = "UNEXPECTED_INPUT" + + ErrUnsupported Type = "UNSUPPORTED" + + ErrUnverifiedPeer Type = "UNVERIFIED_PEER" +) + +type Error struct { + Messages []LocalizableMessage `json:"messages"` + + Data json.RawMessage `json:"data"` + + ErrorType Type `json:"error_type"` +} diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/notifications.go b/vendor/github.com/vmware/govmomi/vapi/rest/notifications.go new file mode 100644 index 0000000000..648bc64aa5 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/rest/notifications.go @@ -0,0 +1,33 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package rest + +import "time" + +// Notification contains fields to describe any info/warning/error messages +// that Tasks can raise. +type Notification struct { + // Id is the notification id. + Id string `json:"id"` + + // Time the notification was raised/found. + Time time.Time `json:"time"` + + Message LocalizableMessage `json:"message"` + + Resolution LocalizableMessage `json:"resolution"` +} + +// Notifications contains info/warning/error messages that can be reported. +type Notifications struct { + // Info notification messages reported. + Info []Notification `json:"info"` + + // Warning notification messages reported. + Warnings []Notification `json:"warnings"` + + // Errors notification messages reported. + Errors []Notification `json:"errors"` +} diff --git a/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go b/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go index f52b11152b..1fddc282e3 100644 --- a/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go @@ -87,18 +87,19 @@ type download struct { type handler struct { sync.Mutex - Map *simulator.Registry - ServeMux *http.ServeMux - URL url.URL - Category map[string]*tags.Category - Tag map[string]*tags.Tag - Association map[string]map[internal.AssociatedObject]bool - Session map[string]*rest.Session - Library map[string]*content - Update map[string]update - Download map[string]download - Policies []library.ContentSecurityPoliciesInfo - Trust map[string]library.TrustedCertificate + Map *simulator.Registry + ServeMux *http.ServeMux + URL url.URL + Category map[string]*tags.Category + Tag map[string]*tags.Tag + Association map[string]map[internal.AssociatedObject]bool + Session map[string]*rest.Session + Library map[string]*content + Update map[string]update + Download map[string]download + Policies []library.ContentSecurityPoliciesInfo + Trust map[string]library.TrustedCertificate + LibraryUsage map[string]map[string]library.Usage } func init() { @@ -165,6 +166,8 @@ func New(u *url.URL, r *simulator.Registry) ([]string, http.Handler) { {internal.LibraryItemFileData + "/", s.libraryItemFileData}, {internal.LibraryItemFilePath, s.libraryItemFile}, {internal.LibraryItemFilePath + "/", s.libraryItemFileID}, + {fmt.Sprintf("%s/{library}/%s", internal.APILibraryPath, internal.LibraryUsages), s.libraryUsages}, + {fmt.Sprintf("%s/{library}/%s/{usage}", internal.APILibraryPath, internal.LibraryUsages), s.libraryUsageID}, {internal.VCenterOVFLibraryItem, s.libraryItemOVF}, {internal.VCenterOVFLibraryItem + "/", s.libraryItemOVFID}, {internal.VCenterVMTXLibraryItem, s.libraryItemCreateTemplate}, @@ -319,9 +322,18 @@ func (s *handler) findTag(e vim.VslmTagEntry) *tags.Tag { return nil } +func (s *handler) findTagByID(tagID string) *tags.Tag { + for _, t := range s.Tag { + if t.ID == tagID { + return t + } + } + return nil +} + // AttachedObjects is meant for internal use via simulator.Registry.tagManager -func (s *handler) AttachedObjects(tag vim.VslmTagEntry) ([]vim.ManagedObjectReference, vim.BaseMethodFault) { - t := s.findTag(tag) +func (s *handler) AttachedObjects(tagID string) ([]vim.ManagedObjectReference, vim.BaseMethodFault) { + t := s.findTagByID(tagID) if t == nil { return nil, new(vim.NotFound) } @@ -338,28 +350,23 @@ func (s *handler) AttachedObjects(tag vim.VslmTagEntry) ([]vim.ManagedObjectRefe } // AttachedTags is meant for internal use via simulator.Registry.tagManager -func (s *handler) AttachedTags(ref vim.ManagedObjectReference) ([]vim.VslmTagEntry, vim.BaseMethodFault) { +func (s *handler) AttachedTags(ref vim.ManagedObjectReference) ([]string, vim.BaseMethodFault) { oid := internal.AssociatedObject{ Type: ref.Type, Value: ref.Value, } - var tags []vim.VslmTagEntry + var tags []string for id, objs := range s.Association { if objs[oid] { - tag := s.Tag[id] - cat := s.Category[tag.CategoryID] - tags = append(tags, vim.VslmTagEntry{ - TagName: tag.Name, - ParentCategoryName: cat.Name, - }) + tags = append(tags, id) } } return tags, nil } // AttachTag is meant for internal use via simulator.Registry.tagManager -func (s *handler) AttachTag(ref vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { - t := s.findTag(tag) +func (s *handler) AttachTag(ref vim.ManagedObjectReference, tagID string) vim.BaseMethodFault { + t := s.findTagByID(tagID) if t == nil { return new(vim.NotFound) } @@ -371,8 +378,8 @@ func (s *handler) AttachTag(ref vim.ManagedObjectReference, tag vim.VslmTagEntry } // DetachTag is meant for internal use via simulator.Registry.tagManager -func (s *handler) DetachTag(id vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { - t := s.findTag(tag) +func (s *handler) DetachTag(id vim.ManagedObjectReference, tagID string) vim.BaseMethodFault { + t := s.findTagByID(tagID) if t == nil { return new(vim.NotFound) } @@ -383,6 +390,27 @@ func (s *handler) DetachTag(id vim.ManagedObjectReference, tag vim.VslmTagEntry) return nil } +// GetTagByCategoryAndName is meant for internal use via simulator.Registry.tagManager +func (s *handler) GetTagByCategoryAndName(category, name string) (string, vim.BaseMethodFault) { + t := s.findTag(vim.VslmTagEntry{ + ParentCategoryName: category, + TagName: name, + }) + if t == nil { + return "", new(vim.NotFound) + } + return t.ID, nil +} + +// GetTagCategoryAndName is meant for internal use via simulator.Registry.tagManager +func (s *handler) GetTagCategoryAndName(tagID string) (string, string, vim.BaseMethodFault) { + t := s.findTagByID(tagID) + if t == nil { + return "", "", new(vim.NotFound) + } + return t.CategoryID, t.Name, nil +} + // StatusOK responds with http.StatusOK and encodes val, if specified, to JSON // For use with "/api" endpoints. func StatusOK(w http.ResponseWriter, val ...any) { @@ -1491,6 +1519,11 @@ func (s *handler) libraryID(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodDelete: + action := s.action(r) + if _, usageExists := s.LibraryUsage[id]; action != "force-delete" && usageExists { + s.error(w, fmt.Errorf("library is in use")) + return + } p := s.libraryPath(l.Library, "") if err := os.RemoveAll(p); err != nil { s.error(w, err) @@ -1500,6 +1533,7 @@ func (s *handler) libraryID(w http.ResponseWriter, r *http.Request) { s.deleteVM(item.Template) } delete(s.Library, id) + delete(s.LibraryUsage, id) OK(w) case http.MethodPatch: var spec struct { @@ -1635,6 +1669,246 @@ func (s *handler) subscriptionsID(w http.ResponseWriter, r *http.Request) { } } +func (s *handler) usages(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + log.Printf(" === usages: method not allowed") + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := r.URL.Query().Get("library") + _, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + + var res library.UsageList + + for _, val := range s.LibraryUsage[id] { + res.LibraryUsageList = append(res.LibraryUsageList, library.UsageSummary{ID: val.ID, ResourceUrn: val.ResourceUrn}) + } + OK(w, res) +} + +type LibUsagePathSegs struct { + LibraryID string + UsageID string +} + +func (s *handler) getLibUsagePathSegs(url *url.URL) LibUsagePathSegs { + var pathSegs LibUsagePathSegs + + pathAfterTrim := strings.TrimPrefix(url.Path, internal.APILibraryPath) + pathSegments := strings.Split(pathAfterTrim, "/") + var filteredData []string + for _, s := range pathSegments { + // Check if the string is not empty after trimming whitespace + if strings.TrimSpace(s) != "" { + filteredData = append(filteredData, s) + } + } + log.Printf("filteredData: %+v", filteredData) + pathSegs.LibraryID = filteredData[0] + if len(filteredData) == 3 { + pathSegs.UsageID = filteredData[2] + } + return pathSegs + +} + +// libraryUsages handles the incoming post requests on the url path +// /api/content/library/{librryID}/usages. +func (s *handler) libraryUsages(w http.ResponseWriter, r *http.Request) { + parsedURL, err := url.Parse(r.URL.Path) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + + pathSegs := s.getLibUsagePathSegs(parsedURL) + + switch r.Method { + case http.MethodPost: + // add library usage requested through + // - /api/content/library/{librryID}/usages with AddUsage body + var spec library.AddUsage + if !s.decode(r, w, &spec) { + return + } + usageID := uuid.New().String() + s.addUsage(pathSegs.LibraryID, usageID, spec) + StatusOK(w, usageID) + case http.MethodGet: + // List usages on a library requested through + // - /api/content/library/{librryID}/usages + var res library.UsageList + for _, val := range s.LibraryUsage[pathSegs.LibraryID] { + res.LibraryUsageList = append(res.LibraryUsageList, library.UsageSummary{ID: val.ID, ResourceUrn: val.ResourceUrn}) + } + log.Printf("list usage: res = %+v", res) + StatusOK(w, res) + } + log.Printf("usagesEx: %+v", r) +} + +func (s *handler) libraryUsageID(w http.ResponseWriter, r *http.Request) { + parsedURL, err := url.Parse(r.URL.Path) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + pathSegs := s.getLibUsagePathSegs(parsedURL) + + switch r.Method { + case http.MethodGet: + // Get specific usage information requested through + // - /api/content/library/{librryID}/usages/{usageID} + if len(pathSegs.UsageID) > 0 { + usage := s.findUsage(pathSegs.LibraryID, pathSegs.UsageID) + if usage == nil { + http.NotFound(w, r) + return + } + StatusOK(w, *usage) + } + + case http.MethodDelete: + if len(pathSegs.UsageID) == 0 { + w.WriteHeader(http.StatusForbidden) + return + } + s.removeUsage(pathSegs.LibraryID, pathSegs.UsageID) + OK(w) + } +} + +func (s *handler) usagesID(w http.ResponseWriter, r *http.Request) { + log.Printf("usagesID: %+v %s %s", r.Method, s.action(r), r.URL.Path) + + libraryID := s.id(r) + _, ok := s.Library[libraryID] + if !ok { + log.Printf("library not found: %s", libraryID) + http.NotFound(w, r) + return + } + + switch r.Method { + case http.MethodPost: + switch s.action(r) { + case "get": + var dst internal.LibraryUsageDestination + if !s.decode(r, w, &dst) { + return + } + usage := s.findUsage(libraryID, dst.ID) + if usage == nil { + http.NotFound(w, r) + return + } + OK(w, *usage) + case "add": + var spec library.AddUsage + if !s.decode(r, w, &spec) { + return + } + usageID := uuid.New().String() + s.addUsage(libraryID, usageID, spec) + // log.Fatalf("added usages: %+v", s.LibraryUsage) + + OK(w, usageID) + case "remove": + var dst internal.LibraryUsageDestination + if !s.decode(r, w, &dst) { + return + } + usageID := dst.ID + usage := s.findUsage(libraryID, usageID) + if usage == nil { + log.Printf("library usage not found: %s %s", libraryID, usageID) + http.NotFound(w, r) + return + } + s.removeUsage(libraryID, usageID) + OK(w) + default: + log.Fatalf("action: '%+v' not implemented. Request: %+v", s.action(r), r) + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + default: + w.WriteHeader(http.StatusMethodNotAllowed) + return + } +} + +func (s *handler) findUsage(libraryID, usageID string) *library.Usage { + _, ok := s.LibraryUsage[libraryID] + if !ok { + log.Printf("library not found: %s", libraryID) + return nil + } + + usage, exists := s.LibraryUsage[libraryID][usageID] + if !exists { + log.Printf("library usage not found: %s %s", libraryID, usageID) + return nil + } + + return &usage +} + +func (s *handler) removeUsage(libraryID, usageID string) { + _, ok := s.LibraryUsage[libraryID] + if !ok { + log.Printf("library not found: %s", libraryID) + return + } + + _, exists := s.LibraryUsage[libraryID][usageID] + if !exists { + log.Printf("library usage not found:%s %s", libraryID, usageID) + return + } + + delete(s.LibraryUsage[libraryID], usageID) +} + +func (s *handler) addUsage(libraryID, usageID string, addUsage library.AddUsage) { + if s.LibraryUsage == nil { + s.LibraryUsage = make(map[string]map[string]library.Usage) + } + if _, ok := s.LibraryUsage[libraryID][usageID]; !ok { + s.LibraryUsage[libraryID] = make(map[string]library.Usage) + + } + + _, ok := s.LibraryUsage[libraryID] + if !ok { + log.Printf("library not found: %s", libraryID) + return + } + + timeNow := time.Now() + s.LibraryUsage[libraryID][usageID] = library.Usage{ + ID: usageID, + ResourceUrn: addUsage.ResourceUrn, + AdditionTime: &timeNow, + } + +} + +func isApplyUsageOnItemsConfigured(libraryObj *library.Library) bool { + if libraryObj == nil { + return false + } + return libraryObj.Configuration != nil && + libraryObj.Configuration.ApplyLibraryUsageToItems != nil && + *libraryObj.Configuration.ApplyLibraryUsageToItems +} + func (s *handler) libraryItem(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodPost: @@ -1756,6 +2030,11 @@ func (s *handler) libraryItemID(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodDelete: + // library usage exists and applied on items. + if _, usageExists := s.LibraryUsage[lid]; usageExists && isApplyUsageOnItemsConfigured(l.Library) { + s.error(w, fmt.Errorf("library is in use")) + return + } p := s.libraryPath(l.Library, id) if err := os.RemoveAll(p); err != nil { s.error(w, err) diff --git a/vendor/github.com/vmware/govmomi/vim25/client.go b/vendor/github.com/vmware/govmomi/vim25/client.go index 88b687018f..495c27be30 100644 --- a/vendor/github.com/vmware/govmomi/vim25/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/client.go @@ -16,7 +16,7 @@ import ( const ( Namespace = "vim25" - Version = "9.0.0.0" + Version = "9.1.0.0" Path = "/sdk" ) diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go index 0c4e560a4f..eea25ae93c 100644 --- a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go +++ b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go @@ -18751,6 +18751,26 @@ func VStorageObjectCreateSnapshot_Task(ctx context.Context, r soap.RoundTripper, return resBody.Res, nil } +type VStorageObjectDeleteSnapshotEx2_TaskBody struct { + Req *types.VStorageObjectDeleteSnapshotEx2_Task `xml:"urn:vim25 VStorageObjectDeleteSnapshotEx2_Task,omitempty"` + Res *types.VStorageObjectDeleteSnapshotEx2_TaskResponse `xml:"VStorageObjectDeleteSnapshotEx2_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *VStorageObjectDeleteSnapshotEx2_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func VStorageObjectDeleteSnapshotEx2_Task(ctx context.Context, r soap.RoundTripper, req *types.VStorageObjectDeleteSnapshotEx2_Task) (*types.VStorageObjectDeleteSnapshotEx2_TaskResponse, error) { + var reqBody, resBody VStorageObjectDeleteSnapshotEx2_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type VStorageObjectDeleteSnapshotEx_TaskBody struct { Req *types.VStorageObjectDeleteSnapshotEx_Task `xml:"urn:vim25 VStorageObjectDeleteSnapshotEx_Task,omitempty"` Res *types.VStorageObjectDeleteSnapshotEx_TaskResponse `xml:"VStorageObjectDeleteSnapshotEx_TaskResponse,omitempty"` diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go b/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go index 1fc50b6ad7..e67ed74f7e 100644 --- a/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go +++ b/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go @@ -30,3 +30,23 @@ func PlaceVmsXCluster(ctx context.Context, r soap.RoundTripper, req *types.Place return resBody.Res, nil } + +type UpdatePodVMPropertyBody struct { + Req *types.UpdatePodVMProperty `xml:"urn:vim25 UpdatePodVMProperty"` + Res *types.UpdatePodVMPropertyResponse `xml:"UpdatePodVMPropertyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdatePodVMPropertyBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdatePodVMProperty(ctx context.Context, r soap.RoundTripper, req *types.UpdatePodVMProperty) (*types.UpdatePodVMPropertyResponse, error) { + var reqBody, resBody UpdatePodVMPropertyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return reqBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/extra.go b/vendor/github.com/vmware/govmomi/vim25/mo/extra.go index a0772e02b2..255561f8aa 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/extra.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/extra.go @@ -44,6 +44,10 @@ func (m ResourcePool) GetManagedEntity() ManagedEntity { return m.ManagedEntity } +func (m TransitGateway) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + func (m VirtualMachine) GetManagedEntity() ManagedEntity { return m.ManagedEntity } diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/registry.go b/vendor/github.com/vmware/govmomi/vim25/mo/registry.go index 90f3e321b8..0f1d665ffd 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/registry.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/registry.go @@ -12,7 +12,7 @@ import ( var t = map[string]reflect.Type{} -// TODO: 9.0 mo below, not included in the generate mo/mo.go, since the generator still uses older rbvmomi vmodl.db +// TODO: 9.0+ MOs below, not included in the generated mo/mo.go, since the generator still uses older rbvmomi vmodl.db type DirectPathProfileManager struct { Self types.ManagedObjectReference `json:"self"` @@ -25,3 +25,17 @@ func (m DirectPathProfileManager) Reference() types.ManagedObjectReference { func init() { t["DirectPathProfileManager"] = reflect.TypeOf((*DirectPathProfileManager)(nil)).Elem() } + +type TransitGateway struct { + ManagedEntity + + Config types.TransitGatewayConfigInfo `json:"config"` +} + +func (m TransitGateway) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["TransitGateway"] = reflect.TypeOf((*TransitGateway)(nil)).Elem() +} diff --git a/vendor/github.com/vmware/govmomi/vim25/types/enum.go b/vendor/github.com/vmware/govmomi/vim25/types/enum.go index b8fa3248c5..53fea1aad7 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/enum.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/enum.go @@ -278,7 +278,7 @@ const ( // // May treat this as a warning. ApplyHostProfileConfigurationResultStatusCheck_compliance_failed = ApplyHostProfileConfigurationResultStatus("check_compliance_failed") - // The required state is not satisfied so host profiel apply cannot + // The required state is not satisfied so host profile apply cannot // be done. ApplyHostProfileConfigurationResultStatusState_not_satisfied = ApplyHostProfileConfigurationResultStatus("state_not_satisfied") // Exit maintenance mode failed. @@ -510,7 +510,7 @@ func init() { type CannotMoveFaultToleranceVmMoveType string const ( - // Move out of the resouce pool + // Move out of the resource pool CannotMoveFaultToleranceVmMoveTypeResourcePool = CannotMoveFaultToleranceVmMoveType("resourcePool") // Move out of the cluster CannotMoveFaultToleranceVmMoveTypeCluster = CannotMoveFaultToleranceVmMoveType("cluster") @@ -657,7 +657,7 @@ func init() { t["CheckTestType"] = reflect.TypeOf((*CheckTestType)(nil)).Elem() } -// HCIWorkflowState identifies the state of the cluser from the perspective of HCI +// HCIWorkflowState identifies the state of the cluster from the perspective of HCI // workflow. // // The workflow begins with in\_progress mode and can transition @@ -690,6 +690,9 @@ func init() { t["ClusterComputeResourceHCIWorkflowState"] = reflect.TypeOf((*ClusterComputeResourceHCIWorkflowState)(nil)).Elem() } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. type ClusterComputeResourceVcsHealthStatus string const ( @@ -1985,7 +1988,7 @@ const ( DasConfigFaultDasConfigFaultReasonHostNetworkMisconfiguration = DasConfigFaultDasConfigFaultReason("HostNetworkMisconfiguration") // There is a problem with the host configuration. DasConfigFaultDasConfigFaultReasonHostMisconfiguration = DasConfigFaultDasConfigFaultReason("HostMisconfiguration") - // The privileges were insuffient for the operation. + // The privileges were insufficient for the operation. DasConfigFaultDasConfigFaultReasonInsufficientPrivileges = DasConfigFaultDasConfigFaultReason("InsufficientPrivileges") // There was no running primary agent available to contact. // @@ -2402,7 +2405,7 @@ const ( // For NSX backing type, We only support ephemeral portgroup type. // If `DistributedVirtualPortgroupPortgroupType_enum` is // ephemeral, A `DistributedVirtualPort` will be - // dynamicly created by NSX when the virtual machine is reconfigured + // dynamically created by NSX when the virtual machine is reconfigured // to connect to the portgroup. DistributedVirtualPortgroupBackingTypeNsx = DistributedVirtualPortgroupBackingType("nsx") ) @@ -2597,6 +2600,30 @@ func init() { t["DistributedVirtualSwitchHostMemberHostComponentState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberHostComponentState)(nil)).Elem() } +type DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus string + +const ( + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusSUCCEEDED = DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus("SUCCEEDED") + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusIN_PROGRESS = DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus("IN_PROGRESS") + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusFAILED = DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus("FAILED") +) + +func (e DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus) Values() []DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus { + return []DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus{ + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusSUCCEEDED, + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusIN_PROGRESS, + DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatusFAILED, + } +} + +func (e DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberHostPerfNicOffloadStateStatus)(nil)).Elem() +} + // Describe the runtime state of the uplink. type DistributedVirtualSwitchHostMemberHostUplinkStateState string @@ -3917,7 +3944,7 @@ const ( // the unmap bandwidth can be set as a fixed value HostCapabilityUnmapMethodSupportedFixed = HostCapabilityUnmapMethodSupported("fixed") // the unmap bandwidth can be set as a range, where the actual - // bandwidth will be dynamically throttled by the backened + // bandwidth will be dynamically throttled by the backend HostCapabilityUnmapMethodSupportedDynamic = HostCapabilityUnmapMethodSupported("dynamic") ) @@ -4650,6 +4677,8 @@ const ( HostFileSystemVolumeFileSystemTypeVFFS = HostFileSystemVolumeFileSystemType("VFFS") // vvol File System (ESX Server only). HostFileSystemVolumeFileSystemTypeVVOL = HostFileSystemVolumeFileSystemType("VVOL") + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Persistent Memory File System (ESX Server only). HostFileSystemVolumeFileSystemTypePMEM = HostFileSystemVolumeFileSystemType("PMEM") // VSAN direct file system. @@ -5566,6 +5595,8 @@ const ( // Flag indicating that the tier is the primary memory tier visible from the // host. HostMemoryTierFlagsMemoryTier = HostMemoryTierFlags("memoryTier") + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Flag indicating that the tier is used as non-volatile storage, e.g. // // PMem in @@ -5603,6 +5634,8 @@ type HostMemoryTierType string const ( // Dynamic random-access memory. HostMemoryTierTypeDRAM = HostMemoryTierType("DRAM") + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Persistent memory. HostMemoryTierTypePMem = HostMemoryTierType("PMem") // NVMe memory. @@ -7081,7 +7114,7 @@ const ( HostStandbyModeExiting = HostStandbyMode("exiting") // The host is in standby mode. HostStandbyModeIn = HostStandbyMode("in") - // The host is not in standy mode, and it is not + // The host is not in standby mode, and it is not // in the process of entering/exiting standby mode. HostStandbyModeNone = HostStandbyMode("none") ) @@ -7211,7 +7244,7 @@ const ( // The host was specifically powered off by the user through // VirtualCenter. // - // This state is not a cetain state, because + // This state is not a certain state, because // after VirtualCenter issues the command to power off the host, // the host might crash, or kill all the processes but fail to // power off. @@ -7220,7 +7253,7 @@ const ( // explicitly by the user, or automatically by DPM. // // This state - // is not a cetain state, because after VirtualCenter issues the + // is not a certain state, because after VirtualCenter issues the // command to put the host in standby state, the host might // crash, or kill all the processes but fail to power off. A host // that is exiting standby mode `exiting` @@ -8418,300 +8451,300 @@ func init() { t["ManagedEntityStatus"] = reflect.TypeOf((*ManagedEntityStatus)(nil)).Elem() } -type ManagedObjectTypes string - -const ( - ManagedObjectTypesPropertyCollector = ManagedObjectTypes("PropertyCollector") - ManagedObjectTypesPropertyFilter = ManagedObjectTypes("PropertyFilter") - ManagedObjectTypesAuthorizationManager = ManagedObjectTypes("AuthorizationManager") - ManagedObjectTypesCertificateManager = ManagedObjectTypes("CertificateManager") - ManagedObjectTypesClusterComputeResource = ManagedObjectTypes("ClusterComputeResource") - ManagedObjectTypesComputeResource = ManagedObjectTypes("ComputeResource") - ManagedObjectTypesCustomFieldsManager = ManagedObjectTypes("CustomFieldsManager") - ManagedObjectTypesCustomizationSpecManager = ManagedObjectTypes("CustomizationSpecManager") - ManagedObjectTypesDatacenter = ManagedObjectTypes("Datacenter") - ManagedObjectTypesDatastore = ManagedObjectTypes("Datastore") - ManagedObjectTypesDatastoreNamespaceManager = ManagedObjectTypes("DatastoreNamespaceManager") - ManagedObjectTypesDiagnosticManager = ManagedObjectTypes("DiagnosticManager") - ManagedObjectTypesDirectPathProfileManager = ManagedObjectTypes("DirectPathProfileManager") - ManagedObjectTypesDistributedVirtualSwitch = ManagedObjectTypes("DistributedVirtualSwitch") - ManagedObjectTypesEnvironmentBrowser = ManagedObjectTypes("EnvironmentBrowser") - ManagedObjectTypesExtensibleManagedObject = ManagedObjectTypes("ExtensibleManagedObject") - ManagedObjectTypesExtensionManager = ManagedObjectTypes("ExtensionManager") - ManagedObjectTypesFileManager = ManagedObjectTypes("FileManager") - ManagedObjectTypesFolder = ManagedObjectTypes("Folder") - ManagedObjectTypesHealthUpdateManager = ManagedObjectTypes("HealthUpdateManager") - ManagedObjectTypesHistoryCollector = ManagedObjectTypes("HistoryCollector") - ManagedObjectTypesHostSystem = ManagedObjectTypes("HostSystem") - ManagedObjectTypesHttpNfcLease = ManagedObjectTypes("HttpNfcLease") - ManagedObjectTypesIoFilterManager = ManagedObjectTypes("IoFilterManager") - ManagedObjectTypesIpPoolManager = ManagedObjectTypes("IpPoolManager") - ManagedObjectTypesLicenseAssignmentManager = ManagedObjectTypes("LicenseAssignmentManager") - ManagedObjectTypesLicenseManager = ManagedObjectTypes("LicenseManager") - ManagedObjectTypesLocalizationManager = ManagedObjectTypes("LocalizationManager") - ManagedObjectTypesManagedEntity = ManagedObjectTypes("ManagedEntity") - ManagedObjectTypesNetwork = ManagedObjectTypes("Network") - ManagedObjectTypesOpaqueNetwork = ManagedObjectTypes("OpaqueNetwork") - ManagedObjectTypesOverheadMemoryManager = ManagedObjectTypes("OverheadMemoryManager") - ManagedObjectTypesOvfManager = ManagedObjectTypes("OvfManager") - ManagedObjectTypesPerformanceManager = ManagedObjectTypes("PerformanceManager") - ManagedObjectTypesResourcePlanningManager = ManagedObjectTypes("ResourcePlanningManager") - ManagedObjectTypesResourcePool = ManagedObjectTypes("ResourcePool") - ManagedObjectTypesSearchIndex = ManagedObjectTypes("SearchIndex") - ManagedObjectTypesServiceInstance = ManagedObjectTypes("ServiceInstance") - ManagedObjectTypesServiceManager = ManagedObjectTypes("ServiceManager") - ManagedObjectTypesSessionManager = ManagedObjectTypes("SessionManager") - ManagedObjectTypesSimpleCommand = ManagedObjectTypes("SimpleCommand") - ManagedObjectTypesSiteInfoManager = ManagedObjectTypes("SiteInfoManager") - ManagedObjectTypesStoragePod = ManagedObjectTypes("StoragePod") - ManagedObjectTypesStorageQueryManager = ManagedObjectTypes("StorageQueryManager") - ManagedObjectTypesStorageResourceManager = ManagedObjectTypes("StorageResourceManager") - ManagedObjectTypesTask = ManagedObjectTypes("Task") - ManagedObjectTypesTaskHistoryCollector = ManagedObjectTypes("TaskHistoryCollector") - ManagedObjectTypesTaskManager = ManagedObjectTypes("TaskManager") - ManagedObjectTypesUserDirectory = ManagedObjectTypes("UserDirectory") - ManagedObjectTypesVirtualApp = ManagedObjectTypes("VirtualApp") - ManagedObjectTypesVirtualDiskManager = ManagedObjectTypes("VirtualDiskManager") - ManagedObjectTypesVirtualMachine = ManagedObjectTypes("VirtualMachine") - ManagedObjectTypesVirtualizationManager = ManagedObjectTypes("VirtualizationManager") - ManagedObjectTypesVsanUpgradeSystem = ManagedObjectTypes("VsanUpgradeSystem") - ManagedObjectTypesAlarm = ManagedObjectTypes("Alarm") - ManagedObjectTypesAlarmManager = ManagedObjectTypes("AlarmManager") - ManagedObjectTypesClusterEVCManager = ManagedObjectTypes("ClusterEVCManager") - ManagedObjectTypesDistributedVirtualPortgroup = ManagedObjectTypes("DistributedVirtualPortgroup") - ManagedObjectTypesDistributedVirtualSwitchManager = ManagedObjectTypes("DistributedVirtualSwitchManager") - ManagedObjectTypesVmwareDistributedVirtualSwitch = ManagedObjectTypes("VmwareDistributedVirtualSwitch") - ManagedObjectTypesCryptoManager = ManagedObjectTypes("CryptoManager") - ManagedObjectTypesCryptoManagerHost = ManagedObjectTypes("CryptoManagerHost") - ManagedObjectTypesCryptoManagerHostKMS = ManagedObjectTypes("CryptoManagerHostKMS") - ManagedObjectTypesCryptoManagerKmip = ManagedObjectTypes("CryptoManagerKmip") - ManagedObjectTypesEventHistoryCollector = ManagedObjectTypes("EventHistoryCollector") - ManagedObjectTypesEventManager = ManagedObjectTypes("EventManager") - ManagedObjectTypesHostActiveDirectoryAuthentication = ManagedObjectTypes("HostActiveDirectoryAuthentication") - ManagedObjectTypesHostAssignableHardwareManager = ManagedObjectTypes("HostAssignableHardwareManager") - ManagedObjectTypesHostAuthenticationManager = ManagedObjectTypes("HostAuthenticationManager") - ManagedObjectTypesHostAuthenticationStore = ManagedObjectTypes("HostAuthenticationStore") - ManagedObjectTypesHostAutoStartManager = ManagedObjectTypes("HostAutoStartManager") - ManagedObjectTypesHostBootDeviceSystem = ManagedObjectTypes("HostBootDeviceSystem") - ManagedObjectTypesHostCacheConfigurationManager = ManagedObjectTypes("HostCacheConfigurationManager") - ManagedObjectTypesHostCertificateManager = ManagedObjectTypes("HostCertificateManager") - ManagedObjectTypesHostCpuSchedulerSystem = ManagedObjectTypes("HostCpuSchedulerSystem") - ManagedObjectTypesHostDatastoreBrowser = ManagedObjectTypes("HostDatastoreBrowser") - ManagedObjectTypesHostDatastoreSystem = ManagedObjectTypes("HostDatastoreSystem") - ManagedObjectTypesHostDateTimeSystem = ManagedObjectTypes("HostDateTimeSystem") - ManagedObjectTypesHostDiagnosticSystem = ManagedObjectTypes("HostDiagnosticSystem") - ManagedObjectTypesHostDirectoryStore = ManagedObjectTypes("HostDirectoryStore") - ManagedObjectTypesHostEsxAgentHostManager = ManagedObjectTypes("HostEsxAgentHostManager") - ManagedObjectTypesHostFirewallSystem = ManagedObjectTypes("HostFirewallSystem") - ManagedObjectTypesHostFirmwareSystem = ManagedObjectTypes("HostFirmwareSystem") - ManagedObjectTypesHostGraphicsManager = ManagedObjectTypes("HostGraphicsManager") - ManagedObjectTypesHostHealthStatusSystem = ManagedObjectTypes("HostHealthStatusSystem") - ManagedObjectTypesHostAccessManager = ManagedObjectTypes("HostAccessManager") - ManagedObjectTypesHostImageConfigManager = ManagedObjectTypes("HostImageConfigManager") - ManagedObjectTypesIscsiManager = ManagedObjectTypes("IscsiManager") - ManagedObjectTypesHostKernelModuleSystem = ManagedObjectTypes("HostKernelModuleSystem") - ManagedObjectTypesHostLocalAccountManager = ManagedObjectTypes("HostLocalAccountManager") - ManagedObjectTypesHostLocalAuthentication = ManagedObjectTypes("HostLocalAuthentication") - ManagedObjectTypesHostMemorySystem = ManagedObjectTypes("HostMemorySystem") - ManagedObjectTypesMessageBusProxy = ManagedObjectTypes("MessageBusProxy") - ManagedObjectTypesHostNetworkSystem = ManagedObjectTypes("HostNetworkSystem") - ManagedObjectTypesHostNvdimmSystem = ManagedObjectTypes("HostNvdimmSystem") - ManagedObjectTypesHostPatchManager = ManagedObjectTypes("HostPatchManager") - ManagedObjectTypesHostPciPassthruSystem = ManagedObjectTypes("HostPciPassthruSystem") - ManagedObjectTypesHostPowerSystem = ManagedObjectTypes("HostPowerSystem") - ManagedObjectTypesHostServiceSystem = ManagedObjectTypes("HostServiceSystem") - ManagedObjectTypesHostSnmpSystem = ManagedObjectTypes("HostSnmpSystem") - ManagedObjectTypesHostStorageSystem = ManagedObjectTypes("HostStorageSystem") - ManagedObjectTypesHostVFlashManager = ManagedObjectTypes("HostVFlashManager") - ManagedObjectTypesHostVMotionSystem = ManagedObjectTypes("HostVMotionSystem") - ManagedObjectTypesHostVirtualNicManager = ManagedObjectTypes("HostVirtualNicManager") - ManagedObjectTypesHostVsanInternalSystem = ManagedObjectTypes("HostVsanInternalSystem") - ManagedObjectTypesHostVsanSystem = ManagedObjectTypes("HostVsanSystem") - ManagedObjectTypesOptionManager = ManagedObjectTypes("OptionManager") - ManagedObjectTypesProfileComplianceManager = ManagedObjectTypes("ProfileComplianceManager") - ManagedObjectTypesProfile = ManagedObjectTypes("Profile") - ManagedObjectTypesProfileManager = ManagedObjectTypes("ProfileManager") - ManagedObjectTypesClusterProfile = ManagedObjectTypes("ClusterProfile") - ManagedObjectTypesClusterProfileManager = ManagedObjectTypes("ClusterProfileManager") - ManagedObjectTypesHostProfile = ManagedObjectTypes("HostProfile") - ManagedObjectTypesHostSpecificationManager = ManagedObjectTypes("HostSpecificationManager") - ManagedObjectTypesHostProfileManager = ManagedObjectTypes("HostProfileManager") - ManagedObjectTypesScheduledTask = ManagedObjectTypes("ScheduledTask") - ManagedObjectTypesScheduledTaskManager = ManagedObjectTypes("ScheduledTaskManager") - ManagedObjectTypesTenantTenantManager = ManagedObjectTypes("TenantTenantManager") - ManagedObjectTypesFailoverClusterConfigurator = ManagedObjectTypes("FailoverClusterConfigurator") - ManagedObjectTypesFailoverClusterManager = ManagedObjectTypes("FailoverClusterManager") - ManagedObjectTypesContainerView = ManagedObjectTypes("ContainerView") - ManagedObjectTypesInventoryView = ManagedObjectTypes("InventoryView") - ManagedObjectTypesListView = ManagedObjectTypes("ListView") - ManagedObjectTypesManagedObjectView = ManagedObjectTypes("ManagedObjectView") - ManagedObjectTypesView = ManagedObjectTypes("View") - ManagedObjectTypesViewManager = ManagedObjectTypes("ViewManager") - ManagedObjectTypesVirtualMachineGuestCustomizationManager = ManagedObjectTypes("VirtualMachineGuestCustomizationManager") - ManagedObjectTypesVirtualMachineSnapshot = ManagedObjectTypes("VirtualMachineSnapshot") - ManagedObjectTypesVirtualMachineCompatibilityChecker = ManagedObjectTypes("VirtualMachineCompatibilityChecker") - ManagedObjectTypesVirtualMachineProvisioningChecker = ManagedObjectTypes("VirtualMachineProvisioningChecker") - ManagedObjectTypesGuestAliasManager = ManagedObjectTypes("GuestAliasManager") - ManagedObjectTypesGuestAuthManager = ManagedObjectTypes("GuestAuthManager") - ManagedObjectTypesGuestFileManager = ManagedObjectTypes("GuestFileManager") - ManagedObjectTypesGuestOperationsManager = ManagedObjectTypes("GuestOperationsManager") - ManagedObjectTypesGuestProcessManager = ManagedObjectTypes("GuestProcessManager") - ManagedObjectTypesGuestWindowsRegistryManager = ManagedObjectTypes("GuestWindowsRegistryManager") - ManagedObjectTypesVStorageObjectManagerBase = ManagedObjectTypes("VStorageObjectManagerBase") - ManagedObjectTypesHostVStorageObjectManager = ManagedObjectTypes("HostVStorageObjectManager") - ManagedObjectTypesVcenterVStorageObjectManager = ManagedObjectTypes("VcenterVStorageObjectManager") -) - -func (e ManagedObjectTypes) Values() []ManagedObjectTypes { - return []ManagedObjectTypes{ - ManagedObjectTypesPropertyCollector, - ManagedObjectTypesPropertyFilter, - ManagedObjectTypesAuthorizationManager, - ManagedObjectTypesCertificateManager, - ManagedObjectTypesClusterComputeResource, - ManagedObjectTypesComputeResource, - ManagedObjectTypesCustomFieldsManager, - ManagedObjectTypesCustomizationSpecManager, - ManagedObjectTypesDatacenter, - ManagedObjectTypesDatastore, - ManagedObjectTypesDatastoreNamespaceManager, - ManagedObjectTypesDiagnosticManager, - ManagedObjectTypesDirectPathProfileManager, - ManagedObjectTypesDistributedVirtualSwitch, - ManagedObjectTypesEnvironmentBrowser, - ManagedObjectTypesExtensibleManagedObject, - ManagedObjectTypesExtensionManager, - ManagedObjectTypesFileManager, - ManagedObjectTypesFolder, - ManagedObjectTypesHealthUpdateManager, - ManagedObjectTypesHistoryCollector, - ManagedObjectTypesHostSystem, - ManagedObjectTypesHttpNfcLease, - ManagedObjectTypesIoFilterManager, - ManagedObjectTypesIpPoolManager, - ManagedObjectTypesLicenseAssignmentManager, - ManagedObjectTypesLicenseManager, - ManagedObjectTypesLocalizationManager, - ManagedObjectTypesManagedEntity, - ManagedObjectTypesNetwork, - ManagedObjectTypesOpaqueNetwork, - ManagedObjectTypesOverheadMemoryManager, - ManagedObjectTypesOvfManager, - ManagedObjectTypesPerformanceManager, - ManagedObjectTypesResourcePlanningManager, - ManagedObjectTypesResourcePool, - ManagedObjectTypesSearchIndex, - ManagedObjectTypesServiceInstance, - ManagedObjectTypesServiceManager, - ManagedObjectTypesSessionManager, - ManagedObjectTypesSimpleCommand, - ManagedObjectTypesSiteInfoManager, - ManagedObjectTypesStoragePod, - ManagedObjectTypesStorageQueryManager, - ManagedObjectTypesStorageResourceManager, - ManagedObjectTypesTask, - ManagedObjectTypesTaskHistoryCollector, - ManagedObjectTypesTaskManager, - ManagedObjectTypesUserDirectory, - ManagedObjectTypesVirtualApp, - ManagedObjectTypesVirtualDiskManager, - ManagedObjectTypesVirtualMachine, - ManagedObjectTypesVirtualizationManager, - ManagedObjectTypesVsanUpgradeSystem, - ManagedObjectTypesAlarm, - ManagedObjectTypesAlarmManager, - ManagedObjectTypesClusterEVCManager, - ManagedObjectTypesDistributedVirtualPortgroup, - ManagedObjectTypesDistributedVirtualSwitchManager, - ManagedObjectTypesVmwareDistributedVirtualSwitch, - ManagedObjectTypesCryptoManager, - ManagedObjectTypesCryptoManagerHost, - ManagedObjectTypesCryptoManagerHostKMS, - ManagedObjectTypesCryptoManagerKmip, - ManagedObjectTypesEventHistoryCollector, - ManagedObjectTypesEventManager, - ManagedObjectTypesHostActiveDirectoryAuthentication, - ManagedObjectTypesHostAssignableHardwareManager, - ManagedObjectTypesHostAuthenticationManager, - ManagedObjectTypesHostAuthenticationStore, - ManagedObjectTypesHostAutoStartManager, - ManagedObjectTypesHostBootDeviceSystem, - ManagedObjectTypesHostCacheConfigurationManager, - ManagedObjectTypesHostCertificateManager, - ManagedObjectTypesHostCpuSchedulerSystem, - ManagedObjectTypesHostDatastoreBrowser, - ManagedObjectTypesHostDatastoreSystem, - ManagedObjectTypesHostDateTimeSystem, - ManagedObjectTypesHostDiagnosticSystem, - ManagedObjectTypesHostDirectoryStore, - ManagedObjectTypesHostEsxAgentHostManager, - ManagedObjectTypesHostFirewallSystem, - ManagedObjectTypesHostFirmwareSystem, - ManagedObjectTypesHostGraphicsManager, - ManagedObjectTypesHostHealthStatusSystem, - ManagedObjectTypesHostAccessManager, - ManagedObjectTypesHostImageConfigManager, - ManagedObjectTypesIscsiManager, - ManagedObjectTypesHostKernelModuleSystem, - ManagedObjectTypesHostLocalAccountManager, - ManagedObjectTypesHostLocalAuthentication, - ManagedObjectTypesHostMemorySystem, - ManagedObjectTypesMessageBusProxy, - ManagedObjectTypesHostNetworkSystem, - ManagedObjectTypesHostNvdimmSystem, - ManagedObjectTypesHostPatchManager, - ManagedObjectTypesHostPciPassthruSystem, - ManagedObjectTypesHostPowerSystem, - ManagedObjectTypesHostServiceSystem, - ManagedObjectTypesHostSnmpSystem, - ManagedObjectTypesHostStorageSystem, - ManagedObjectTypesHostVFlashManager, - ManagedObjectTypesHostVMotionSystem, - ManagedObjectTypesHostVirtualNicManager, - ManagedObjectTypesHostVsanInternalSystem, - ManagedObjectTypesHostVsanSystem, - ManagedObjectTypesOptionManager, - ManagedObjectTypesProfileComplianceManager, - ManagedObjectTypesProfile, - ManagedObjectTypesProfileManager, - ManagedObjectTypesClusterProfile, - ManagedObjectTypesClusterProfileManager, - ManagedObjectTypesHostProfile, - ManagedObjectTypesHostSpecificationManager, - ManagedObjectTypesHostProfileManager, - ManagedObjectTypesScheduledTask, - ManagedObjectTypesScheduledTaskManager, - ManagedObjectTypesTenantTenantManager, - ManagedObjectTypesFailoverClusterConfigurator, - ManagedObjectTypesFailoverClusterManager, - ManagedObjectTypesContainerView, - ManagedObjectTypesInventoryView, - ManagedObjectTypesListView, - ManagedObjectTypesManagedObjectView, - ManagedObjectTypesView, - ManagedObjectTypesViewManager, - ManagedObjectTypesVirtualMachineGuestCustomizationManager, - ManagedObjectTypesVirtualMachineSnapshot, - ManagedObjectTypesVirtualMachineCompatibilityChecker, - ManagedObjectTypesVirtualMachineProvisioningChecker, - ManagedObjectTypesGuestAliasManager, - ManagedObjectTypesGuestAuthManager, - ManagedObjectTypesGuestFileManager, - ManagedObjectTypesGuestOperationsManager, - ManagedObjectTypesGuestProcessManager, - ManagedObjectTypesGuestWindowsRegistryManager, - ManagedObjectTypesVStorageObjectManagerBase, - ManagedObjectTypesHostVStorageObjectManager, - ManagedObjectTypesVcenterVStorageObjectManager, - } -} - -func (e ManagedObjectTypes) Strings() []string { - return EnumValuesAsStrings(e.Values()) -} - -func init() { - t["ManagedObjectTypes"] = reflect.TypeOf((*ManagedObjectTypes)(nil)).Elem() +type ManagedObjectType string + +const ( + ManagedObjectTypePropertyCollector = ManagedObjectType("PropertyCollector") + ManagedObjectTypePropertyFilter = ManagedObjectType("PropertyFilter") + ManagedObjectTypeAuthorizationManager = ManagedObjectType("AuthorizationManager") + ManagedObjectTypeCertificateManager = ManagedObjectType("CertificateManager") + ManagedObjectTypeClusterComputeResource = ManagedObjectType("ClusterComputeResource") + ManagedObjectTypeComputeResource = ManagedObjectType("ComputeResource") + ManagedObjectTypeCustomFieldsManager = ManagedObjectType("CustomFieldsManager") + ManagedObjectTypeCustomizationSpecManager = ManagedObjectType("CustomizationSpecManager") + ManagedObjectTypeDatacenter = ManagedObjectType("Datacenter") + ManagedObjectTypeDatastore = ManagedObjectType("Datastore") + ManagedObjectTypeDatastoreNamespaceManager = ManagedObjectType("DatastoreNamespaceManager") + ManagedObjectTypeDiagnosticManager = ManagedObjectType("DiagnosticManager") + ManagedObjectTypeDirectPathProfileManager = ManagedObjectType("DirectPathProfileManager") + ManagedObjectTypeDistributedVirtualSwitch = ManagedObjectType("DistributedVirtualSwitch") + ManagedObjectTypeEnvironmentBrowser = ManagedObjectType("EnvironmentBrowser") + ManagedObjectTypeExtensibleManagedObject = ManagedObjectType("ExtensibleManagedObject") + ManagedObjectTypeExtensionManager = ManagedObjectType("ExtensionManager") + ManagedObjectTypeFileManager = ManagedObjectType("FileManager") + ManagedObjectTypeFolder = ManagedObjectType("Folder") + ManagedObjectTypeHealthUpdateManager = ManagedObjectType("HealthUpdateManager") + ManagedObjectTypeHistoryCollector = ManagedObjectType("HistoryCollector") + ManagedObjectTypeHostSystem = ManagedObjectType("HostSystem") + ManagedObjectTypeHttpNfcLease = ManagedObjectType("HttpNfcLease") + ManagedObjectTypeIoFilterManager = ManagedObjectType("IoFilterManager") + ManagedObjectTypeIpPoolManager = ManagedObjectType("IpPoolManager") + ManagedObjectTypeLicenseAssignmentManager = ManagedObjectType("LicenseAssignmentManager") + ManagedObjectTypeLicenseManager = ManagedObjectType("LicenseManager") + ManagedObjectTypeLocalizationManager = ManagedObjectType("LocalizationManager") + ManagedObjectTypeManagedEntity = ManagedObjectType("ManagedEntity") + ManagedObjectTypeNetwork = ManagedObjectType("Network") + ManagedObjectTypeOpaqueNetwork = ManagedObjectType("OpaqueNetwork") + ManagedObjectTypeOverheadMemoryManager = ManagedObjectType("OverheadMemoryManager") + ManagedObjectTypeOvfManager = ManagedObjectType("OvfManager") + ManagedObjectTypePerformanceManager = ManagedObjectType("PerformanceManager") + ManagedObjectTypeResourcePlanningManager = ManagedObjectType("ResourcePlanningManager") + ManagedObjectTypeResourcePool = ManagedObjectType("ResourcePool") + ManagedObjectTypeSearchIndex = ManagedObjectType("SearchIndex") + ManagedObjectTypeServiceInstance = ManagedObjectType("ServiceInstance") + ManagedObjectTypeServiceManager = ManagedObjectType("ServiceManager") + ManagedObjectTypeSessionManager = ManagedObjectType("SessionManager") + ManagedObjectTypeSimpleCommand = ManagedObjectType("SimpleCommand") + ManagedObjectTypeSiteInfoManager = ManagedObjectType("SiteInfoManager") + ManagedObjectTypeStoragePod = ManagedObjectType("StoragePod") + ManagedObjectTypeStorageQueryManager = ManagedObjectType("StorageQueryManager") + ManagedObjectTypeStorageResourceManager = ManagedObjectType("StorageResourceManager") + ManagedObjectTypeTask = ManagedObjectType("Task") + ManagedObjectTypeTaskHistoryCollector = ManagedObjectType("TaskHistoryCollector") + ManagedObjectTypeTaskManager = ManagedObjectType("TaskManager") + ManagedObjectTypeUserDirectory = ManagedObjectType("UserDirectory") + ManagedObjectTypeVirtualApp = ManagedObjectType("VirtualApp") + ManagedObjectTypeVirtualDiskManager = ManagedObjectType("VirtualDiskManager") + ManagedObjectTypeVirtualMachine = ManagedObjectType("VirtualMachine") + ManagedObjectTypeVirtualizationManager = ManagedObjectType("VirtualizationManager") + ManagedObjectTypeVsanUpgradeSystem = ManagedObjectType("VsanUpgradeSystem") + ManagedObjectTypeAlarm = ManagedObjectType("Alarm") + ManagedObjectTypeAlarmManager = ManagedObjectType("AlarmManager") + ManagedObjectTypeClusterEVCManager = ManagedObjectType("ClusterEVCManager") + ManagedObjectTypeDistributedVirtualPortgroup = ManagedObjectType("DistributedVirtualPortgroup") + ManagedObjectTypeDistributedVirtualSwitchManager = ManagedObjectType("DistributedVirtualSwitchManager") + ManagedObjectTypeVmwareDistributedVirtualSwitch = ManagedObjectType("VmwareDistributedVirtualSwitch") + ManagedObjectTypeCryptoManager = ManagedObjectType("CryptoManager") + ManagedObjectTypeCryptoManagerHost = ManagedObjectType("CryptoManagerHost") + ManagedObjectTypeCryptoManagerHostKMS = ManagedObjectType("CryptoManagerHostKMS") + ManagedObjectTypeCryptoManagerKmip = ManagedObjectType("CryptoManagerKmip") + ManagedObjectTypeEventHistoryCollector = ManagedObjectType("EventHistoryCollector") + ManagedObjectTypeEventManager = ManagedObjectType("EventManager") + ManagedObjectTypeHostActiveDirectoryAuthentication = ManagedObjectType("HostActiveDirectoryAuthentication") + ManagedObjectTypeHostAssignableHardwareManager = ManagedObjectType("HostAssignableHardwareManager") + ManagedObjectTypeHostAuthenticationManager = ManagedObjectType("HostAuthenticationManager") + ManagedObjectTypeHostAuthenticationStore = ManagedObjectType("HostAuthenticationStore") + ManagedObjectTypeHostAutoStartManager = ManagedObjectType("HostAutoStartManager") + ManagedObjectTypeHostBootDeviceSystem = ManagedObjectType("HostBootDeviceSystem") + ManagedObjectTypeHostCacheConfigurationManager = ManagedObjectType("HostCacheConfigurationManager") + ManagedObjectTypeHostCertificateManager = ManagedObjectType("HostCertificateManager") + ManagedObjectTypeHostCpuSchedulerSystem = ManagedObjectType("HostCpuSchedulerSystem") + ManagedObjectTypeHostDatastoreBrowser = ManagedObjectType("HostDatastoreBrowser") + ManagedObjectTypeHostDatastoreSystem = ManagedObjectType("HostDatastoreSystem") + ManagedObjectTypeHostDateTimeSystem = ManagedObjectType("HostDateTimeSystem") + ManagedObjectTypeHostDiagnosticSystem = ManagedObjectType("HostDiagnosticSystem") + ManagedObjectTypeHostDirectoryStore = ManagedObjectType("HostDirectoryStore") + ManagedObjectTypeHostEsxAgentHostManager = ManagedObjectType("HostEsxAgentHostManager") + ManagedObjectTypeHostFirewallSystem = ManagedObjectType("HostFirewallSystem") + ManagedObjectTypeHostFirmwareSystem = ManagedObjectType("HostFirmwareSystem") + ManagedObjectTypeHostGraphicsManager = ManagedObjectType("HostGraphicsManager") + ManagedObjectTypeHostHealthStatusSystem = ManagedObjectType("HostHealthStatusSystem") + ManagedObjectTypeHostAccessManager = ManagedObjectType("HostAccessManager") + ManagedObjectTypeHostImageConfigManager = ManagedObjectType("HostImageConfigManager") + ManagedObjectTypeIscsiManager = ManagedObjectType("IscsiManager") + ManagedObjectTypeHostKernelModuleSystem = ManagedObjectType("HostKernelModuleSystem") + ManagedObjectTypeHostLocalAccountManager = ManagedObjectType("HostLocalAccountManager") + ManagedObjectTypeHostLocalAuthentication = ManagedObjectType("HostLocalAuthentication") + ManagedObjectTypeHostMemorySystem = ManagedObjectType("HostMemorySystem") + ManagedObjectTypeMessageBusProxy = ManagedObjectType("MessageBusProxy") + ManagedObjectTypeHostNetworkSystem = ManagedObjectType("HostNetworkSystem") + ManagedObjectTypeHostNvdimmSystem = ManagedObjectType("HostNvdimmSystem") + ManagedObjectTypeHostPatchManager = ManagedObjectType("HostPatchManager") + ManagedObjectTypeHostPciPassthruSystem = ManagedObjectType("HostPciPassthruSystem") + ManagedObjectTypeHostPowerSystem = ManagedObjectType("HostPowerSystem") + ManagedObjectTypeHostServiceSystem = ManagedObjectType("HostServiceSystem") + ManagedObjectTypeHostSnmpSystem = ManagedObjectType("HostSnmpSystem") + ManagedObjectTypeHostStorageSystem = ManagedObjectType("HostStorageSystem") + ManagedObjectTypeHostVFlashManager = ManagedObjectType("HostVFlashManager") + ManagedObjectTypeHostVMotionSystem = ManagedObjectType("HostVMotionSystem") + ManagedObjectTypeHostVirtualNicManager = ManagedObjectType("HostVirtualNicManager") + ManagedObjectTypeHostVsanInternalSystem = ManagedObjectType("HostVsanInternalSystem") + ManagedObjectTypeHostVsanSystem = ManagedObjectType("HostVsanSystem") + ManagedObjectTypeOptionManager = ManagedObjectType("OptionManager") + ManagedObjectTypeProfileComplianceManager = ManagedObjectType("ProfileComplianceManager") + ManagedObjectTypeProfile = ManagedObjectType("Profile") + ManagedObjectTypeProfileManager = ManagedObjectType("ProfileManager") + ManagedObjectTypeClusterProfile = ManagedObjectType("ClusterProfile") + ManagedObjectTypeClusterProfileManager = ManagedObjectType("ClusterProfileManager") + ManagedObjectTypeHostProfile = ManagedObjectType("HostProfile") + ManagedObjectTypeHostSpecificationManager = ManagedObjectType("HostSpecificationManager") + ManagedObjectTypeHostProfileManager = ManagedObjectType("HostProfileManager") + ManagedObjectTypeScheduledTask = ManagedObjectType("ScheduledTask") + ManagedObjectTypeScheduledTaskManager = ManagedObjectType("ScheduledTaskManager") + ManagedObjectTypeTenantTenantManager = ManagedObjectType("TenantTenantManager") + ManagedObjectTypeFailoverClusterConfigurator = ManagedObjectType("FailoverClusterConfigurator") + ManagedObjectTypeFailoverClusterManager = ManagedObjectType("FailoverClusterManager") + ManagedObjectTypeContainerView = ManagedObjectType("ContainerView") + ManagedObjectTypeInventoryView = ManagedObjectType("InventoryView") + ManagedObjectTypeListView = ManagedObjectType("ListView") + ManagedObjectTypeManagedObjectView = ManagedObjectType("ManagedObjectView") + ManagedObjectTypeView = ManagedObjectType("View") + ManagedObjectTypeViewManager = ManagedObjectType("ViewManager") + ManagedObjectTypeVirtualMachineGuestCustomizationManager = ManagedObjectType("VirtualMachineGuestCustomizationManager") + ManagedObjectTypeVirtualMachineSnapshot = ManagedObjectType("VirtualMachineSnapshot") + ManagedObjectTypeVirtualMachineCompatibilityChecker = ManagedObjectType("VirtualMachineCompatibilityChecker") + ManagedObjectTypeVirtualMachineProvisioningChecker = ManagedObjectType("VirtualMachineProvisioningChecker") + ManagedObjectTypeGuestAliasManager = ManagedObjectType("GuestAliasManager") + ManagedObjectTypeGuestAuthManager = ManagedObjectType("GuestAuthManager") + ManagedObjectTypeGuestFileManager = ManagedObjectType("GuestFileManager") + ManagedObjectTypeGuestOperationsManager = ManagedObjectType("GuestOperationsManager") + ManagedObjectTypeGuestProcessManager = ManagedObjectType("GuestProcessManager") + ManagedObjectTypeGuestWindowsRegistryManager = ManagedObjectType("GuestWindowsRegistryManager") + ManagedObjectTypeVStorageObjectManagerBase = ManagedObjectType("VStorageObjectManagerBase") + ManagedObjectTypeHostVStorageObjectManager = ManagedObjectType("HostVStorageObjectManager") + ManagedObjectTypeVcenterVStorageObjectManager = ManagedObjectType("VcenterVStorageObjectManager") +) + +func (e ManagedObjectType) Values() []ManagedObjectType { + return []ManagedObjectType{ + ManagedObjectTypePropertyCollector, + ManagedObjectTypePropertyFilter, + ManagedObjectTypeAuthorizationManager, + ManagedObjectTypeCertificateManager, + ManagedObjectTypeClusterComputeResource, + ManagedObjectTypeComputeResource, + ManagedObjectTypeCustomFieldsManager, + ManagedObjectTypeCustomizationSpecManager, + ManagedObjectTypeDatacenter, + ManagedObjectTypeDatastore, + ManagedObjectTypeDatastoreNamespaceManager, + ManagedObjectTypeDiagnosticManager, + ManagedObjectTypeDirectPathProfileManager, + ManagedObjectTypeDistributedVirtualSwitch, + ManagedObjectTypeEnvironmentBrowser, + ManagedObjectTypeExtensibleManagedObject, + ManagedObjectTypeExtensionManager, + ManagedObjectTypeFileManager, + ManagedObjectTypeFolder, + ManagedObjectTypeHealthUpdateManager, + ManagedObjectTypeHistoryCollector, + ManagedObjectTypeHostSystem, + ManagedObjectTypeHttpNfcLease, + ManagedObjectTypeIoFilterManager, + ManagedObjectTypeIpPoolManager, + ManagedObjectTypeLicenseAssignmentManager, + ManagedObjectTypeLicenseManager, + ManagedObjectTypeLocalizationManager, + ManagedObjectTypeManagedEntity, + ManagedObjectTypeNetwork, + ManagedObjectTypeOpaqueNetwork, + ManagedObjectTypeOverheadMemoryManager, + ManagedObjectTypeOvfManager, + ManagedObjectTypePerformanceManager, + ManagedObjectTypeResourcePlanningManager, + ManagedObjectTypeResourcePool, + ManagedObjectTypeSearchIndex, + ManagedObjectTypeServiceInstance, + ManagedObjectTypeServiceManager, + ManagedObjectTypeSessionManager, + ManagedObjectTypeSimpleCommand, + ManagedObjectTypeSiteInfoManager, + ManagedObjectTypeStoragePod, + ManagedObjectTypeStorageQueryManager, + ManagedObjectTypeStorageResourceManager, + ManagedObjectTypeTask, + ManagedObjectTypeTaskHistoryCollector, + ManagedObjectTypeTaskManager, + ManagedObjectTypeUserDirectory, + ManagedObjectTypeVirtualApp, + ManagedObjectTypeVirtualDiskManager, + ManagedObjectTypeVirtualMachine, + ManagedObjectTypeVirtualizationManager, + ManagedObjectTypeVsanUpgradeSystem, + ManagedObjectTypeAlarm, + ManagedObjectTypeAlarmManager, + ManagedObjectTypeClusterEVCManager, + ManagedObjectTypeDistributedVirtualPortgroup, + ManagedObjectTypeDistributedVirtualSwitchManager, + ManagedObjectTypeVmwareDistributedVirtualSwitch, + ManagedObjectTypeCryptoManager, + ManagedObjectTypeCryptoManagerHost, + ManagedObjectTypeCryptoManagerHostKMS, + ManagedObjectTypeCryptoManagerKmip, + ManagedObjectTypeEventHistoryCollector, + ManagedObjectTypeEventManager, + ManagedObjectTypeHostActiveDirectoryAuthentication, + ManagedObjectTypeHostAssignableHardwareManager, + ManagedObjectTypeHostAuthenticationManager, + ManagedObjectTypeHostAuthenticationStore, + ManagedObjectTypeHostAutoStartManager, + ManagedObjectTypeHostBootDeviceSystem, + ManagedObjectTypeHostCacheConfigurationManager, + ManagedObjectTypeHostCertificateManager, + ManagedObjectTypeHostCpuSchedulerSystem, + ManagedObjectTypeHostDatastoreBrowser, + ManagedObjectTypeHostDatastoreSystem, + ManagedObjectTypeHostDateTimeSystem, + ManagedObjectTypeHostDiagnosticSystem, + ManagedObjectTypeHostDirectoryStore, + ManagedObjectTypeHostEsxAgentHostManager, + ManagedObjectTypeHostFirewallSystem, + ManagedObjectTypeHostFirmwareSystem, + ManagedObjectTypeHostGraphicsManager, + ManagedObjectTypeHostHealthStatusSystem, + ManagedObjectTypeHostAccessManager, + ManagedObjectTypeHostImageConfigManager, + ManagedObjectTypeIscsiManager, + ManagedObjectTypeHostKernelModuleSystem, + ManagedObjectTypeHostLocalAccountManager, + ManagedObjectTypeHostLocalAuthentication, + ManagedObjectTypeHostMemorySystem, + ManagedObjectTypeMessageBusProxy, + ManagedObjectTypeHostNetworkSystem, + ManagedObjectTypeHostNvdimmSystem, + ManagedObjectTypeHostPatchManager, + ManagedObjectTypeHostPciPassthruSystem, + ManagedObjectTypeHostPowerSystem, + ManagedObjectTypeHostServiceSystem, + ManagedObjectTypeHostSnmpSystem, + ManagedObjectTypeHostStorageSystem, + ManagedObjectTypeHostVFlashManager, + ManagedObjectTypeHostVMotionSystem, + ManagedObjectTypeHostVirtualNicManager, + ManagedObjectTypeHostVsanInternalSystem, + ManagedObjectTypeHostVsanSystem, + ManagedObjectTypeOptionManager, + ManagedObjectTypeProfileComplianceManager, + ManagedObjectTypeProfile, + ManagedObjectTypeProfileManager, + ManagedObjectTypeClusterProfile, + ManagedObjectTypeClusterProfileManager, + ManagedObjectTypeHostProfile, + ManagedObjectTypeHostSpecificationManager, + ManagedObjectTypeHostProfileManager, + ManagedObjectTypeScheduledTask, + ManagedObjectTypeScheduledTaskManager, + ManagedObjectTypeTenantTenantManager, + ManagedObjectTypeFailoverClusterConfigurator, + ManagedObjectTypeFailoverClusterManager, + ManagedObjectTypeContainerView, + ManagedObjectTypeInventoryView, + ManagedObjectTypeListView, + ManagedObjectTypeManagedObjectView, + ManagedObjectTypeView, + ManagedObjectTypeViewManager, + ManagedObjectTypeVirtualMachineGuestCustomizationManager, + ManagedObjectTypeVirtualMachineSnapshot, + ManagedObjectTypeVirtualMachineCompatibilityChecker, + ManagedObjectTypeVirtualMachineProvisioningChecker, + ManagedObjectTypeGuestAliasManager, + ManagedObjectTypeGuestAuthManager, + ManagedObjectTypeGuestFileManager, + ManagedObjectTypeGuestOperationsManager, + ManagedObjectTypeGuestProcessManager, + ManagedObjectTypeGuestWindowsRegistryManager, + ManagedObjectTypeVStorageObjectManagerBase, + ManagedObjectTypeHostVStorageObjectManager, + ManagedObjectTypeVcenterVStorageObjectManager, + } +} + +func (e ManagedObjectType) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["ManagedObjectType"] = reflect.TypeOf((*ManagedObjectType)(nil)).Elem() } // The operation on the target metric item. @@ -9666,7 +9699,7 @@ const ( PlacementAffinityRuleRuleScopeCluster = PlacementAffinityRuleRuleScope("cluster") // individual hosts are the scope PlacementAffinityRuleRuleScopeHost = PlacementAffinityRuleRuleScope("host") - // datastore cluster is teh scope + // datastore cluster is the scope PlacementAffinityRuleRuleScopeStoragePod = PlacementAffinityRuleRuleScope("storagePod") // individual datastores are the scope PlacementAffinityRuleRuleScopeDatastore = PlacementAffinityRuleRuleScope("datastore") @@ -10214,7 +10247,7 @@ const ( ReplicationVmConfigFaultReasonForFaultInvalidDestinationPort = ReplicationVmConfigFaultReasonForFault("invalidDestinationPort") // Malformed extra options list ReplicationVmConfigFaultReasonForFaultInvalidExtraVmOptions = ReplicationVmConfigFaultReasonForFault("invalidExtraVmOptions") - // Mis-matching generation number (stale) + // Mismatching generation number (stale) ReplicationVmConfigFaultReasonForFaultStaleGenerationNumber = ReplicationVmConfigFaultReasonForFault("staleGenerationNumber") // Attempting to re-configure the VM replication ID ReplicationVmConfigFaultReasonForFaultReconfigureVmReplicationIdNotAllowed = ReplicationVmConfigFaultReasonForFault("reconfigureVmReplicationIdNotAllowed") @@ -10711,6 +10744,116 @@ func init() { t["ScsiLunVStorageSupportStatus"] = reflect.TypeOf((*ScsiLunVStorageSupportStatus)(nil)).Elem() } +type SearchIndexPredicateArrayOperator string + +const ( + SearchIndexPredicateArrayOperatorAllElements = SearchIndexPredicateArrayOperator("AllElements") + SearchIndexPredicateArrayOperatorAnyElement = SearchIndexPredicateArrayOperator("AnyElement") +) + +func (e SearchIndexPredicateArrayOperator) Values() []SearchIndexPredicateArrayOperator { + return []SearchIndexPredicateArrayOperator{ + SearchIndexPredicateArrayOperatorAllElements, + SearchIndexPredicateArrayOperatorAnyElement, + } +} + +func (e SearchIndexPredicateArrayOperator) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["SearchIndexPredicateArrayOperator"] = reflect.TypeOf((*SearchIndexPredicateArrayOperator)(nil)).Elem() +} + +type SearchIndexPredicateComparisonOperator string + +const ( + SearchIndexPredicateComparisonOperatorEqual = SearchIndexPredicateComparisonOperator("Equal") + SearchIndexPredicateComparisonOperatorNotEqual = SearchIndexPredicateComparisonOperator("NotEqual") + SearchIndexPredicateComparisonOperatorGreater = SearchIndexPredicateComparisonOperator("Greater") + SearchIndexPredicateComparisonOperatorGreaterOrEqual = SearchIndexPredicateComparisonOperator("GreaterOrEqual") + SearchIndexPredicateComparisonOperatorLess = SearchIndexPredicateComparisonOperator("Less") + SearchIndexPredicateComparisonOperatorLessOrEqual = SearchIndexPredicateComparisonOperator("LessOrEqual") + SearchIndexPredicateComparisonOperatorIn = SearchIndexPredicateComparisonOperator("In") + SearchIndexPredicateComparisonOperatorNotIn = SearchIndexPredicateComparisonOperator("NotIn") + SearchIndexPredicateComparisonOperatorLike = SearchIndexPredicateComparisonOperator("Like") + SearchIndexPredicateComparisonOperatorNotLike = SearchIndexPredicateComparisonOperator("NotLike") +) + +func (e SearchIndexPredicateComparisonOperator) Values() []SearchIndexPredicateComparisonOperator { + return []SearchIndexPredicateComparisonOperator{ + SearchIndexPredicateComparisonOperatorEqual, + SearchIndexPredicateComparisonOperatorNotEqual, + SearchIndexPredicateComparisonOperatorGreater, + SearchIndexPredicateComparisonOperatorGreaterOrEqual, + SearchIndexPredicateComparisonOperatorLess, + SearchIndexPredicateComparisonOperatorLessOrEqual, + SearchIndexPredicateComparisonOperatorIn, + SearchIndexPredicateComparisonOperatorNotIn, + SearchIndexPredicateComparisonOperatorLike, + SearchIndexPredicateComparisonOperatorNotLike, + } +} + +func (e SearchIndexPredicateComparisonOperator) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["SearchIndexPredicateComparisonOperator"] = reflect.TypeOf((*SearchIndexPredicateComparisonOperator)(nil)).Elem() +} + +type SearchIndexQuerySpecResourceType string + +const ( + SearchIndexQuerySpecResourceTypeClusterComputeResource = SearchIndexQuerySpecResourceType("ClusterComputeResource") + SearchIndexQuerySpecResourceTypeComputeResource = SearchIndexQuerySpecResourceType("ComputeResource") + SearchIndexQuerySpecResourceTypeDatacenter = SearchIndexQuerySpecResourceType("Datacenter") + SearchIndexQuerySpecResourceTypeDatastore = SearchIndexQuerySpecResourceType("Datastore") + SearchIndexQuerySpecResourceTypeDistributedVirtualPortgroup = SearchIndexQuerySpecResourceType("DistributedVirtualPortgroup") + SearchIndexQuerySpecResourceTypeDistributedVirtualSwitch = SearchIndexQuerySpecResourceType("DistributedVirtualSwitch") + SearchIndexQuerySpecResourceTypeFolder = SearchIndexQuerySpecResourceType("Folder") + SearchIndexQuerySpecResourceTypeHostSystem = SearchIndexQuerySpecResourceType("HostSystem") + SearchIndexQuerySpecResourceTypeNetwork = SearchIndexQuerySpecResourceType("Network") + SearchIndexQuerySpecResourceTypeOpaqueNetwork = SearchIndexQuerySpecResourceType("OpaqueNetwork") + SearchIndexQuerySpecResourceTypeResourcePool = SearchIndexQuerySpecResourceType("ResourcePool") + SearchIndexQuerySpecResourceTypeServiceInstance = SearchIndexQuerySpecResourceType("ServiceInstance") + SearchIndexQuerySpecResourceTypeStoragePod = SearchIndexQuerySpecResourceType("StoragePod") + SearchIndexQuerySpecResourceTypeVirtualApp = SearchIndexQuerySpecResourceType("VirtualApp") + SearchIndexQuerySpecResourceTypeVirtualMachine = SearchIndexQuerySpecResourceType("VirtualMachine") + SearchIndexQuerySpecResourceTypeVmwareDistributedVirtualSwitch = SearchIndexQuerySpecResourceType("VmwareDistributedVirtualSwitch") +) + +func (e SearchIndexQuerySpecResourceType) Values() []SearchIndexQuerySpecResourceType { + return []SearchIndexQuerySpecResourceType{ + SearchIndexQuerySpecResourceTypeClusterComputeResource, + SearchIndexQuerySpecResourceTypeComputeResource, + SearchIndexQuerySpecResourceTypeDatacenter, + SearchIndexQuerySpecResourceTypeDatastore, + SearchIndexQuerySpecResourceTypeDistributedVirtualPortgroup, + SearchIndexQuerySpecResourceTypeDistributedVirtualSwitch, + SearchIndexQuerySpecResourceTypeFolder, + SearchIndexQuerySpecResourceTypeHostSystem, + SearchIndexQuerySpecResourceTypeNetwork, + SearchIndexQuerySpecResourceTypeOpaqueNetwork, + SearchIndexQuerySpecResourceTypeResourcePool, + SearchIndexQuerySpecResourceTypeServiceInstance, + SearchIndexQuerySpecResourceTypeStoragePod, + SearchIndexQuerySpecResourceTypeVirtualApp, + SearchIndexQuerySpecResourceTypeVirtualMachine, + SearchIndexQuerySpecResourceTypeVmwareDistributedVirtualSwitch, + } +} + +func (e SearchIndexQuerySpecResourceType) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["SearchIndexQuerySpecResourceType"] = reflect.TypeOf((*SearchIndexQuerySpecResourceType)(nil)).Elem() +} + type SessionManagerGenericServiceTicketTicketType string const ( @@ -11941,7 +12084,7 @@ const ( VchaNodeRolePassive = VchaNodeRole("passive") // Node is having a role of Witness. // - // In this role, node acts as a quorom + // In this role, node acts as a quorum // node for avoiding the classic split-brain problem. VchaNodeRoleWitness = VchaNodeRole("witness") ) @@ -14743,7 +14886,7 @@ func init() { // Deprecated as of vSphere API 5.0. // -// The set of tranformations that can be performed on the virtual disks +// The set of transformations that can be performed on the virtual disks // as part of the copy. type VirtualMachineRelocateTransformation string @@ -15141,7 +15284,7 @@ const ( // Wireless device related to the Wireless USB standard, // this is a subset of wireless controllers, VirtualMachineUsbInfoFamilyWusb = VirtualMachineUsbInfoFamily("wusb") - // Palm PDA, and Micorsoft ActiveSync PDA. + // Palm PDA, and Microsoft ActiveSync PDA. VirtualMachineUsbInfoFamilyPda = VirtualMachineUsbInfoFamily("pda") // Device that has an interface using a vendor-specific protocol. VirtualMachineUsbInfoFamilyVendor_specific = VirtualMachineUsbInfoFamily("vendor_specific") @@ -15993,36 +16136,6 @@ func init() { type VmPlacementPolicyVmPlacementPolicyStrictness string const ( - // A VmPlacementPolicy with this strictness is enforced on a best-effort - // basis and only once while placing the VM for the operation where this - // policy has been specified via `VirtualMachineConfigSpec.vmPlacementPolicies` - // or `VirtualMachineRelocateSpec.vmPlacementPolicies`. - // - // The same policy is not - // enforced after that operation. - // - // Below is a detailed explanation: - // If an operation requires specifying a VM's `VirtualMachineConfigSpec` or - // `VirtualMachineRelocateSpec` and there is a VmPlacementPolicy specified in - // that `VirtualMachineConfigSpec.vmPlacementPolicies` or - // `VirtualMachineRelocateSpec.vmPlacementPolicies` with this - // VmPlacementPolicyStrictness, then it means the following: - // - // (1) This VmPlacementPolicy will be considered as "preferred". This - // means that if a VM with this VmPlacementPolicy cannot be successfully - // placed on any host due to this policy, then the policy will be dropped - // and a placement recommendation can still be generated even if it - // results in violating that policy. This is denoted by the - // "PreferredDuringPlacement" part of this strictness value. - // - // (2) This VmPlacementPolicy will be enforced for that operation only. - // Once that operation is complete and the VM has been placed, the same - // policy will not be enforced for any subsequent operation. This - // essentially means that such a VmPlacementPolicy will not be converted - // into a vSphere compute-policy and hence it will be ignored thereafer - // during that VM's execution. This is denoted by the - // "IgnoredDuringExecution" part of this strictness value. - VmPlacementPolicyVmPlacementPolicyStrictnessPreferredDuringPlacementIgnoredDuringExecution = VmPlacementPolicyVmPlacementPolicyStrictness("PreferredDuringPlacementIgnoredDuringExecution") // A VmPlacementPolicy with this strictness is enforced on a best-effort // basis whenever a VM linked with this policy (via that VM's // `VirtualMachineConfigSpec.vmPlacementPolicies` or @@ -16051,37 +16164,6 @@ const ( // strictness value. VmPlacementPolicyVmPlacementPolicyStrictnessPreferredDuringPlacementPreferredDuringExecution = VmPlacementPolicyVmPlacementPolicyStrictness("PreferredDuringPlacementPreferredDuringExecution") // A VmPlacementPolicy with this strictness is enforced on a strict - // basis and only once while placing the VM for the operation where this - // policy has been specified via `VirtualMachineConfigSpec.vmPlacementPolicies` - // or `VirtualMachineRelocateSpec.vmPlacementPolicies`. - // - // The same policy is not - // enforced after that operation. - // - // Below is a detailed explanation: - // If an operation requires specifying a VM's `VirtualMachineConfigSpec` or - // `VirtualMachineRelocateSpec` and there is a VmPlacementPolicy specified in - // that `VirtualMachineConfigSpec.vmPlacementPolicies` or - // `VirtualMachineRelocateSpec.vmPlacementPolicies` with this - // VmPlacementPolicyStrictness, then it means the following: - // - // (1) This VmPlacementPolicy will be considered as "required". This - // means that if a VM with this VmPlacementPolicy cannot be successfully - // placed on any host due to this policy, then the policy will still be - // honored and no placement recommendation will be generated. The policy - // must be satisfied to find a successful placement target for the VM. - // This is denoted by the "RequiredDuringPlacement" part of this - // strictness value. - // - // (2) This VmPlacementPolicy will be enforced for that operation only. - // Once that operation is complete and the VM has been placed, the same - // policy will not be enforced for any subsequent operation. This - // essentially means that such a VmPlacementPolicy will not be converted - // into a vSphere compute-policy and hence it will be ignored thereafer - // during that VM's execution. This is denoted by the - // "IgnoredDuringExecution" part of this strictness value. - VmPlacementPolicyVmPlacementPolicyStrictnessRequiredDuringPlacementIgnoredDuringExecution = VmPlacementPolicyVmPlacementPolicyStrictness("RequiredDuringPlacementIgnoredDuringExecution") - // A VmPlacementPolicy with this strictness is enforced on a strict // basis while placing the VM for the operation where this policy has // been specified via `VirtualMachineConfigSpec.vmPlacementPolicies` or // `VirtualMachineRelocateSpec.vmPlacementPolicies`). @@ -16117,9 +16199,7 @@ const ( func (e VmPlacementPolicyVmPlacementPolicyStrictness) Values() []VmPlacementPolicyVmPlacementPolicyStrictness { return []VmPlacementPolicyVmPlacementPolicyStrictness{ - VmPlacementPolicyVmPlacementPolicyStrictnessPreferredDuringPlacementIgnoredDuringExecution, VmPlacementPolicyVmPlacementPolicyStrictnessPreferredDuringPlacementPreferredDuringExecution, - VmPlacementPolicyVmPlacementPolicyStrictnessRequiredDuringPlacementIgnoredDuringExecution, VmPlacementPolicyVmPlacementPolicyStrictnessRequiredDuringPlacementPreferredDuringExecution, } } @@ -16130,7 +16210,7 @@ func (e VmPlacementPolicyVmPlacementPolicyStrictness) Strings() []string { func init() { t["VmPlacementPolicyVmPlacementPolicyStrictness"] = reflect.TypeOf((*VmPlacementPolicyVmPlacementPolicyStrictness)(nil)).Elem() - minAPIVersionForType["VmPlacementPolicyVmPlacementPolicyStrictness"] = "9.0.0.0" + minAPIVersionForType["VmPlacementPolicyVmPlacementPolicyStrictness"] = "9.1.0.0" } // Defines the infrastructure topology for which a VM placement policy @@ -16185,7 +16265,7 @@ func (e VmPlacementPolicyVmPlacementPolicyTopology) Strings() []string { func init() { t["VmPlacementPolicyVmPlacementPolicyTopology"] = reflect.TypeOf((*VmPlacementPolicyVmPlacementPolicyTopology)(nil)).Elem() - minAPIVersionForType["VmPlacementPolicyVmPlacementPolicyTopology"] = "9.0.0.0" + minAPIVersionForType["VmPlacementPolicyVmPlacementPolicyTopology"] = "9.1.0.0" } type VmShutdownOnIsolationEventOperation string @@ -16538,6 +16618,8 @@ const ( VslmDiskInfoFlagNativeSnapshotSupported = VslmDiskInfoFlag("nativeSnapshotSupported") VslmDiskInfoFlagCbtEnabled = VslmDiskInfoFlag("cbtEnabled") VslmDiskInfoFlagVirtualDiskFormat = VslmDiskInfoFlag("virtualDiskFormat") + VslmDiskInfoFlagSharedFileBacking = VslmDiskInfoFlag("sharedFileBacking") + VslmDiskInfoFlagLinkedCloneDetails = VslmDiskInfoFlag("linkedCloneDetails") ) func (e VslmDiskInfoFlag) Values() []VslmDiskInfoFlag { @@ -16564,6 +16646,8 @@ func (e VslmDiskInfoFlag) Values() []VslmDiskInfoFlag { VslmDiskInfoFlagNativeSnapshotSupported, VslmDiskInfoFlagCbtEnabled, VslmDiskInfoFlagVirtualDiskFormat, + VslmDiskInfoFlagSharedFileBacking, + VslmDiskInfoFlagLinkedCloneDetails, } } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/guest.go b/vendor/github.com/vmware/govmomi/vim25/types/guest.go new file mode 100644 index 0000000000..a919f638fb --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vim25/types/guest.go @@ -0,0 +1,42 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package types + +import ( + "regexp" +) + +var ( + isGuestIDWindowsRx = regexp.MustCompile(`(?i)^win.+$`) + isGuestIDDarwinRx = regexp.MustCompile(`(?i)^darwin.+$`) + isGuestIDLinuxRx = regexp.MustCompile(`(?i)((^.*linux.*$)|(^(centos|coreos|debian|fedora|mandrake|mandriva|opensuse|redhat|rhel|suse|sles|ubuntu|vmwarephoton).+$))`) + isGuestIDNetwareRx = regexp.MustCompile(`(?i)^netware.+$`) + isGuestIDSolarisRx = regexp.MustCompile(`(?i)^solaris.+$`) +) + +// ToFamily returns the family to which the provided guest identifier belongs. +func (g VirtualMachineGuestOsIdentifier) ToFamily() VirtualMachineGuestOsFamily { + return GuestIDToFamily(g) +} + +// GuestIDToFamily returns the family to which the provided guest identifier +// belongs. +func GuestIDToFamily[T ~string](guestID T) VirtualMachineGuestOsFamily { + szGuestID := string(guestID) + switch { + case isGuestIDDarwinRx.MatchString(szGuestID): + return VirtualMachineGuestOsFamilyDarwinGuestFamily + case isGuestIDLinuxRx.MatchString(szGuestID): + return VirtualMachineGuestOsFamilyLinuxGuest + case isGuestIDSolarisRx.MatchString(szGuestID): + return VirtualMachineGuestOsFamilySolarisGuest + case isGuestIDNetwareRx.MatchString(szGuestID): + return VirtualMachineGuestOsFamilyNetwareGuest + case isGuestIDWindowsRx.MatchString(szGuestID): + return VirtualMachineGuestOsFamilyWindowsGuest + default: + return VirtualMachineGuestOsFamilyOtherGuestFamily + } +} diff --git a/vendor/github.com/vmware/govmomi/vim25/types/hardware_version.go b/vendor/github.com/vmware/govmomi/vim25/types/hardware_version.go index 01497dce14..229fe2fb34 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/hardware_version.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/hardware_version.go @@ -11,6 +11,12 @@ import ( ) // HardwareVersion is a VMX hardware version. +// +// Please see https://knowledge.broadcom.com/external/article/315655 for more +// information on when a hardware version was introduced. +// +// Please refer to https://knowledge.broadcom.com/external/article/312100 for +// what ESX/ESXi versions support which hardware versions. type HardwareVersion uint8 const ( @@ -18,27 +24,67 @@ const ( ) const ( + // VMX3 was introduced in ESX 2.x. VMX3 HardwareVersion = iota + 3 + + // VMX4 was introduced in ESX 3.x. VMX4 vmx5 // invalid + // VMX6 was introduced in Workstation 6.0.x and is not supported by + // ESX/ESXi per https://knowledge.broadcom.com/external/article/312100. VMX6 + + // VMX7 was introduced in ESXi 4.x. VMX7 + + // VMX8 was introduced in ESXi 5.0. VMX8 + + // VMX9 was introduced in ESXi 5.1. VMX9 + + // VMX10 was introduced in ESXi 5.5. VMX10 + + // VMX11 was introduced in ESXi 6.0. VMX11 + + // VMX12 was introduced in Workstation 12.x. and is not supported by + // ESX/ESXi per https://knowledge.broadcom.com/external/article/312100. VMX12 + + // VMX13 was introduced in ESXi 6.5. VMX13 + + // VMX14 was introduced in ESXi 6.7. VMX14 + + // VMX15 was introduced in ESXi 6.7 U2. VMX15 + + // VMX16 was introduced in Workstation 15.x and is not supported by + // ESX/ESXi per https://knowledge.broadcom.com/external/article/312100. VMX16 + + // VMX17 was introduced in ESXi 7.0. VMX17 + + // VMX18 was introduced in ESXi 7.0 U1 (7.0.1). VMX18 + + // VMX19 was introduced in ESXi 7.0 U2 (7.0.2). VMX19 + + // VMX20 was introduced in ESXi 8.0. VMX20 + + // VMX21 was introduced in ESXi 8.0 U2 (8.0.2). VMX21 + + // VMX22 was introduced in ESX 9.0. + VMX22 ) const ( @@ -48,7 +94,7 @@ const ( // MaxValidHardwareVersion is the maximum, valid hardware version supported // by VMware hypervisors in the wild. - MaxValidHardwareVersion = VMX21 + MaxValidHardwareVersion = VMX22 ) // IsSupported returns true if the hardware version is known to and supported by diff --git a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go index 1d07bf2873..5a6eb206d8 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go @@ -294,6 +294,10 @@ func (ci VirtualMachineConfigInfo) ToConfigSpec() VirtualMachineConfigSpec { for i := range civa.Property { p := civa.Property[i] + + if p.UserConfigurable == nil { + p.UserConfigurable = NewBool(false) + } csva.Property = append( csva.Property, VAppPropertySpec{ diff --git a/vendor/github.com/vmware/govmomi/vim25/types/types.go b/vendor/github.com/vmware/govmomi/vim25/types/types.go index 199bcf7588..50201b522b 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/types.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/types.go @@ -949,7 +949,7 @@ type AddVirtualSwitchResponse struct { } // Fault thrown if an attempt to disable the Administrator permission -// on a host of which the Administator permission has already been disabled. +// on a host of which the Administrator permission has already been disabled. type AdminDisabled struct { HostConfigFault } @@ -965,7 +965,7 @@ func init() { } // Fault thrown if an attempt to enable the Administrator permission -// on a host of which the Administator permission is not disabled. +// on a host of which the Administrator permission is not disabled. type AdminNotDisabled struct { HostConfigFault } @@ -1139,11 +1139,11 @@ type AlarmDescription struct { VirtualMachinePowerState []BaseElementDescription `xml:"virtualMachinePowerState,typeattr" json:"virtualMachinePowerState"` // `DatastoreSummary.accessible` and // `description` - DatastoreConnectionState []BaseElementDescription `xml:"datastoreConnectionState,omitempty,typeattr" json:"datastoreConnectionState,omitempty"` + DatastoreConnectionState []BaseElementDescription `xml:"datastoreConnectionState,typeattr" json:"datastoreConnectionState"` // *Host System Power State enum description* - HostSystemPowerState []BaseElementDescription `xml:"hostSystemPowerState,omitempty,typeattr" json:"hostSystemPowerState,omitempty"` + HostSystemPowerState []BaseElementDescription `xml:"hostSystemPowerState,typeattr" json:"hostSystemPowerState"` // *Guest Heartbeat Status enum description* - VirtualMachineGuestHeartbeatStatus []BaseElementDescription `xml:"virtualMachineGuestHeartbeatStatus,omitempty,typeattr" json:"virtualMachineGuestHeartbeatStatus,omitempty"` + VirtualMachineGuestHeartbeatStatus []BaseElementDescription `xml:"virtualMachineGuestHeartbeatStatus,typeattr" json:"virtualMachineGuestHeartbeatStatus"` // *ManagedEntity Status enum description* EntityStatus []BaseElementDescription `xml:"entityStatus,typeattr" json:"entityStatus"` // Action class descriptions for an alarm. @@ -2031,7 +2031,7 @@ type ApplyHostConfig_TaskResponse struct { // The `ApplyHostProfileConfigurationResult` data object contains the remediation // results for a host: the time that the remediation happens, the status, -// the errors, and optinal compliance result after reboot. +// the errors, and optional compliance result after reboot. type ApplyHostProfileConfigurationResult struct { DynamicData @@ -6066,6 +6066,16 @@ func init() { t["ArrayOfPhysicalNicProfile"] = reflect.TypeOf((*ArrayOfPhysicalNicProfile)(nil)).Elem() } +// A boxed array of `PlaceVmsXClusterSpecCandidateNetworks`. To be used in `Any` placeholders. +type ArrayOfPlaceVmsXClusterSpecCandidateNetworks struct { + PlaceVmsXClusterSpecCandidateNetworks []PlaceVmsXClusterSpecCandidateNetworks `xml:"PlaceVmsXClusterSpecCandidateNetworks,omitempty" json:"_value"` +} + +func init() { + t["ArrayOfPlaceVmsXClusterSpecCandidateNetworks"] = reflect.TypeOf((*ArrayOfPlaceVmsXClusterSpecCandidateNetworks)(nil)).Elem() + minAPIVersionForType["ArrayOfPlaceVmsXClusterSpecCandidateNetworks"] = "9.1.0.0" +} + // A boxed array of `PlacementAffinityRule`. To be used in `Any` placeholders. type ArrayOfPlacementAffinityRule struct { PlacementAffinityRule []PlacementAffinityRule `xml:"PlacementAffinityRule,omitempty" json:"_value"` @@ -6327,6 +6337,15 @@ func init() { t["ArrayOfRelation"] = reflect.TypeOf((*ArrayOfRelation)(nil)).Elem() } +// A boxed array of `ReplicationGroupId`. To be used in `Any` placeholders. +type ArrayOfReplicationGroupId struct { + ReplicationGroupId []ReplicationGroupId `xml:"ReplicationGroupId,omitempty" json:"_value"` +} + +func init() { + t["ArrayOfReplicationGroupId"] = reflect.TypeOf((*ArrayOfReplicationGroupId)(nil)).Elem() +} + // A boxed array of `ReplicationInfoDiskSettings`. To be used in `Any` placeholders. type ArrayOfReplicationInfoDiskSettings struct { ReplicationInfoDiskSettings []ReplicationInfoDiskSettings `xml:"ReplicationInfoDiskSettings,omitempty" json:"_value"` @@ -6345,6 +6364,16 @@ func init() { t["ArrayOfResourceConfigSpec"] = reflect.TypeOf((*ArrayOfResourceConfigSpec)(nil)).Elem() } +// A boxed array of `ResourcePoolVmResourceProfileUsage`. To be used in `Any` placeholders. +type ArrayOfResourcePoolVmResourceProfileUsage struct { + ResourcePoolVmResourceProfileUsage []ResourcePoolVmResourceProfileUsage `xml:"ResourcePoolVmResourceProfileUsage,omitempty" json:"_value"` +} + +func init() { + t["ArrayOfResourcePoolVmResourceProfileUsage"] = reflect.TypeOf((*ArrayOfResourcePoolVmResourceProfileUsage)(nil)).Elem() + minAPIVersionForType["ArrayOfResourcePoolVmResourceProfileUsage"] = "9.1.0.0" +} + // A boxed array of `RetrieveVStorageObjSpec`. To be used in `Any` placeholders. type ArrayOfRetrieveVStorageObjSpec struct { RetrieveVStorageObjSpec []RetrieveVStorageObjSpec `xml:"RetrieveVStorageObjSpec,omitempty" json:"_value"` @@ -6571,6 +6600,16 @@ func init() { t["ArrayOfTag"] = reflect.TypeOf((*ArrayOfTag)(nil)).Elem() } +// A boxed array of `TagSpec`. To be used in `Any` placeholders. +type ArrayOfTagSpec struct { + TagSpec []TagSpec `xml:"TagSpec,omitempty" json:"_value"` +} + +func init() { + t["ArrayOfTagSpec"] = reflect.TypeOf((*ArrayOfTagSpec)(nil)).Elem() + minAPIVersionForType["ArrayOfTagSpec"] = "9.1.0.0" +} + // A boxed array of `TaskInfo`. To be used in `Any` placeholders. type ArrayOfTaskInfo struct { TaskInfo []TaskInfo `xml:"TaskInfo,omitempty" json:"_value"` @@ -7564,6 +7603,16 @@ func init() { t["ArrayOfVmEventArgument"] = reflect.TypeOf((*ArrayOfVmEventArgument)(nil)).Elem() } +// A boxed array of `VmPlacementPolicy`. To be used in `Any` placeholders. +type ArrayOfVmPlacementPolicy struct { + VmPlacementPolicy []BaseVmPlacementPolicy `xml:"VmPlacementPolicy,omitempty,typeattr" json:"_value"` +} + +func init() { + t["ArrayOfVmPlacementPolicy"] = reflect.TypeOf((*ArrayOfVmPlacementPolicy)(nil)).Elem() + minAPIVersionForType["ArrayOfVmPlacementPolicy"] = "9.1.0.0" +} + // A boxed array of `VmPodConfigForPlacement`. To be used in `Any` placeholders. type ArrayOfVmPodConfigForPlacement struct { VmPodConfigForPlacement []VmPodConfigForPlacement `xml:"VmPodConfigForPlacement,omitempty" json:"_value"` @@ -8422,6 +8471,12 @@ type BaseConfigInfoFileBackingInfo struct { DeltaSizeInMB int64 `xml:"deltaSizeInMB,omitempty" json:"deltaSizeInMB,omitempty"` // key id used to encrypt the backing disk. KeyId *CryptoKeyId `xml:"keyId,omitempty" json:"keyId,omitempty"` + // Flag indicates whether the file backing is shared across + // multiple fcd disk chains. + // + // This flag is intended for internal use only and is + // primarily used in the relocation workflow. + SharedFileBacking *bool `xml:"sharedFileBacking" json:"sharedFileBacking,omitempty" vim:"9.1.0.0"` } func init() { @@ -8830,7 +8885,7 @@ func init() { // An CannotAccessLocalSourceFault exception is thrown when a // an attempt is made to upload license content -// and the local source cannot be accesed. +// and the local source cannot be accessed. type CannotAccessLocalSource struct { VimFault } @@ -9535,6 +9590,10 @@ type Capability struct { HostSeedingSupported *bool `xml:"hostSeedingSupported" json:"hostSeedingSupported,omitempty" vim:"7.0.2.0"` // Specifies if scalable shares for resource pools is supported. ScalableSharesSupported *bool `xml:"scalableSharesSupported" json:"scalableSharesSupported,omitempty"` + // Deprecated as of vSphere 9.0 with no replacement. In a future release + // of vSphere, the vCLS functionality will be disabled, vCLS + // system VMs will be deleted, and vCLS APIs will be removed. + // // Specifies if highly available distributed clustering service is supported. HadcsSupported *bool `xml:"hadcsSupported" json:"hadcsSupported,omitempty" vim:"7.0.1.1"` // Specifies if desired configuration management platform is supported @@ -10821,6 +10880,31 @@ type ClusterClusterInitialPlacementAction struct { // // Refers instance of `ResourcePool`. Pool ManagedObjectReference `xml:"pool" json:"pool"` + // List of all networks available to all virtual NICs of the virtual machine + // on the chosen cluster. + // + // This field is set if the input spec to + // `Folder.PlaceVmsXCluster` has + // `PlaceVmsXClusterSpecVmPlacementSpec.candidateNetworks` + // specified. + // When `PlaceVmsXClusterSpecVmPlacementSpec.candidateNetworks` + // is supplied to the cross cluster placement API, the API response will set + // this field by selecting networks specified for all virtual network + // interfaces in + // `PlaceVmsXClusterSpecVmPlacementSpec.candidateNetworks` that + // are available on the chosen cluster. + // Example: Assume + // `PlaceVmsXClusterSpecVmPlacementSpec.candidateNetworks` is + // specified with three network interfaces specified with the following + // networks: + // \- NIC 0: \[A, B, C\] + // \- NIC 1: \[B, E, F\] + // \- NIC 2: \[B, H, I\] + // If the available networks on the chosen cluster are B, F, and I, this + // field will contain \[B, F, I\] networks. + // + // Refers instances of `Network`. + AvailableNetworks []ManagedObjectReference `xml:"availableNetworks,omitempty" json:"availableNetworks,omitempty" vim:"9.1.0.0"` // The config spec of the virtual machine to be placed. // // The `Folder.PlaceVmsXCluster` method takes @@ -11246,11 +11330,19 @@ type ClusterComputeResourceSummary struct { // Valid values are enumerated by the `ClusterMaintenanceModeStatus` // type. ClusterMaintenanceModeStatus string `xml:"clusterMaintenanceModeStatus,omitempty" json:"clusterMaintenanceModeStatus,omitempty" vim:"7.0.0.2"` + // Deprecated as of vSphere 9.0 with no replacement. In a future release + // of vSphere, the vCLS functionality will be disabled, vCLS + // system VMs will be deleted, and vCLS APIs will be removed. + // // The health status of the vSphere Cluster Services in the cluster. // // Supported values are enumerated by the `VcsHealthStatus` // type. VcsHealthStatus string `xml:"vcsHealthStatus,omitempty" json:"vcsHealthStatus,omitempty" vim:"7.0.1.1"` + // Deprecated as of vSphere 9.0 with no replacement. In a future release + // of vSphere, the vCLS functionality will be disabled, vCLS + // system VMs will be deleted, and vCLS APIs will be removed. + // // An array of hosts and number of resource slots on the host for // vSphere Cluster Services in the cluster. // @@ -11292,6 +11384,11 @@ func init() { t["ClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ClusterComputeResourceValidationResultBase)(nil)).Elem() } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. +// +// Do not use. type ClusterComputeResourceVcsSlots struct { DynamicData @@ -11356,6 +11453,10 @@ func init() { type ClusterConfigInfoEx struct { ComputeResourceConfigInfo + // Deprecated as of vSphere 9.0 with no replacement. In a future release + // of vSphere, the vCLS functionality will be disabled, vCLS + // system VMs will be deleted, and vCLS APIs will be removed. + // // Configuration for vCLS system VMs deployment. SystemVMsConfig *ClusterSystemVMsConfigInfo `xml:"systemVMsConfig,omitempty" json:"systemVMsConfig,omitempty" vim:"7.0.3.0"` // Cluster-wide configuration of the vSphere HA service. @@ -11645,6 +11746,10 @@ func init() { type ClusterConfigSpecEx struct { ComputeResourceConfigSpec + // Deprecated as of vSphere 9.0 with no replacement. In a future release + // of vSphere, the vCLS functionality will be disabled, vCLS + // system VMs will be deleted, and vCLS APIs will be removed. + // // Configuration for vCLS system VMs deployment. SystemVMsConfig *ClusterSystemVMsConfigSpec `xml:"systemVMsConfig,omitempty" json:"systemVMsConfig,omitempty" vim:"7.0.3.0"` // HA configuration; includes default settings for virtual machines. @@ -11699,7 +11804,7 @@ type ClusterConfigSpecEx struct { // generated automatically per member hosts, which are identified // by using cluster reconfiguration task id as // `TaskInfo.parentTaskKey`, and should be monitored - // and tracked separatedly. + // and tracked separately. VsanConfig *VsanClusterConfigInfo `xml:"vsanConfig,omitempty" json:"vsanConfig,omitempty"` // VSAN configuration for individual hosts. // @@ -11880,6 +11985,8 @@ type ClusterDasAdmissionControlPolicy struct { // Percentage of resource reduction that a cluster of VMs can tolerate // in case of a failover. ResourceReductionToToleratePercent *int32 `xml:"resourceReductionToToleratePercent" json:"resourceReductionToToleratePercent,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Flag that determines whether strict admission control for persistent // memory is enabled. // @@ -12157,7 +12264,7 @@ type ClusterDasFailoverLevelAdvancedRuntimeInfo struct { TotalVms int32 `xml:"totalVms" json:"totalVms"` // The total number of hosts in the cluster. TotalHosts int32 `xml:"totalHosts" json:"totalHosts"` - // The total number of connected hosts that are not in maintance mode and that + // The total number of connected hosts that are not in maintenance mode and that // do not have any DAS-related config issues on them. TotalGoodHosts int32 `xml:"totalGoodHosts" json:"totalGoodHosts"` HostSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots `xml:"hostSlots,omitempty" json:"hostSlots,omitempty"` @@ -12433,6 +12540,10 @@ func init() { t["ClusterDasVmSettings"] = reflect.TypeOf((*ClusterDasVmSettings)(nil)).Elem() } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. +// // An incremental update to a Datastore list. type ClusterDatastoreUpdateSpec struct { ArrayUpdateSpec @@ -12446,7 +12557,7 @@ func init() { minAPIVersionForType["ClusterDatastoreUpdateSpec"] = "7.0.3.0" } -// The `ClusterDependencyRuleInfo` data object indentifies VM-to-VM +// The `ClusterDependencyRuleInfo` data object identifies VM-to-VM // dependencies. // // A VM-VM Dependency rule identifies the following groups. @@ -12471,7 +12582,7 @@ type ClusterDependencyRuleInfo struct { // machines. // `ClusterVmGroup*.*ClusterGroupInfo.name` VmGroup string `xml:"vmGroup" json:"vmGroup"` - // Depdendency virtual group name + // Dependency virtual group name // (`ClusterVmGroup*.*ClusterGroupInfo.name`). // // The virtual group may contain one or more virtual machines. @@ -12619,7 +12730,7 @@ type ClusterDrsConfigInfo struct { // To disable DRS load balancing, please use the lowest DRS aggressiveness // level, setting `ClusterDrsConfigInfo.vmotionRate` to 5, and/or // setting `ClusterDrsConfigInfo.defaultVmBehavior` to manual. - // The former only generates manadatory move recommendations, not load + // The former only generates mandatory move recommendations, not load // balancing recommendations. The latter only generates recommendations, // without executing them. // To remove all the child resource pools, please find the root resource @@ -12856,9 +12967,9 @@ func init() { // then three operations are provided for updating the DRS configuration for a virtual machine. // These operations are listed below (see `ArrayUpdateSpec` for more // information on these operations). -// - add: add a configuration for the virtual machine, overwritting the existing +// - add: add a configuration for the virtual machine, overwriting the existing // configuration if one exists -// - edit: incrmentally update the existing configuration; an existing configuration +// - edit: incrementally update the existing configuration; an existing configuration // must exist // - remove: remove the existing configuration; an existing configuration must exist // @@ -13052,7 +13163,7 @@ func init() { // or it has insufficient resources, HA attempts to restart those virtual // machines on another host in the cluster. // -// To support the availabilty of a failover host, +// To support the availability of a failover host, // the vCenter Server will prevent users from powering on virtual machines // on that host, or from using vMotion to migrate virtual machines to the host. // Also, DRS does not use the failover host for load balancing. @@ -13176,6 +13287,8 @@ type ClusterFailoverResourcesAdmissionControlInfo struct { CurrentCpuFailoverResourcesPercent int32 `xml:"currentCpuFailoverResourcesPercent" json:"currentCpuFailoverResourcesPercent"` // The percentage of memory resources in the cluster available for failover. CurrentMemoryFailoverResourcesPercent int32 `xml:"currentMemoryFailoverResourcesPercent" json:"currentMemoryFailoverResourcesPercent"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // The percentage of persistent memory resources in the cluster available // for failover. CurrentPMemFailoverResourcesPercent int32 `xml:"currentPMemFailoverResourcesPercent,omitempty" json:"currentPMemFailoverResourcesPercent,omitempty" vim:"7.0.2.0"` @@ -13236,11 +13349,15 @@ type ClusterFailoverResourcesAdmissionControlPolicy struct { // If users want to override the percentage values, // they must disable the auto-compute by setting this field to false. AutoComputePercentages *bool `xml:"autoComputePercentages" json:"autoComputePercentages,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Percentage of persistent memory resources in the cluster to reserve for // the failover. // // You can specify up to 100% of persistent memory resources for failover. PMemFailoverResourcesPercent int32 `xml:"pMemFailoverResourcesPercent,omitempty" json:"pMemFailoverResourcesPercent,omitempty" vim:"7.0.2.0"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Flag to enable user input values for // `ClusterFailoverResourcesAdmissionControlPolicy.pMemFailoverResourcesPercent` // By default, this is true and the default calculation is done using the @@ -13270,7 +13387,9 @@ func init() { } // An `ClusterFtVmHostRuleInfo` object provides control of the -// placement of virtual machines across two host groups. The virtual machines +// placement of virtual machines across two host groups. +// +// The virtual machines // and hosts referenced by an FT VM-Host rule must be in the same cluster. // // An FT VM-Host rule identifies the following groups. @@ -13519,7 +13638,7 @@ type ClusterIoFilterInfo struct { // The set of possible values are described in // `IoFilterOperation_enum`. // If opType is `uninstall`, - // and the uninstallation of the filter was sucessful on all the hosts + // and the uninstallation of the filter was successful on all the hosts // in the cluster, the filter will be removed from the cluster's filter // list. OpType string `xml:"opType" json:"opType"` @@ -13842,11 +13961,17 @@ func init() { type ClusterResourceUsageSummary struct { DynamicData - CpuUsedMHz int32 `xml:"cpuUsedMHz" json:"cpuUsedMHz"` - CpuCapacityMHz int32 `xml:"cpuCapacityMHz" json:"cpuCapacityMHz"` - MemUsedMB int32 `xml:"memUsedMB" json:"memUsedMB"` - MemCapacityMB int32 `xml:"memCapacityMB" json:"memCapacityMB"` - PMemAvailableMB int64 `xml:"pMemAvailableMB,omitempty" json:"pMemAvailableMB,omitempty"` + CpuUsedMHz int32 `xml:"cpuUsedMHz" json:"cpuUsedMHz"` + CpuCapacityMHz int32 `xml:"cpuCapacityMHz" json:"cpuCapacityMHz"` + MemUsedMB int32 `xml:"memUsedMB" json:"memUsedMB"` + MemCapacityMB int32 `xml:"memCapacityMB" json:"memCapacityMB"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // + // Do not use. + PMemAvailableMB int64 `xml:"pMemAvailableMB,omitempty" json:"pMemAvailableMB,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // + // Do not use. PMemCapacityMB int64 `xml:"pMemCapacityMB,omitempty" json:"pMemCapacityMB,omitempty"` StorageUsedMB int64 `xml:"storageUsedMB" json:"storageUsedMB"` StorageCapacityMB int64 `xml:"storageCapacityMB" json:"storageCapacityMB"` @@ -14013,6 +14138,10 @@ func init() { t["ClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. +// // Configuration for System VMs deployment. type ClusterSystemVMsConfigInfo struct { DynamicData @@ -14043,6 +14172,10 @@ func init() { minAPIVersionForType["ClusterSystemVMsConfigInfo"] = "7.0.3.0" } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. +// // Configuration for System VMs deployment. type ClusterSystemVMsConfigSpec struct { DynamicData @@ -14068,6 +14201,10 @@ func init() { minAPIVersionForType["ClusterSystemVMsConfigSpec"] = "7.0.3.0" } +// Deprecated as of vSphere 9.0 with no replacement. In a future release +// of vSphere, the vCLS functionality will be disabled, vCLS +// system VMs will be deleted, and vCLS APIs will be removed. +// // An incremental update to a TagCategory list. type ClusterTagCategoryUpdateSpec struct { ArrayUpdateSpec @@ -14147,7 +14284,7 @@ type ClusterVmComponentProtectionSettings struct { // // APD is a condition where a storage has become inaccessible // for unknown reasons. It only indicates loss of connectivity and does not indicate - // storage device failure or LUN removal (Permenant Device Loss or PDL). The details + // storage device failure or LUN removal (Permanent Device Loss or PDL). The details // of APD and PDL are described in `HostMountInfoInaccessibleReason_enum`. // // This property is meaningful only when vSphere HA is turned on. Valid values are @@ -14207,7 +14344,7 @@ type ClusterVmComponentProtectionSettings struct { // `none` for cluster setting and // `useClusterDefault` for per-VM setting. VmReactionOnAPDCleared string `xml:"vmReactionOnAPDCleared,omitempty" json:"vmReactionOnAPDCleared,omitempty"` - // VM storage protection setting for storage failures categorized as Permenant Device + // VM storage protection setting for storage failures categorized as Permanent Device // Loss (PDL). // // PDL indicates storage device failure or LUN removal. In case of PDL, @@ -14258,7 +14395,9 @@ func init() { } // A `ClusterVmHostRuleInfo` object identifies virtual machines -// and host groups that determine virtual machine placement. The virtual +// and host groups that determine virtual machine placement. +// +// The virtual // machines and hosts referenced by a VM-Host rule must be in the same cluster. // // A VM-Host rule identifies the following groups. @@ -14306,7 +14445,7 @@ func init() { // configuration for a single virtual machine. // // This makes it possible to -// override the defaut behavior for an individual virtual machine. +// override the default behavior for an individual virtual machine. type ClusterVmOrchestrationInfo struct { DynamicData @@ -14525,7 +14664,7 @@ func init() { type ComplianceLocator struct { DynamicData - // Exression for which the Locator corresponds to + // Expression for which the Locator corresponds to ExpressionName string `xml:"expressionName" json:"expressionName"` // Complete path to the profile/policy which was responsible for the // generation of the ComplianceExpression. @@ -14984,7 +15123,7 @@ type ConfigTarget struct { MaxCpusPerHost int32 `xml:"maxCpusPerHost,omitempty" json:"maxCpusPerHost,omitempty"` // Presence of System Management Controller, indicates the host is // Apple hardware, and thus capable of running Mac OS guest as VM. - SmcPresent *bool `xml:"smcPresent" json:"smcPresent,omitempty"` + SmcPresent bool `xml:"smcPresent" json:"smcPresent"` // List of datastores available for virtual disks and associated storage. Datastore []VirtualMachineDatastoreInfo `xml:"datastore,omitempty" json:"datastore,omitempty"` // List of networks available for virtual network adapters. @@ -15543,7 +15682,7 @@ type ConvertNamespacePathToUuidPathRequestType struct { // // Refers instance of `Datacenter`. Datacenter *ManagedObjectReference `xml:"datacenter,omitempty" json:"datacenter,omitempty"` - // Namesapce URL of the form + // Namespace URL of the form // > \[ds://\]/vmfs/volumes/\[_datastore-uuid_\]/\[_directory-name_\]/... // > NamespaceUrl string `xml:"namespaceUrl" json:"namespaceUrl"` @@ -15742,7 +15881,7 @@ type CpuIncompatible1ECX struct { // Flag to indicate bit 0 is incompatible. Sse3 bool `xml:"sse3" json:"sse3"` // Flag to indicate bit 1 is incompatible. - Pclmulqdq *bool `xml:"pclmulqdq" json:"pclmulqdq,omitempty"` + Pclmulqdq bool `xml:"pclmulqdq" json:"pclmulqdq"` // Flag to indicate bit 9 is incompatible. Ssse3 bool `xml:"ssse3" json:"ssse3"` // Flag to indicate bit 19 is incompatible. @@ -15750,7 +15889,7 @@ type CpuIncompatible1ECX struct { // Flag to indicate bit 20 is incompatible. Sse42 bool `xml:"sse42" json:"sse42"` // Flag to indicate bit 25 is incompatible. - Aes *bool `xml:"aes" json:"aes,omitempty"` + Aes bool `xml:"aes" json:"aes"` // Flag to indicate that bits other than 0/1/9/19/20/25 are incompatible. // // I.e. the detected incompatibilities cannot be completely described by @@ -16291,25 +16430,29 @@ type CreateDiskFromSnapshotRequestType struct { Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr" json:"profile,omitempty"` // Crypto information of the new disk. // If unset and if profile contains an encryption iofilter and - // if snapshto is unencrypted, then cyrpto will be of + // if snapshto is unencrypted, then crypto will be of // type CryptoSpecEncrypt, and filled with keyId that is // automatically generated and keyProviderId that is the // default kms cluster. // If unset and if profile is a default policy and if snapshot // is unenrypted, then crypto is treated as CryptoSpecNoOp. // If unset and if profile contains an encryption iofilter and - // if snapshot is encrypted, then cyrpto is treated as + // if snapshot is encrypted, then crypto is treated as // CryptoSpecNoOp. // If unset and if profile is a default policy and if - // snapshot is encrypted, then cyrpto is treated as + // snapshot is encrypted, then crypto is treated as // CryptoSpecDecrypt. // To recrypt the disk during creating disk, crypto has to be // present. Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr" json:"crypto,omitempty"` - // Relative location in the specified datastore where disk needs - // to be created. If not specified disk gets created at the - // defualt VStorageObject location on the specified datastore. + // Relative location where disk has to be created, used in + // `targetDatastore` and `datastore` parameters. + // If not specified disk gets created at default `VStorageObject` + // location of `targetDatastore` or `datastore`. Path string `xml:"path,omitempty" json:"path,omitempty"` + // Indicates whether a linkedClone Disk needs to be created + // from the snapshot. + IsLinkedClone *bool `xml:"isLinkedClone" json:"isLinkedClone,omitempty" vim:"9.1.0.0"` } func init() { @@ -17037,7 +17180,7 @@ func init() { // The parameters of `HostStorageSystem.CreateSoftwareAdapter`. type CreateSoftwareAdapterRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` - // A data object that specifices the parameters necessary + // A data object that specifies the parameters necessary // to create a software host bus adapter of a specific type. Spec BaseHostHbaCreateSpec `xml:"spec,typeattr" json:"spec"` } @@ -17984,7 +18127,7 @@ type CustomizationAdapterMapping struct { // In vSphere 7.0 series, the MAC addresses must be specified in the // ascending order of pciSlotNumber, otherwise a MAC address mismatch error // will be reported. For further details, see the - // https://knowledge.broadcom.com/external/article?articleNumber=312120 + // https://kb.vmware.com/s/article/87648 MacAddress string `xml:"macAddress,omitempty" json:"macAddress,omitempty"` // The IP settings for the associated virtual network adapter. Adapter CustomizationIPSettings `xml:"adapter" json:"adapter"` @@ -18013,13 +18156,13 @@ type CustomizationCloudinitPrep struct { // // It is in json or yaml format. // The max size of the metadata is 524288 bytes. - // See detail information about Instance Metadata. + // See detail information about Instance Metadata. Metadata string `xml:"metadata" json:"metadata"` // Userdata is the user custom content that cloud-init processes to // configure the VM. // // The max size of the userdata is 524288 bytes. - // See detail information about User-Data formats. + // See detail information about User-Data formats. Userdata string `xml:"userdata,omitempty" json:"userdata,omitempty"` } @@ -18095,6 +18238,16 @@ func init() { t["CustomizationDhcpIpV6Generator"] = reflect.TypeOf((*CustomizationDhcpIpV6Generator)(nil)).Elem() } +// Disable IPv4 configuration on the virtual network adapter. +type CustomizationDisableIpV4 struct { + CustomizationIpGenerator +} + +func init() { + t["CustomizationDisableIpV4"] = reflect.TypeOf((*CustomizationDisableIpV4)(nil)).Elem() + minAPIVersionForType["CustomizationDisableIpV4"] = "9.1.0.0" +} + // Base for customization events. type CustomizationEvent struct { VmEvent @@ -18208,7 +18361,7 @@ func init() { // The GuiRunOnce data object type maps to the GuiRunOnce key in the // `sysprep.xml` answer file. These values are transferred into the // `sysprep.xml` file that VirtualCenter stores on the target virtual disk. For -// more detailed information, see Performing Unattended Installations. +// more detailed information, see Performing Unattended Installations. type CustomizationGuiRunOnce struct { DynamicData @@ -18225,7 +18378,7 @@ func init() { // // These values are plugged directly into the `sysprep.xml` file // that VirtualCenter stores on the target virtual disk. For more detailed -// information, see Performing Unattended Installations. +// information, see Performing Unattended Installations. type CustomizationGuiUnattended struct { DynamicData @@ -18246,7 +18399,7 @@ type CustomizationGuiUnattended struct { // The time zone index for the virtual machine. // // Numbers correspond to time zones - // listed at Microsoft Time Zone Index Values. + // listed at Microsoft Time Zone Index Values. TimeZone int32 `xml:"timeZone" json:"timeZone"` // Flag to determine whether or not the machine automatically logs on as // Administrator. @@ -18307,6 +18460,24 @@ type CustomizationIPSettings struct { SecondaryWINS string `xml:"secondaryWINS,omitempty" json:"secondaryWINS,omitempty"` // NetBIOS setting for Windows. NetBIOS CustomizationNetBIOSMode `xml:"netBIOS,omitempty" json:"netBIOS,omitempty"` + // Flag to specify whether or not the virtual network adapter is primary. + // + // The primary NIC setting determines the default and only gateway for the virtual machine. + // The virtual machine can use any NIC to connect to virtual and physical machines + // that are directly connected to the same network as the NIC, + // but it can only use the primary NIC to connect to machines on networks that require a gateway connection. + // For more details about primary NIC settings, refer to the Primary NIC setting on virtual machines in vSphere. + // + // Guidelines for using the field: + // - Only one adapter should set the field to `true` + // if multiple adapters are present. + // - The adapter marked as primary must be configured with + // a static IP address and a static gateway. + // - If no adapter is explicitly marked as primary, + // the first adapter will be defaulted to be primary + // only when it's configured with a static IP address and a static gateway, + // otherwise no adapter will be treated as the primary. + Primary *bool `xml:"primary" json:"primary,omitempty" vim:"9.1.0.0"` } func init() { @@ -18333,7 +18504,7 @@ func init() { // The Identification data object type maps to the Identification key in the // `sysprep.xml` answer file. These values are transferred into the // `sysprep.xml` file that VirtualCenter stores on the target virtual disk. For -// more detailed information, see Performing Unattended Installations. +// more detailed information, see Performing Unattended Installations. type CustomizationIdentification struct { DynamicData @@ -18403,7 +18574,7 @@ func init() { // // These values are transferred into the // `sysprep.xml` file that VirtualCenter stores on the target virtual disk. For -// more detailed information, see Performing Unattended Installations. +// more detailed information, see Performing Unattended Installations. // LicenseFilePrintData provides licensing information for Windows server operating // systems. type CustomizationLicenseFilePrintData struct { @@ -18423,6 +18594,19 @@ func init() { t["CustomizationLicenseFilePrintData"] = reflect.TypeOf((*CustomizationLicenseFilePrintData)(nil)).Elem() } +// Flexible guest customization settings for Linux operating system. +// +// Flexible guest customization is designed for scenarios where only the +// network configuration of an operating system requires modification. +type CustomizationLinuxFlexPrep struct { + CustomizationIdentitySettings +} + +func init() { + t["CustomizationLinuxFlexPrep"] = reflect.TypeOf((*CustomizationLinuxFlexPrep)(nil)).Elem() + minAPIVersionForType["CustomizationLinuxFlexPrep"] = "9.1.0.0" +} + // Failed to set Linux identity. type CustomizationLinuxIdentityFailed struct { CustomizationFailed @@ -18456,14 +18640,14 @@ type CustomizationLinuxPrep struct { Domain string `xml:"domain" json:"domain"` // The case-sensitive timezone, such as Europe/Sofia. // - // + // // **Valid timeZone values** are based on the tz (timezone) // database used by Linux and other Unix systems. // The values are strings (xsd:string) in the form "Area/Location," in which // Area is a continent or ocean name, and Location is the city, island, or // other regional designation. // - // See the List of supported time zones for different vSphere versions in Linux/Unix systems. + // See the List of supported time zones for different vSphere versions in Linux/Unix systems. TimeZone string `xml:"timeZone,omitempty" json:"timeZone,omitempty"` // Specifies whether the hardware clock is in UTC or local time. // - True when the hardware clock is in UTC. @@ -18483,8 +18667,20 @@ type CustomizationLinuxPrep struct { // // Please set the compatible customization method to a supported string value // e.g. "GOSC\_METHOD\_1". - // See Supported compatible customization method list. + // See Supported compatible customization method list. CompatibleCustomizationMethod string `xml:"compatibleCustomizationMethod,omitempty" json:"compatibleCustomizationMethod,omitempty" vim:"8.0.3.0"` + // Require root accounts to change their password on first login after + // customization. + ResetPassword *bool `xml:"resetPassword" json:"resetPassword,omitempty" vim:"9.1.0.0"` + // Password set for root accounts. + // + // The password value must be a non-empty string. If this field is not set, + // the root password will remain unchanged. + // + // Set the plainText flag to indicate whether the value is plain text or encrypted. + Password *CustomizationPassword `xml:"password,omitempty" json:"password,omitempty" vim:"9.1.0.0"` + // Additional key/value pairs to support third party customization. + ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr" json:"extraConfig,omitempty" vim:"9.1.0.0"` } func init() { @@ -18581,7 +18777,8 @@ type CustomizationSpec struct { // Network identity and settings, similar to Microsoft's Sysprep tool. // // This is a - // Sysprep, LinuxPrep, CloudinitPrep, or SysprepText object. + // Sysprep, LinuxPrep, WindowsFlexPrep, LinuxFlexPrep, CloudinitPrep or + // SysprepText object. Identity BaseCustomizationIdentitySettings `xml:"identity,typeattr" json:"identity"` // Global IP settings constitute the IP settings that are not specific to a // particular virtual network adapter. @@ -18706,7 +18903,7 @@ func init() { // // The sysprep // type encloses all the individual keys listed in a `sysprep.xml` file. For -// more detailed information, see Performing Unattended Installations. +// more detailed information, see Performing Unattended Installations. type CustomizationSysprep struct { CustomizationIdentitySettings @@ -18723,6 +18920,16 @@ type CustomizationSysprep struct { // Required only // for Windows 2000 Server and Windows Server 2003. LicenseFilePrintData *CustomizationLicenseFilePrintData `xml:"licenseFilePrintData,omitempty" json:"licenseFilePrintData,omitempty"` + // The script to run before and after GOS customization. + // + // The script must be a batch file for Windows virtual machines. + // For additional information, refer to Setting the customization script for virtual machines in vSphere. + ScriptText string `xml:"scriptText,omitempty" json:"scriptText,omitempty" vim:"9.1.0.0"` + // Require local Administrators group accounts to change their password + // at the first logon after customization. + ResetPassword *bool `xml:"resetPassword" json:"resetPassword,omitempty" vim:"9.1.0.0"` + // Additional key/value pairs to support third party customization. + ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr" json:"extraConfig,omitempty" vim:"9.1.0.0"` } func init() { @@ -18757,8 +18964,8 @@ type CustomizationSysprepText struct { // Text for the `sysprep.xml` answer file. // - // For additional details, see Using custom sysprep.xml for vCenter Guest Customization and - // Specifying network settings in custom sysprep.xml. + // For additional details, see Using custom sysprep.xml for vCenter Guest Customization and + // Specifying network settings in custom sysprep.xml. Value string `xml:"value" json:"value"` } @@ -18816,7 +19023,7 @@ func init() { // The UserData data object type maps to the UserData key in the `sysprep.xml` // answer file. These values are transferred directly into the `sysprep.xml` // file that VirtualCenter stores on the target virtual disk. For more detailed -// information, see Performing Unattended Installations. +// information, see Performing Unattended Installations. type CustomizationUserData struct { DynamicData @@ -18893,6 +19100,19 @@ func init() { t["CustomizationWinOptions"] = reflect.TypeOf((*CustomizationWinOptions)(nil)).Elem() } +// Flexible guest customization settings for Windows operating system. +// +// Flexible guest customization is designed for scenarios where only the +// network configuration of an operating system requires modification. +type CustomizationWindowsFlexPrep struct { + CustomizationIdentitySettings +} + +func init() { + t["CustomizationWindowsFlexPrep"] = reflect.TypeOf((*CustomizationWindowsFlexPrep)(nil)).Elem() + minAPIVersionForType["CustomizationWindowsFlexPrep"] = "9.1.0.0" +} + // The parameters of `VirtualMachineGuestCustomizationManager.CustomizeGuest_Task`. type CustomizeGuestRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` @@ -18906,7 +19126,7 @@ type CustomizeGuestRequestType struct { // Is a `CustomizationSpec`. // It specifies the virtual machine's configuration. Spec CustomizationSpec `xml:"spec" json:"spec"` - // addtional key/value pair list to support + // additional key/value pair list to support // third party customization. ConfigParams []BaseOptionValue `xml:"configParams,omitempty,typeattr" json:"configParams,omitempty"` } @@ -19665,7 +19885,7 @@ type DVSConfigInfo struct { CreateTime time.Time `xml:"createTime" json:"createTime"` // Boolean to indicate if network I/O control is enabled on the // switch. - NetworkResourceManagementEnabled *bool `xml:"networkResourceManagementEnabled" json:"networkResourceManagementEnabled,omitempty"` + NetworkResourceManagementEnabled bool `xml:"networkResourceManagementEnabled" json:"networkResourceManagementEnabled"` // Default host proxy switch maximum port number DefaultProxySwitchMaxNumPorts int32 `xml:"defaultProxySwitchMaxNumPorts,omitempty" json:"defaultProxySwitchMaxNumPorts,omitempty"` // VDS health check configuration. @@ -19727,7 +19947,7 @@ type DVSConfigSpec struct { // deleting free standalone ports, a fault is raised. NumStandalonePorts int32 `xml:"numStandalonePorts,omitempty" json:"numStandalonePorts,omitempty"` // Deprecated as of vSphere API 5.0 - // The default value of this propoerty is maxint and there is no reason + // The default value of this property is maxint and there is no reason // for users to change it to a lower value. // // The maximum number of DistributedVirtualPorts allowed in the switch. @@ -20365,7 +20585,7 @@ type DVSNetworkResourceManagementCapability struct { UserDefinedNetworkResourcePoolsSupported bool `xml:"userDefinedNetworkResourcePoolsSupported" json:"userDefinedNetworkResourcePoolsSupported"` // Flag to indicate whether Network Resource Control version 3 is supported. // - // The API supported by Network Resouce Control version 3 include: + // The API supported by Network Resource Control version 3 include: // 1. VM virtual NIC network resource specification // `VirtualEthernetCardResourceAllocation` // 2. VM virtual NIC network resource pool specification @@ -21148,10 +21368,10 @@ type DatastoreCapability struct { // Deprecated as of vSphere8.0 U3, and there is no replacement for it. // // Indicates whether the datastore supports Storage I/O Resource Management. - StorageIORMSupported *bool `xml:"storageIORMSupported" json:"storageIORMSupported,omitempty"` + StorageIORMSupported bool `xml:"storageIORMSupported" json:"storageIORMSupported"` // Indicates whether the datastore supports native snapshot feature which is // based on Copy-On-Write. - NativeSnapshotSupported *bool `xml:"nativeSnapshotSupported" json:"nativeSnapshotSupported,omitempty"` + NativeSnapshotSupported bool `xml:"nativeSnapshotSupported" json:"nativeSnapshotSupported"` // Indicates whether the datastore supports traditional top-level // directory creation. // @@ -21404,7 +21624,7 @@ type DatastoreInfo struct { // The maximum capacity of a virtual disk which can be created on this volume. MaxVirtualDiskCapacity int64 `xml:"maxVirtualDiskCapacity,omitempty" json:"maxVirtualDiskCapacity,omitempty"` // The maximum size of a snapshot or a swap file that can reside on this file system volume. - MaxMemoryFileSize int64 `xml:"maxMemoryFileSize,omitempty" json:"maxMemoryFileSize,omitempty"` + MaxMemoryFileSize int64 `xml:"maxMemoryFileSize" json:"maxMemoryFileSize"` // Time when the free-space and capacity values in `DatastoreInfo` and // `DatastoreSummary` were updated. Timestamp *time.Time `xml:"timestamp" json:"timestamp,omitempty"` @@ -22128,6 +22348,8 @@ type DeleteVStorageObjectRequestType struct { // The datastore where the virtual storage object // is located. // + // Required privileges: Datastore.FileManagement + // // Refers instance of `Datastore`. Datastore ManagedObjectReference `xml:"datastore" json:"datastore"` } @@ -22895,7 +23117,7 @@ type DeviceUnsupportedForVmVersion struct { // The current version of the virtual machine. CurrentVersion string `xml:"currentVersion" json:"currentVersion"` - // The minimum expected virtual mahcine version needed to + // The minimum expected virtual machine version needed to // support this device. ExpectedVersion string `xml:"expectedVersion" json:"expectedVersion"` } @@ -23770,7 +23992,7 @@ type DisableRulesetResponse struct { // The parameters of `VirtualMachine.DisableSecondaryVM_Task`. type DisableSecondaryVMRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` - // The secondary virtual machine specified will be disabed. + // The secondary virtual machine specified will be disabled. // This field must specify a secondary virtual machine that is part of the fault // tolerant group that this virtual machine is currently associated with. It can // only be invoked from the primary virtual machine in the group. @@ -24387,7 +24609,7 @@ func init() { } // The `DistributedVirtualPortgroupProblem` -// data object defines the error while excuting NSX port group operations. +// data object defines the error while executing NSX port group operations. type DistributedVirtualPortgroupProblem struct { DynamicData @@ -25165,7 +25387,7 @@ type DpuStatusInfoOperationalInfo struct { // A description of the state of the sensor // such as: N watts, Y RPM, or other measurement. Reading string `xml:"reading" json:"reading"` - // If provided by underying API, the base units in which the sensor + // If provided by underlying API, the base units in which the sensor // reading is specified, "RPM", "WATTS" and so forth. Units string `xml:"units,omitempty" json:"units,omitempty"` // Reports the ISO 8601 Timestamp when this sensor was last updated by @@ -25336,6 +25558,8 @@ func init() { t["DrsResourceConfigureSyncedEvent"] = reflect.TypeOf((*DrsResourceConfigureSyncedEvent)(nil)).Elem() } +// Deprecated as of vSphere API 9.1, DRS no longer fires this event. +// // This event records when a virtual machine comes into compliance with DRS rules. type DrsRuleComplianceEvent struct { VmEvent @@ -25620,7 +25844,7 @@ func init() { t["DvsEvent"] = reflect.TypeOf((*DvsEvent)(nil)).Elem() } -// The event argument is a Host object. +// The event argument is a distributed virtual switch object. type DvsEventArgument struct { EntityEventArgument @@ -25653,7 +25877,7 @@ func init() { // This class defines Network Filter configuration. // // ** Supported Qualifier and Actions ** -// +//
// // // @@ -26522,7 +26746,7 @@ type DvsResourceRuntimeInfo struct { // This is the sum of all reservations // allocated to `DVSVmVnicNetworkResourcePool` on this switch and the // sum of reservation taken by `VirtualEthernetCard` whose - // backing is not associdated with any `DVSVmVnicNetworkResourcePool`. + // backing is not associated with any `DVSVmVnicNetworkResourcePool`. // Units in Mbits/s. Usage int32 `xml:"usage,omitempty" json:"usage,omitempty"` // Available: Current available resource for reservation (capacity - usage). @@ -26530,7 +26754,7 @@ type DvsResourceRuntimeInfo struct { // Units in Mbits/s. Available int32 `xml:"available,omitempty" json:"available,omitempty"` // The reservation taken by `VirtualEthernetCard` of which the - // backing is not associdated with any `DVSVmVnicNetworkResourcePool` + // backing is not associated with any `DVSVmVnicNetworkResourcePool` AllocatedResource []DvsVnicAllocatedResource `xml:"allocatedResource,omitempty" json:"allocatedResource,omitempty"` // The runtime information of `DVSVmVnicNetworkResourcePool`. VmVnicNetworkResourcePoolRuntime []DvsVmVnicNetworkResourcePoolRuntimeInfo `xml:"vmVnicNetworkResourcePoolRuntime,omitempty" json:"vmVnicNetworkResourcePoolRuntime,omitempty"` @@ -26625,7 +26849,7 @@ func init() { // This class defines Traffic Filter configuration. // // ** Supported Qualifier and Actions ** -//
Network Filter ConfigSupported classes
+//
// // // @@ -26864,7 +27088,7 @@ type DvsVmVnicNetworkResourcePoolRuntimeInfo struct { // Units in Mbits/s. Capacity int32 `xml:"capacity,omitempty" json:"capacity,omitempty"` // usage: Reservation taken by all `VirtualEthernetCard` for which the - // backing is associdated with this `DVSVmVnicNetworkResourcePool`. + // backing is associated with this `DVSVmVnicNetworkResourcePool`. // // Units in Mbits/s. Usage int32 `xml:"usage,omitempty" json:"usage,omitempty"` @@ -26887,7 +27111,7 @@ type DvsVmVnicNetworkResourcePoolRuntimeInfo struct { // is in good state. The reservations for all virtual network adapters can // be fulfilled. Status string `xml:"status" json:"status"` - // The virtual network adapaters that + // The virtual network adapters that // are currently associated with the resource pool AllocatedResource []DvsVnicAllocatedResource `xml:"allocatedResource,omitempty" json:"allocatedResource,omitempty"` } @@ -27289,7 +27513,7 @@ type EVCMode struct { // Use this property to compare track values from two modes. // Do not use this property to determine the presence or absence of // specific features. - Track []string `xml:"track,omitempty" json:"track,omitempty"` + Track []string `xml:"track" json:"track"` // Index for ordering the set of modes that apply to a given CPU vendor. // // Use this property to compare vendor tier values from two modes. @@ -30557,7 +30781,7 @@ type FileBackedVirtualDiskSpec struct { Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr" json:"crypto,omitempty"` // Optional sector format. // - // If not specified, an appropriate default format will be choosen by + // If not specified, an appropriate default format will be chosen by // the storage system. If available, native\_512 is preferred. // For the list of supported values, see `DatastoreSectorFormat_enum`. SectorFormat string `xml:"sectorFormat,omitempty" json:"sectorFormat,omitempty" vim:"9.0.0.0"` @@ -30751,7 +30975,7 @@ type FileQueryFlags struct { // last modified. Modification bool `xml:"modification" json:"modification"` // The flag to indicate whether or not to return the file owner. - FileOwner *bool `xml:"fileOwner" json:"fileOwner,omitempty"` + FileOwner bool `xml:"fileOwner" json:"fileOwner"` } func init() { @@ -31340,7 +31564,7 @@ type FolderFailedHostResult struct { // Host for which fault belongs to. // // Only set when the HostSystem - // reference is avaibale as a result of Host being part of inventory. + // reference is available as a result of Host being part of inventory. // // Refers instance of `HostSystem`. Host *ManagedObjectReference `xml:"host,omitempty" json:"host,omitempty"` @@ -32972,9 +33196,9 @@ type GuestOsDescriptor struct { // Maximum number of processors supported for this guest. SupportedMaxCPUs int32 `xml:"supportedMaxCPUs" json:"supportedMaxCPUs"` // Maximum number of sockets supported for this guest. - NumSupportedPhysicalSockets int32 `xml:"numSupportedPhysicalSockets,omitempty" json:"numSupportedPhysicalSockets,omitempty"` + NumSupportedPhysicalSockets int32 `xml:"numSupportedPhysicalSockets" json:"numSupportedPhysicalSockets"` // Maximum number of cores per socket for this guest. - NumSupportedCoresPerSocket int32 `xml:"numSupportedCoresPerSocket,omitempty" json:"numSupportedCoresPerSocket,omitempty"` + NumSupportedCoresPerSocket int32 `xml:"numSupportedCoresPerSocket" json:"numSupportedCoresPerSocket"` // Minimum memory requirements supported for this guest, in MB. SupportedMinMemMB int32 `xml:"supportedMinMemMB" json:"supportedMinMemMB"` // Maximum memory requirements supported for this guest, in MB. @@ -32994,7 +33218,7 @@ type GuestOsDescriptor struct { // Recommended default disk size for this guest, in MB. RecommendedDiskSizeMB int32 `xml:"recommendedDiskSizeMB" json:"recommendedDiskSizeMB"` // Recommended default CD-ROM type for this guest. - RecommendedCdromController string `xml:"recommendedCdromController,omitempty" json:"recommendedCdromController,omitempty"` + RecommendedCdromController string `xml:"recommendedCdromController" json:"recommendedCdromController"` // List of supported ethernet cards for this guest. SupportedEthernetCard []string `xml:"supportedEthernetCard" json:"supportedEthernetCard"` // Recommended default ethernet controller type for this guest. @@ -33004,67 +33228,67 @@ type GuestOsDescriptor struct { SupportsSlaveDisk *bool `xml:"supportsSlaveDisk" json:"supportsSlaveDisk,omitempty"` // Specifies the CPU feature compatibility masks. CpuFeatureMask []HostCpuIdInfo `xml:"cpuFeatureMask,omitempty" json:"cpuFeatureMask,omitempty"` - // Flag that indicates wether the guest requires an SMC (Apple hardware). + // Flag that indicates whether the guest requires an SMC (Apple hardware). // // This is logically equivalent to GuestOS = Mac OS - SmcRequired *bool `xml:"smcRequired" json:"smcRequired,omitempty"` + SmcRequired bool `xml:"smcRequired" json:"smcRequired"` // Flag to indicate whether or not this guest can support Wake-on-LAN. SupportsWakeOnLan bool `xml:"supportsWakeOnLan" json:"supportsWakeOnLan"` // Flag indicating whether or not this guest supports the virtual // machine interface. - SupportsVMI *bool `xml:"supportsVMI" json:"supportsVMI,omitempty"` + SupportsVMI bool `xml:"supportsVMI" json:"supportsVMI"` // Whether the memory size for this guest can be changed // while the virtual machine is running. - SupportsMemoryHotAdd *bool `xml:"supportsMemoryHotAdd" json:"supportsMemoryHotAdd,omitempty"` + SupportsMemoryHotAdd bool `xml:"supportsMemoryHotAdd" json:"supportsMemoryHotAdd"` // Whether virtual CPUs can be added to this guest // while the virtual machine is running. - SupportsCpuHotAdd *bool `xml:"supportsCpuHotAdd" json:"supportsCpuHotAdd,omitempty"` + SupportsCpuHotAdd bool `xml:"supportsCpuHotAdd" json:"supportsCpuHotAdd"` // Whether virtual CPUs can be removed from this guest // while the virtual machine is running. - SupportsCpuHotRemove *bool `xml:"supportsCpuHotRemove" json:"supportsCpuHotRemove,omitempty"` + SupportsCpuHotRemove bool `xml:"supportsCpuHotRemove" json:"supportsCpuHotRemove"` // Supported firmware types for this guest. // // Possible values are described in // `GuestOsDescriptorFirmwareType_enum` - SupportedFirmware []string `xml:"supportedFirmware,omitempty" json:"supportedFirmware,omitempty"` + SupportedFirmware []string `xml:"supportedFirmware" json:"supportedFirmware"` // Recommended firmware type for this guest. // // Possible values are described in // `GuestOsDescriptorFirmwareType_enum` - RecommendedFirmware string `xml:"recommendedFirmware,omitempty" json:"recommendedFirmware,omitempty"` + RecommendedFirmware string `xml:"recommendedFirmware" json:"recommendedFirmware"` // List of supported USB controllers for this guest. SupportedUSBControllerList []string `xml:"supportedUSBControllerList,omitempty" json:"supportedUSBControllerList,omitempty"` // Recommended default USB controller type for this guest. RecommendedUSBController string `xml:"recommendedUSBController,omitempty" json:"recommendedUSBController,omitempty"` // Whether this guest supports 3D graphics. - Supports3D *bool `xml:"supports3D" json:"supports3D,omitempty"` + Supports3D bool `xml:"supports3D" json:"supports3D"` // Recommended 3D graphics for this guest. - Recommended3D *bool `xml:"recommended3D" json:"recommended3D,omitempty"` + Recommended3D bool `xml:"recommended3D" json:"recommended3D"` // Whether SMC (Apple hardware) is recommended for this guest. - SmcRecommended *bool `xml:"smcRecommended" json:"smcRecommended,omitempty"` + SmcRecommended bool `xml:"smcRecommended" json:"smcRecommended"` // Whether I/O Controller Hub is recommended for this guest. - Ich7mRecommended *bool `xml:"ich7mRecommended" json:"ich7mRecommended,omitempty"` + Ich7mRecommended bool `xml:"ich7mRecommended" json:"ich7mRecommended"` // Whether USB controller is recommended for this guest. - UsbRecommended *bool `xml:"usbRecommended" json:"usbRecommended,omitempty"` + UsbRecommended bool `xml:"usbRecommended" json:"usbRecommended"` // Support level of this Guest // Possible values are described in // `GuestOsDescriptorSupportLevel_enum` - SupportLevel string `xml:"supportLevel,omitempty" json:"supportLevel,omitempty"` + SupportLevel string `xml:"supportLevel" json:"supportLevel"` // Whether or not this guest should be allowed for selection // during virtual machine creation. - SupportedForCreate *bool `xml:"supportedForCreate" json:"supportedForCreate,omitempty"` + SupportedForCreate bool `xml:"supportedForCreate" json:"supportedForCreate"` // Video RAM size limits supported by this guest, in KB. - VRAMSizeInKB *IntOption `xml:"vRAMSizeInKB,omitempty" json:"vRAMSizeInKB,omitempty"` + VRAMSizeInKB IntOption `xml:"vRAMSizeInKB" json:"vRAMSizeInKB"` // Maximum number of floppies supported by this guest. - NumSupportedFloppyDevices int32 `xml:"numSupportedFloppyDevices,omitempty" json:"numSupportedFloppyDevices,omitempty"` + NumSupportedFloppyDevices int32 `xml:"numSupportedFloppyDevices" json:"numSupportedFloppyDevices"` // List of NICs supported by this guest that support Wake-On-Lan. WakeOnLanEthernetCard []string `xml:"wakeOnLanEthernetCard,omitempty" json:"wakeOnLanEthernetCard,omitempty"` // Whether or not this guest can use pvscsi as boot adapter. - SupportsPvscsiControllerForBoot *bool `xml:"supportsPvscsiControllerForBoot" json:"supportsPvscsiControllerForBoot,omitempty"` + SupportsPvscsiControllerForBoot bool `xml:"supportsPvscsiControllerForBoot" json:"supportsPvscsiControllerForBoot"` // Whether or not this guest should have disk uuid enabled by default. - DiskUuidEnabled *bool `xml:"diskUuidEnabled" json:"diskUuidEnabled,omitempty"` + DiskUuidEnabled bool `xml:"diskUuidEnabled" json:"diskUuidEnabled"` // Whether or not this guest supports hot plug of PCI devices. - SupportsHotPlugPCI *bool `xml:"supportsHotPlugPCI" json:"supportsHotPlugPCI,omitempty"` + SupportsHotPlugPCI bool `xml:"supportsHotPlugPCI" json:"supportsHotPlugPCI"` // Whether or not this guest supports Secure Boot. // // If some of the OS @@ -33767,7 +33991,7 @@ type HasPrivilegeOnEntitiesRequestType struct { // // Refers instances of `ManagedEntity`. Entity []ManagedObjectReference `xml:"entity" json:"entity"` - // The session ID to check privileges for. A sesssion ID can be + // The session ID to check privileges for. A session ID can be // obtained from `UserSession.key`. SessionId string `xml:"sessionId" json:"sessionId"` // The array of privilege IDs to check. @@ -33797,7 +34021,7 @@ type HasPrivilegeOnEntityRequestType struct { // // Refers instance of `ManagedEntity`. Entity ManagedObjectReference `xml:"entity" json:"entity"` - // The session ID to check privileges for. A sesssion ID can be + // The session ID to check privileges for. A session ID can be // obtained from `UserSession.key`. SessionId string `xml:"sessionId" json:"sessionId"` // The array of privilege IDs to check. @@ -34334,7 +34558,7 @@ type HostActiveDirectorySpec struct { // and the userName and password fields // will be ignored. CamServer string `xml:"camServer,omitempty" json:"camServer,omitempty"` - // Thumbprint for the SSL certficate of CAM server + // Thumbprint for the SSL certificate of CAM server Thumbprint string `xml:"thumbprint,omitempty" json:"thumbprint,omitempty"` // PEM-encoded certificate of the CAM server // This field replaces `HostActiveDirectorySpec.thumbprint`. @@ -34822,7 +35046,7 @@ type HostCapability struct { // `VirtualDevice.unitNumber` // This property is only available for devices on the pci controller. PreAssignedPCIUnitNumbersSupported bool `xml:"preAssignedPCIUnitNumbersSupported" json:"preAssignedPCIUnitNumbersSupported"` - // Indicates whether the screenshot retrival over https is supported for this host's + // Indicates whether the screenshot retrieval over https is supported for this host's // virtual machines. // // If true, a screenshot can be retrieved at the HTTPS relative path @@ -34844,11 +35068,11 @@ type HostCapability struct { ScaledScreenshotSupported bool `xml:"scaledScreenshotSupported" json:"scaledScreenshotSupported"` // Indicates whether the storage of a powered-on virtual machine may be // relocated. - StorageVMotionSupported *bool `xml:"storageVMotionSupported" json:"storageVMotionSupported,omitempty"` + StorageVMotionSupported bool `xml:"storageVMotionSupported" json:"storageVMotionSupported"` // Indicates whether the storage of a powered-on virtual machine may be // relocated while simultaneously changing the execution host of the // virtual machine. - VmotionWithStorageVMotionSupported *bool `xml:"vmotionWithStorageVMotionSupported" json:"vmotionWithStorageVMotionSupported,omitempty"` + VmotionWithStorageVMotionSupported bool `xml:"vmotionWithStorageVMotionSupported" json:"vmotionWithStorageVMotionSupported"` // Indicates whether the network of a powered-on virtual machine can be // changed while simultaneously changing the execution host of the // virtual machine. @@ -34863,14 +35087,14 @@ type HostCapability struct { MaxVirtualDiskDescVersionSupported int32 `xml:"maxVirtualDiskDescVersionSupported,omitempty" json:"maxVirtualDiskDescVersionSupported,omitempty" vim:"8.0.1.0"` // Indicates whether a dedicated nic can be selected for vSphere Replication // LWD traffic, i.e., from the primary host to the VR server. - HbrNicSelectionSupported *bool `xml:"hbrNicSelectionSupported" json:"hbrNicSelectionSupported,omitempty"` + HbrNicSelectionSupported bool `xml:"hbrNicSelectionSupported" json:"hbrNicSelectionSupported"` // Indicates whether a dedicated nic can be selected for vSphere Replication // NFC traffic, i.e., from the VR server to the secondary host. - VrNfcNicSelectionSupported *bool `xml:"vrNfcNicSelectionSupported" json:"vrNfcNicSelectionSupported,omitempty"` + VrNfcNicSelectionSupported bool `xml:"vrNfcNicSelectionSupported" json:"vrNfcNicSelectionSupported"` // Deprecated as of vSphere API 6.0. // // Indicates whether this host supports record and replay - RecordReplaySupported *bool `xml:"recordReplaySupported" json:"recordReplaySupported,omitempty"` + RecordReplaySupported bool `xml:"recordReplaySupported" json:"recordReplaySupported"` // Deprecated as of vSphere API 6.0. // // Indicates whether this host supports Fault Tolerance @@ -34891,7 +35115,7 @@ type HostCapability struct { // contain values for this property when some other property on the DataObject changes. // If this update is a result of a call to WaitForUpdatesEx with a non-empty // version parameter, the value for this property may not be current. - FtSupported *bool `xml:"ftSupported" json:"ftSupported,omitempty"` + FtSupported bool `xml:"ftSupported" json:"ftSupported"` // Deprecated as of vSphere API 4.1, use // `HostCapability.replayCompatibilityIssues`. // @@ -34910,7 +35134,7 @@ type HostCapability struct { // lists the set of possible values. ReplayCompatibilityIssues []string `xml:"replayCompatibilityIssues,omitempty" json:"replayCompatibilityIssues,omitempty"` // Indicates whether this host supports smp fault tolerance - SmpFtSupported *bool `xml:"smpFtSupported" json:"smpFtSupported,omitempty"` + SmpFtSupported bool `xml:"smpFtSupported" json:"smpFtSupported"` // Deprecated as of vSphere API 6.0. // // For a host which doesn't support Fault Tolerance, indicates all the reasons @@ -34937,8 +35161,8 @@ type HostCapability struct { // destination host for the clone. // // See also `VirtualMachineCloneSpec.snapshot`. - CloneFromSnapshotSupported *bool `xml:"cloneFromSnapshotSupported" json:"cloneFromSnapshotSupported,omitempty"` - // Flag indicating whether explicitly creating arbirary configurations of + CloneFromSnapshotSupported bool `xml:"cloneFromSnapshotSupported" json:"cloneFromSnapshotSupported"` + // Flag indicating whether explicitly creating arbitrary configurations of // delta disk backings is supported. // // A delta disk backing is a way to preserve a virtual disk backing @@ -34958,13 +35182,13 @@ type HostCapability struct { // virtual machines will not affect the operation of the other virtual machine. // // See also `VirtualDiskSparseVer1BackingInfo.parent`, `VirtualDiskSparseVer2BackingInfo.parent`, `VirtualDiskFlatVer1BackingInfo.parent`, `VirtualDiskFlatVer2BackingInfo.parent`, `VirtualDiskRawDiskMappingVer1BackingInfo.parent`, `VirtualMachine.PromoteDisks_Task`, `VirtualMachineRelocateSpec.diskMoveType`, `VirtualMachineRelocateSpecDiskLocator.diskMoveType`. - DeltaDiskBackingsSupported *bool `xml:"deltaDiskBackingsSupported" json:"deltaDiskBackingsSupported,omitempty"` + DeltaDiskBackingsSupported bool `xml:"deltaDiskBackingsSupported" json:"deltaDiskBackingsSupported"` // Indicates whether network traffic shaping on a // per virtual machine basis is supported. - PerVMNetworkTrafficShapingSupported *bool `xml:"perVMNetworkTrafficShapingSupported" json:"perVMNetworkTrafficShapingSupported,omitempty"` + PerVMNetworkTrafficShapingSupported bool `xml:"perVMNetworkTrafficShapingSupported" json:"perVMNetworkTrafficShapingSupported"` // Flag indicating whether this host supports the integrity measurement using // a TPM device. - TpmSupported *bool `xml:"tpmSupported" json:"tpmSupported,omitempty"` + TpmSupported bool `xml:"tpmSupported" json:"tpmSupported"` // TPM version if supported by this host. TpmVersion string `xml:"tpmVersion,omitempty" json:"tpmVersion,omitempty"` // Flag indicating whether Intel TXT is enabled on this host. @@ -34985,12 +35209,12 @@ type HostCapability struct { SupportedCpuFeature []HostCpuIdInfo `xml:"supportedCpuFeature,omitempty" json:"supportedCpuFeature,omitempty"` // Indicates whether the host supports configuring hardware // virtualization (HV) support for virtual machines. - VirtualExecUsageSupported *bool `xml:"virtualExecUsageSupported" json:"virtualExecUsageSupported,omitempty"` + VirtualExecUsageSupported bool `xml:"virtualExecUsageSupported" json:"virtualExecUsageSupported"` // Deprecated as of vSphere8.0 U3, and there is no replacement for it. // // Indicates whether the host supports storage I/O resource // management. - StorageIORMSupported *bool `xml:"storageIORMSupported" json:"storageIORMSupported,omitempty"` + StorageIORMSupported bool `xml:"storageIORMSupported" json:"storageIORMSupported"` // Deprecated as of vSphere API 8.0. VMDirectPath Gen 2 is no longer supported and // there is no replacement. // @@ -35034,7 +35258,7 @@ type HostCapability struct { SupportedVmfsMajorVersion []int32 `xml:"supportedVmfsMajorVersion,omitempty" json:"supportedVmfsMajorVersion,omitempty"` // Indicates whether the host supports vStorage Hardware // acceleration. - VStorageCapable *bool `xml:"vStorageCapable" json:"vStorageCapable,omitempty"` + VStorageCapable bool `xml:"vStorageCapable" json:"vStorageCapable"` // Indicates whether this host supports unrestricted relocation of virtual // machines with snapshots. // @@ -35043,7 +35267,7 @@ type HostCapability struct { // restrict the layout of snapshot files or disks of the virtual machine, nor // its power state. If the virtual machine is powered on, a storage vmotion // will be performed to relocate its snapshots and disks. - SnapshotRelayoutSupported *bool `xml:"snapshotRelayoutSupported" json:"snapshotRelayoutSupported,omitempty"` + SnapshotRelayoutSupported bool `xml:"snapshotRelayoutSupported" json:"snapshotRelayoutSupported"` // Indicates whether this host supports ip address based restrictions in // the firewall configuration. FirewallIpRulesSupported *bool `xml:"firewallIpRulesSupported" json:"firewallIpRulesSupported,omitempty"` @@ -35067,32 +35291,32 @@ type HostCapability struct { MaxHostSupportedVcpus int32 `xml:"maxHostSupportedVcpus,omitempty" json:"maxHostSupportedVcpus,omitempty"` // Indicates whether the host is capable of mounting/unmounting // VMFS datastores. - VmfsDatastoreMountCapable *bool `xml:"vmfsDatastoreMountCapable" json:"vmfsDatastoreMountCapable,omitempty"` + VmfsDatastoreMountCapable bool `xml:"vmfsDatastoreMountCapable" json:"vmfsDatastoreMountCapable"` // Indicates whether the host is capable of accessing a VMFS disk // when there are eight or more hosts accessing the disk already. - EightPlusHostVmfsSharedAccessSupported *bool `xml:"eightPlusHostVmfsSharedAccessSupported" json:"eightPlusHostVmfsSharedAccessSupported,omitempty"` + EightPlusHostVmfsSharedAccessSupported bool `xml:"eightPlusHostVmfsSharedAccessSupported" json:"eightPlusHostVmfsSharedAccessSupported"` // Indicates whether the host supports nested hardware-assisted virtualization. - NestedHVSupported *bool `xml:"nestedHVSupported" json:"nestedHVSupported,omitempty"` + NestedHVSupported bool `xml:"nestedHVSupported" json:"nestedHVSupported"` // Indicates whether the host supports virtual CPU performance counters. - VPMCSupported *bool `xml:"vPMCSupported" json:"vPMCSupported,omitempty"` + VPMCSupported bool `xml:"vPMCSupported" json:"vPMCSupported"` // Indicates whether the host supports VMCI for communication // between virtual machines. - InterVMCommunicationThroughVMCISupported *bool `xml:"interVMCommunicationThroughVMCISupported" json:"interVMCommunicationThroughVMCISupported,omitempty"` + InterVMCommunicationThroughVMCISupported bool `xml:"interVMCommunicationThroughVMCISupported" json:"interVMCommunicationThroughVMCISupported"` // Indicates whether the host supports scheduled hardware upgrades. // // See also `VirtualMachineConfigInfo.scheduledHardwareUpgradeInfo`. ScheduledHardwareUpgradeSupported *bool `xml:"scheduledHardwareUpgradeSupported" json:"scheduledHardwareUpgradeSupported,omitempty"` // Indicated whether the host supports feature capabilities // for EVC mode. - FeatureCapabilitiesSupported *bool `xml:"featureCapabilitiesSupported" json:"featureCapabilitiesSupported,omitempty"` + FeatureCapabilitiesSupported bool `xml:"featureCapabilitiesSupported" json:"featureCapabilitiesSupported"` // Indicates whether the host supports latency sensitivity for the // virtual machines. - LatencySensitivitySupported *bool `xml:"latencySensitivitySupported" json:"latencySensitivitySupported,omitempty"` + LatencySensitivitySupported bool `xml:"latencySensitivitySupported" json:"latencySensitivitySupported"` // Indicates that host supports Object-based Storage System and // Storage-Profile based disk provisioning. StoragePolicySupported *bool `xml:"storagePolicySupported" json:"storagePolicySupported,omitempty"` // Indicates if 3D hardware acceleration for virtual machines is supported. - Accel3dSupported *bool `xml:"accel3dSupported" json:"accel3dSupported,omitempty"` + Accel3dSupported bool `xml:"accel3dSupported" json:"accel3dSupported"` // Indicates that this host uses a reliable memory aware allocation policy. ReliableMemoryAware *bool `xml:"reliableMemoryAware" json:"reliableMemoryAware,omitempty"` // Indicates whether the host supports Multiple Instance TCP/IP stack @@ -35110,7 +35334,7 @@ type HostCapability struct { HostAccessManagerSupported *bool `xml:"hostAccessManagerSupported" json:"hostAccessManagerSupported,omitempty"` // Indicates whether a dedicated nic can be selected for vSphere Provisioning // NFC traffic. - ProvisioningNicSelectionSupported *bool `xml:"provisioningNicSelectionSupported" json:"provisioningNicSelectionSupported,omitempty"` + ProvisioningNicSelectionSupported bool `xml:"provisioningNicSelectionSupported" json:"provisioningNicSelectionSupported"` // Whether this host supports NFS41 file systems. Nfs41Supported *bool `xml:"nfs41Supported" json:"nfs41Supported,omitempty"` // Whether this host support NFS41 Kerberos 5\* security type. @@ -35139,10 +35363,14 @@ type HostCapability struct { // // See also `HostActiveDirectoryAuthentication.EnableSmartCardAuthentication`. SmartCardAuthenticationSupported *bool `xml:"smartCardAuthenticationSupported" json:"smartCardAuthenticationSupported,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Indicates whether this host supports persistent memory. // // If value is not specified, it should be considered as not supported. PMemSupported *bool `xml:"pMemSupported" json:"pMemSupported,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Indicates whether this host supports snapshots for VMs with virtual // devices backed by persistent memory. // @@ -35276,6 +35504,8 @@ type HostCapability struct { // See `HostStorageSystem.ConnectNvmeControllerEx_Task` and // `HostStorageSystem.DisconnectNvmeControllerEx_Task`. NvmeBatchOperationsSupported *bool `xml:"nvmeBatchOperationsSupported" json:"nvmeBatchOperationsSupported,omitempty" vim:"7.0.3.0"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Indicates whether this host supports failover for VMs with virtual // devices backed by persistent memory. // @@ -35301,6 +35531,8 @@ type HostCapability struct { MaxSupportedPtpPorts int32 `xml:"maxSupportedPtpPorts,omitempty" json:"maxSupportedPtpPorts,omitempty" vim:"7.0.3.0"` // Indicates whether this host supports SGX registration. SgxRegistrationSupported *bool `xml:"sgxRegistrationSupported" json:"sgxRegistrationSupported,omitempty" vim:"8.0.0.1"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Indicates whether this host supports snapshots of VMs configured // with independent vNVDIMMs. // @@ -35363,8 +35595,8 @@ type HostCapability struct { NpivSupported *bool `xml:"npivSupported" json:"npivSupported,omitempty" vim:"9.0.0.0"` // Indicates whether this host supports license entitlements EntitlementSupported *bool `xml:"entitlementSupported" json:"entitlementSupported,omitempty" vim:"9.0.0.0"` - // Contains the memory overhead info for PodVMs for this host. - PodVMOverheadInfo *PodVMOverheadInfo `xml:"podVMOverheadInfo" vim:"9.0.1.0"` + // Indicates whether "FCD Linked Clone feature" supported on this host. + FcdLinkedCloneSupported *bool `xml:"fcdLinkedCloneSupported" json:"fcdLinkedCloneSupported,omitempty" vim:"9.1.0.0"` } func init() { @@ -35897,7 +36129,7 @@ type HostConfigInfo struct { SharedPassthruGpuTypes []string `xml:"sharedPassthruGpuTypes,omitempty" json:"sharedPassthruGpuTypes,omitempty"` // Graphics configuration for a host. GraphicsConfig *HostGraphicsConfig `xml:"graphicsConfig,omitempty" json:"graphicsConfig,omitempty"` - // Array of shared passthru GPU capablities. + // Array of shared passthru GPU capabilities. // // See also `HostSharedGpuCapabilities`. SharedGpuCapabilities []HostSharedGpuCapabilities `xml:"sharedGpuCapabilities,omitempty" json:"sharedGpuCapabilities,omitempty"` @@ -36166,7 +36398,7 @@ type HostConfigSummary struct { // The flag to indicate whether or not VMotion is enabled on this host. VmotionEnabled bool `xml:"vmotionEnabled" json:"vmotionEnabled"` // The flag to indicate whether or not Fault Tolerance logging is enabled on this host. - FaultToleranceEnabled *bool `xml:"faultToleranceEnabled" json:"faultToleranceEnabled,omitempty"` + FaultToleranceEnabled bool `xml:"faultToleranceEnabled" json:"faultToleranceEnabled"` // List of feature-specific version information. // // Each element refers @@ -36226,7 +36458,7 @@ func init() { type HostConfigureVFlashResourceResponse struct { } -// A base clase for faults that are related to connecting or +// A base class for faults that are related to connecting or // adding a host to the inventory. type HostConnectFault struct { VimFault @@ -36414,7 +36646,7 @@ type HostConnectSpec struct { // // Setting for a gateway for communication to the host. // - // If set all trafic to the + // If set all traffic to the // host will pass through this gateway. HostGateway *HostGatewaySpec `xml:"hostGateway,omitempty" json:"hostGateway,omitempty"` } @@ -36452,7 +36684,7 @@ func init() { // should be used only to mask hardware version 8 and lower (older) // virtual machines. Although CpuIdInfo can mask all virtual machines // regardless of hardware version, its application is limited and has been -// superceded by FeatureMask. +// superseded by FeatureMask. // // For each register (eax,ebx,ecx,edx), the string is a bit mask of the form: // @@ -36880,7 +37112,7 @@ type HostDatastoreSystemCapabilities struct { // Indicates whether local datastores are supported. LocalDatastoreSupported bool `xml:"localDatastoreSupported" json:"localDatastoreSupported"` // Indicates whether vmfs extent expansion is supported. - VmfsExtentExpansionSupported *bool `xml:"vmfsExtentExpansionSupported" json:"vmfsExtentExpansionSupported,omitempty"` + VmfsExtentExpansionSupported bool `xml:"vmfsExtentExpansionSupported" json:"vmfsExtentExpansionSupported"` } func init() { @@ -38117,7 +38349,7 @@ func init() { // This is a base type for derived types // that have more specific details about specific filesystem types. // -// # Typically a FileSystem is exposed as a datatore +// # Typically a FileSystem is exposed as a datastore // // See also `DatastoreInfo`, `HostVmfsVolume`, `HostNasVolume`, `HostVffsVolume`, `HostLocalFileSystemVolume` // @@ -38585,7 +38817,7 @@ type HostHardwareInfo struct { NumaInfo *HostNumaInfo `xml:"numaInfo,omitempty" json:"numaInfo,omitempty"` // Presence of System Management Controller, indicates the host is // Apple hardware, and thus capable of running Mac OS guest as VM. - SmcPresent *bool `xml:"smcPresent" json:"smcPresent,omitempty"` + SmcPresent bool `xml:"smcPresent" json:"smcPresent"` // The list of Peripheral Component Interconnect (PCI) devices // available on this host. PciDevice []HostPciDevice `xml:"pciDevice,omitempty" json:"pciDevice,omitempty"` @@ -39234,9 +39466,9 @@ type HostInternetScsiHbaIPCapabilities struct { HostNameAsTargetAddress *bool `xml:"hostNameAsTargetAddress" json:"hostNameAsTargetAddress,omitempty"` // True if the host bus adapter supports setting its name and alias NameAliasSettable *bool `xml:"nameAliasSettable" json:"nameAliasSettable,omitempty"` - // True if IPv4 addresssing can be enabled or disabled on the host bus adapter. + // True if IPv4 addressing can be enabled or disabled on the host bus adapter. Ipv4EnableSettable *bool `xml:"ipv4EnableSettable" json:"ipv4EnableSettable,omitempty"` - // True if IPv6 addresssing can be enabled or disabled on the host bus adapter. + // True if IPv6 addressing can be enabled or disabled on the host bus adapter. Ipv6EnableSettable *bool `xml:"ipv6EnableSettable" json:"ipv6EnableSettable,omitempty"` // True if the Host bus adapter supports setting IPv6 Prefix Length. Ipv6PrefixLengthSettable *bool `xml:"ipv6PrefixLengthSettable" json:"ipv6PrefixLengthSettable,omitempty"` @@ -39649,7 +39881,7 @@ func init() { type HostIpConfigIpV6AddressConfiguration struct { DynamicData - // Ipv6 adrresses configured on the interface. + // Ipv6 addresses configured on the interface. // // The global addresses can be configured // through DHCP, stateless or manual configuration. Link local addresses can be @@ -40075,6 +40307,8 @@ type HostListSummaryQuickStats struct { DistributedCpuFairness int32 `xml:"distributedCpuFairness,omitempty" json:"distributedCpuFairness,omitempty"` // The fairness of distributed memory resource allocation on the host. DistributedMemoryFairness int32 `xml:"distributedMemoryFairness,omitempty" json:"distributedMemoryFairness,omitempty"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // The available capacity in MB. AvailablePMemCapacity int32 `xml:"availablePMemCapacity,omitempty" json:"availablePMemCapacity,omitempty"` // The system uptime of the host in seconds. @@ -40283,7 +40517,7 @@ type HostLowLevelProvisioningManagerVmMigrationStatus struct { // completed successfully. // // More specifically, for an in-progress migration, it is considered - // successful if it has had a sucessful switch over, otherwise it is + // successful if it has had a successful switch over, otherwise it is // considered unsuccessful. Likewise, the status of a completed // migration operation is also based on the switch over completion // status. @@ -40555,7 +40789,7 @@ type HostMountInfo struct { // If the datastore becomes accessible following an inaccessible condition, // the property `HostMountInfo.inaccessibleReason` will be unset. InaccessibleReason string `xml:"inaccessibleReason,omitempty" json:"inaccessibleReason,omitempty"` - // The name of the vmknic used during mount for NFSv3 datstore. + // The name of the vmknic used during mount for NFSv3 datastore. // // Populated by the vmk control layer if the NAS // volume is mounted successfully with a vmknic binding. @@ -40653,7 +40887,7 @@ type HostMultipathInfoHppLogicalUnitPolicy struct { Iops int64 `xml:"iops,omitempty" json:"iops,omitempty"` // The preferred path for the given device. // - // If no prefered path is specified by the user, algorithem at ESX + // If no preferred path is specified by the user, algorithm at ESX // side will choose the random possible path. Path string `xml:"path,omitempty" json:"path,omitempty"` // This value can control at what interval (in ms) the latency of @@ -41022,16 +41256,15 @@ type HostNasVolumeSpec struct { // Name of the vmknic to be used by this mount. // // This field will be updated by a client with vmknic that will be used - // for NAS volume mount operation for vmknic binding for NFSv3 + // for NAS volume mount operation for vmknic binding. VmknicToBind string `xml:"vmknicToBind,omitempty" json:"vmknicToBind,omitempty" vim:"8.0.1.0"` // Indicates whether a client wants to bind this mount to vmknic. // // This field will be set to true by a client if vmknic should bind - // during NAS volume mount operation for NFSv3 - // else it will be set to false + // during NAS volume mount operation, else it will be set to false. VmknicBound *bool `xml:"vmknicBound" json:"vmknicBound,omitempty" vim:"8.0.1.0"` // Indicates the number of TCP connections for the particular - // NFSv3 Server during NAS volume mount operation. + // NFS Server during NAS volume mount operation. // // If unset or set to 0, it defaults to one connection Connections int32 `xml:"connections,omitempty" json:"connections,omitempty" vim:"8.0.1.0"` @@ -41263,7 +41496,7 @@ type HostNetCapabilities struct { DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported" json:"dhcpOnVnicSupported"` // The flag to indicate whether the host is capable of communicating // using ipv6 protocol - IpV6Supported *bool `xml:"ipV6Supported" json:"ipV6Supported,omitempty"` + IpV6Supported bool `xml:"ipV6Supported" json:"ipV6Supported"` // The flag to indicate whether the host supports Backup NFC NIOC system // traffic, Unset means Backup NFC NIOC system traffic is not supported. BackupNfcNiocSupported *bool `xml:"backupNfcNiocSupported" json:"backupNfcNiocSupported,omitempty" vim:"7.0.1.0"` @@ -42445,7 +42678,7 @@ type HostNvmeOpaqueTransportParameters struct { // // Corresponds to the TRTYPE field in the Discovery Log Page Entry // as specified by the NVME over Fabrics spec. - // The set of possible values is desribed in `HostNvmeTransportType_enum`. + // The set of possible values is described in `HostNvmeTransportType_enum`. Trtype string `xml:"trtype" json:"trtype"` // The transport address. // @@ -42711,6 +42944,8 @@ func init() { t["HostOvercommittedEvent"] = reflect.TypeOf((*HostOvercommittedEvent)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // The VMFS file system. type HostPMemVolume struct { HostFileSystemVolume @@ -43077,7 +43312,7 @@ type HostPersistentMemoryInfo struct { // Amount of configured persistent memory available on a host in MB. CapacityInMB int64 `xml:"capacityInMB,omitempty" json:"capacityInMB,omitempty"` - // Unique persistent memory host indentifier. + // Unique persistent memory host identifier. VolumeUUID string `xml:"volumeUUID,omitempty" json:"volumeUUID,omitempty"` } @@ -43307,7 +43542,7 @@ func init() { t["HostPlugStoreTopologyTarget"] = reflect.TypeOf((*HostPlugStoreTopologyTarget)(nil)).Elem() } -// This data type describes the avaialable capacity +// This data type describes the available capacity // for VM traffic on a physical NIC type HostPnicNetworkResourceInfo struct { DynamicData @@ -44027,7 +44262,7 @@ type HostProxySwitch struct { NsxtStatus string `xml:"nsxtStatus,omitempty" json:"nsxtStatus,omitempty"` // Additional information regarding the NSX-T proxy switch status NsxtStatusDetail string `xml:"nsxtStatusDetail,omitempty" json:"nsxtStatusDetail,omitempty"` - // ENS Status From VmKernal. + // ENS Status From VmKernel. EnsInfo *HostProxySwitchEnsInfo `xml:"ensInfo,omitempty" json:"ensInfo,omitempty" vim:"8.0.0.1"` // Indicate if network offloading is enabled on the proxy switch of // this host. @@ -44072,7 +44307,7 @@ func init() { } // This data object type describes -// the Ens status from VmKernal. +// the Ens status from VmKernel. type HostProxySwitchEnsInfo struct { DynamicData @@ -44267,7 +44502,7 @@ type HostRdmaDevice struct { Backing BaseHostRdmaDeviceBacking `xml:"backing,omitempty,typeattr" json:"backing,omitempty"` // Current device connection state. ConnectionInfo HostRdmaDeviceConnectionInfo `xml:"connectionInfo" json:"connectionInfo"` - // Supported capabilies of the RDMA device. + // Supported capabilities of the RDMA device. Capability HostRdmaDeviceCapability `xml:"capability" json:"capability"` } @@ -44285,7 +44520,7 @@ func init() { t["HostRdmaDeviceBacking"] = reflect.TypeOf((*HostRdmaDeviceBacking)(nil)).Elem() } -// Represents device capabilies, e.g. +// Represents device capabilities, e.g. // // supported protocols. type HostRdmaDeviceCapability struct { @@ -44786,6 +45021,8 @@ type HostRuntimeInfo struct { PartialMaintenanceMode []HostPartialMaintenanceModeRuntimeInfo `xml:"partialMaintenanceMode,omitempty" json:"partialMaintenanceMode,omitempty" vim:"8.0.3.0"` // Host persistent state encryption information. StateEncryption *HostRuntimeInfoStateEncryptionInfo `xml:"stateEncryption,omitempty" json:"stateEncryption,omitempty" vim:"7.0.3.0"` + // PodVM related information for a host. + PodVMInfo *PodVMInfo `xml:"podVMInfo,omitempty" json:"podVMInfo,omitempty" vim:"9.1.0.0"` } func init() { @@ -45512,7 +45749,7 @@ type HostSnmpSystemAgentLimits struct { // SNMP input buffer size MaxBufferSize int32 `xml:"maxBufferSize" json:"maxBufferSize"` // Supported Capability for this agent - Capability HostSnmpAgentCapability `xml:"capability,omitempty" json:"capability,omitempty"` + Capability HostSnmpAgentCapability `xml:"capability" json:"capability"` } func init() { @@ -45711,7 +45948,7 @@ type HostSslThumbprintInfo struct { // interfering with each other on the life cycle of the thumbprint with // their unique tags. // Each solution should use a unique tag to identify itself. - OwnerTag string `xml:"ownerTag,omitempty" json:"ownerTag,omitempty"` + OwnerTag string `xml:"ownerTag" json:"ownerTag"` // Specify the SSL thumbprints to register on the host. SslThumbprints []string `xml:"sslThumbprints,omitempty" json:"sslThumbprints,omitempty"` } @@ -45963,7 +46200,7 @@ func init() { t["HostSystemComplianceCheckState"] = reflect.TypeOf((*HostSystemComplianceCheckState)(nil)).Elem() } -// This data object provides information about the health of the phyical +// This data object provides information about the health of the physical // system. // // The data is retrieved from numeric sensor probes. @@ -46051,7 +46288,7 @@ type HostSystemReconnectSpec struct { // machine state in vCenter Server e.g. // // the virtual machine inventory - // and autostart rules, has to be propogated to the host. Any virtual + // and autostart rules, has to be propagated to the host. Any virtual // machines that may have been unregistered or orphaned will be // reregistered according to the vCenter Server inventory. Any autostart // rules that may have changed on the host will be similarly restored. @@ -46163,6 +46400,10 @@ func init() { t["HostSystemSwapConfigurationDisabledOption"] = reflect.TypeOf((*HostSystemSwapConfigurationDisabledOption)(nil)).Elem() } +// Deprecated as of vSphere API 9.0 with no direct replacement. Still, +// you may consider using Memory Tiering APIs +// `NVMe`. +// // Use option to indicate that the host cache may be used for system // swap. // @@ -46334,7 +46575,7 @@ type HostTpmAttestationReport struct { // This flag indicates whether the provided TPM events are a complete and reliable // information about host boot status. // - // TPM event log may be incomplete (and therfore unreliable) if certain modules have + // TPM event log may be incomplete (and therefore unreliable) if certain modules have // inappropriate origin or if the package information is incomplete. Only first 1000 // events are recorded by the kernel. Further events will not be recorded in the log // and will cause the log to be marked as unreliable. @@ -46365,7 +46606,7 @@ func init() { // This event type exists to simplify parsing of the security-related information // by internal and third-party solutions. Each boot option may be passed to kernel // multiple times and/or in different forms. Replicating the parsing logic of the -// kernel would be neither convinient, nor secure for the client applications. +// kernel would be neither convenient, nor secure for the client applications. // // Each instance of this event reports details of a single security-related // boot option, as set in the kernel. @@ -46711,7 +46952,7 @@ func init() { // VMFS volume with the same Uuid mounted somewhere in the same // datacenter. // -// Simple diagram representing the possible operations on UnresolvedVmfsVolume +// # Simple diagram representing the possible operations on UnresolvedVmfsVolume // // --------------------------------------------------------------------------- // | resignature forceMount | @@ -47168,14 +47409,17 @@ type HostVStorageObjectCreateDiskFromSnapshotRequestType struct { Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr" json:"profile,omitempty"` // Crypto information of the new disk. Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr" json:"crypto,omitempty"` - // Relative location in the specified datastore where disk needs - // to be created. If not specified disk gets created at defualt - // VStorageObject location on the specified datastore. + // Relative location where disk has to be created, used in + // `targetDatastore` and `datastore` parameters. + // If not specified disk gets created at default `VStorageObject` + // location of `targetDatastore` or `datastore`. Path string `xml:"path,omitempty" json:"path,omitempty"` // Provisioining type of the disk as specified in above // mentioned profile. The list of supported values can be found in // `BaseConfigInfoDiskFileBackingInfoProvisioningType_enum` ProvisioningType string `xml:"provisioningType,omitempty" json:"provisioningType,omitempty" vim:"8.0.0.1"` + // Indicates whether a linkedClone Disk needs to be created from the snapshot. + IsLinkedClone *bool `xml:"isLinkedClone" json:"isLinkedClone,omitempty" vim:"9.1.0.0"` } func init() { @@ -47608,6 +47852,8 @@ type HostVirtualNicSpec struct { // This attribute // allows the vmkernel adapter to specify its own default gateway. IpRouteSpec *HostVirtualNicIpRouteSpec `xml:"ipRouteSpec,omitempty" json:"ipRouteSpec,omitempty"` + // Deprecated as of vSphere API 9, use `HostVirtualNic.owner` instead. + // // Set to true when the vmkernel adapter is configured by // other system indirectly other than by the user directly. SystemOwned *bool `xml:"systemOwned" json:"systemOwned,omitempty"` @@ -48545,7 +48791,7 @@ type HttpNfcLeaseManifestEntry struct { Sha1 string `xml:"sha1" json:"sha1"` // Checksum of the data stream sent/recieved by host. // - // See `HttpNfcLeaseManifestEntryChecksumType_enum` for used algoritm. + // See `HttpNfcLeaseManifestEntryChecksumType_enum` for used algorithm. Checksum string `xml:"checksum,omitempty" json:"checksum,omitempty"` // Algorithm used to produce checksum in respective property. // @@ -48902,7 +49148,7 @@ func init() { // // This class is the abstract base for `VirtualMachineImportSpec` and // `VirtualAppImportSpec`. These three classes form a composite structure -// that allows us to contain arbitrarily complex entitites in a single ImportSpec. +// that allows us to contain arbitrarily complex entities in a single ImportSpec. type ImportSpec struct { DynamicData @@ -49817,10 +50063,10 @@ type InsufficientNetworkResourcePoolCapacity struct { InsufficientResourcesFault // Distributed Virtual Switch containing the resource pool - // having unsufficient network bandwitdh. + // having insufficient network bandwidth. DvsName string `xml:"dvsName" json:"dvsName"` // UUID of the distributed Virtual Switch containing the resource pool - // having unsufficient network bandwitdh. + // having insufficient network bandwidth. DvsUuid string `xml:"dvsUuid" json:"dvsUuid"` // Key of the resource pool on which network bandwidth is requested. ResourcePoolKey string `xml:"resourcePoolKey" json:"resourcePoolKey"` @@ -49878,7 +50124,7 @@ func init() { } // This fault is thrown when Distributed Power Management cannot perform -// a given opeartion because there is insufficient CPU resource +// a given operation because there is insufficient CPU resource // on standby hosts (if any) to meet the requirements of the operation. type InsufficientStandbyCpuResource struct { InsufficientStandbyResource @@ -49928,7 +50174,7 @@ func init() { } // This fault is thrown when Distributed Power Management cannot perform -// a given opeartion because there are insufficient CPU/memory resources +// a given operation because there are insufficient CPU/memory resources // on standby hosts (if any) to meet the requirements of the operation. type InsufficientStandbyResource struct { InsufficientResourcesFault @@ -50849,7 +51095,7 @@ func init() { // associated with a profile in the Virtual Center inventory. // // This could -// be because there is no host assciated with the profile or because the +// be because there is no host associated with the profile or because the // associated host is incompatible with the profile. type InvalidProfileReferenceHost struct { RuntimeFault @@ -50948,7 +51194,7 @@ func init() { } // This fault is thrown when an operation will cause the structure of a resource -// pool hiearchy to exceed its limit. +// pool hierarchy to exceed its limit. // // The limits are typically imposed by the total // number of nodes, maximum fan-out, and total depth of the hierarchy. @@ -51018,6 +51264,25 @@ func init() { t["InvalidStateFault"] = reflect.TypeOf((*InvalidStateFault)(nil)).Elem() } +// Thrown when the API request is associated with an access token +// that the server does not accept. +// +// The token might be malformed, +// with an invalid signature or content, expired validity, etc. +type InvalidToken struct { + RuntimeFault +} + +func init() { + t["InvalidToken"] = reflect.TypeOf((*InvalidToken)(nil)).Elem() +} + +type InvalidTokenFault InvalidToken + +func init() { + t["InvalidTokenFault"] = reflect.TypeOf((*InvalidTokenFault)(nil)).Elem() +} + // InvalidType is thrown when a managed object request refers to // an unexpected or unknown type. type InvalidType struct { @@ -52711,7 +52976,7 @@ type LicenseManagerLicenseInfo struct { CostUnit string `xml:"costUnit" json:"costUnit"` // Additional properties associated with this license Properties []KeyAnyValue `xml:"properties,omitempty" json:"properties,omitempty"` - // Key-value lables for this license + // Key-value labels for this license Labels []KeyValue `xml:"labels,omitempty" json:"labels,omitempty"` } @@ -55024,7 +55289,7 @@ func init() { t["MismatchedVMotionNetworkNamesFault"] = reflect.TypeOf((*MismatchedVMotionNetworkNamesFault)(nil)).Elem() } -// A MissingBmcSuppport fault is thrown when a host's BMC doesn't support IPMI. +// A MissingBmcSupport fault is thrown when a host's BMC doesn't support IPMI. // // BMC (Board Management Controller) is a piece of hardware required for IPMI. type MissingBmcSupport struct { @@ -55697,7 +55962,7 @@ type MoveVirtualDiskRequestType struct { // // Refers instance of `Datacenter`. DestDatacenter *ManagedObjectReference `xml:"destDatacenter,omitempty" json:"destDatacenter,omitempty"` - // If true, overwrite any indentically named disk at the destination. + // If true, overwrite any identically named disk at the destination. // If not specified, it is assumed to be false Force *bool `xml:"force" json:"force,omitempty"` // User can specify new set of profile when moving virtual disk. @@ -56102,7 +56367,7 @@ type NetDhcpConfigInfoDhcpOptions struct { // key='2', value='reboot 10;' // output reported at per interface scope: // key='1', value='prepend domain-name-servers 192.0.2.1;' - // key='2', value='equire subnet-mask, domain-name-servers;' + // key='2', value='require subnet-mask, domain-name-servers;' Config []KeyValue `xml:"config,omitempty" json:"config,omitempty"` } @@ -56238,7 +56503,7 @@ type NetIpConfigInfo struct { IpAddress []NetIpConfigInfoIpAddress `xml:"ipAddress,omitempty" json:"ipAddress,omitempty"` // Client side DHCP for a given interface. Dhcp *NetDhcpConfigInfo `xml:"dhcp,omitempty" json:"dhcp,omitempty"` - // Enable or disable ICMPv6 router solictitation requests from a given interface + // Enable or disable ICMPv6 router solicitation requests from a given interface // to acquire an IPv6 address and default gateway route from zero, one or more // routers on the connected network. // @@ -56288,7 +56553,7 @@ type NetIpConfigInfoIpAddress struct { State string `xml:"state,omitempty" json:"state,omitempty"` // The time when will this address expire. // - // Durning this time + // During this time // `state` may change states but is still visible // from the network. Lifetime *time.Time `xml:"lifetime" json:"lifetime,omitempty"` @@ -56440,7 +56705,7 @@ type NetIpRouteConfigSpecIpRouteSpec struct { // field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can // also consist of symbol '::' to represent multiple 16-bit groups of // contiguous 0's only once in an address as described in RFC 2373. - // To Specify a default network use the value: 0 with prefixLenth 0. + // To Specify a default network use the value: 0 with prefixLength 0. Network string `xml:"network" json:"network"` // The prefix length. // @@ -56469,7 +56734,7 @@ type NetIpStackInfo struct { // issues. This property maps to RFC 4293 ipNetToPhysicalTable. Neighbor []NetIpStackInfoNetToMedia `xml:"neighbor,omitempty" json:"neighbor,omitempty"` // Zero one or more entries of discovered IP routers that are directly - // reachable from a an interface on this system. + // reachable from an interface on this system. // // This property maps to RFC 4293 ipDefaultRouterTable. DefaultRouter []NetIpStackInfoDefaultRouter `xml:"defaultRouter,omitempty" json:"defaultRouter,omitempty"` @@ -56485,7 +56750,7 @@ type NetIpStackInfoDefaultRouter struct { // Unicast IP address of a next-hop router. IpAddress string `xml:"ipAddress" json:"ipAddress"` // This value will contain the name of the interface as reported by the - // operationg system. + // operating system. Device string `xml:"device" json:"device"` // When this entry will no longer valid. // @@ -56505,7 +56770,7 @@ func init() { t["NetIpStackInfoDefaultRouter"] = reflect.TypeOf((*NetIpStackInfoDefaultRouter)(nil)).Elem() } -// Information from an IP stack about known mappings betwwen an IP address +// Information from an IP stack about known mappings between an IP address // and the underlying physical address it maps to as learned by: // IPv4: Address Resolution Protocol (ARP) RFC 826 // IPv6: Neighbor Discovery Protocol (NDP) RFC 4861 @@ -57668,7 +57933,7 @@ type NotEnoughResourcesToStartVmEvent struct { VmEvent // The reason why the virtual machine could not be restarted - Reason string `xml:"reason,omitempty" json:"reason,omitempty"` + Reason string `xml:"reason" json:"reason"` } func init() { @@ -58252,7 +58517,7 @@ type NvdimmNamespaceCreateSpec struct { // Friendly name of the namespace to be created. // - // A friendly name can be provided by user to assosiate a name to + // A friendly name can be provided by user to associate a name to // the created namespace, but such a name is not mandatory and is // empty string by default. FriendlyName string `xml:"friendlyName,omitempty" json:"friendlyName,omitempty"` @@ -58433,7 +58698,7 @@ type NvdimmRegionInfo struct { // If this region is part of interleave set (represented by non zero // `NvdimmRegionInfo.setId`) and the region is interleaved across // multiple dimms (represented by more that one element in - // `NvdimmInterleaveSetInfo.deviceList` for assosiated set id + // `NvdimmInterleaveSetInfo.deviceList` for associated set id // `NvdimmRegionInfo.setId`), this size represents part of the // interleave set size - (total interleave set size / number // of dimms in `NvdimmInterleaveSetInfo.deviceList`). @@ -59295,7 +59560,7 @@ type OvfCreateDescriptorParams struct { // If unset, the entity's // product name is used if available. Otherwise, the VI entity name is used. Name string `xml:"name,omitempty" json:"name,omitempty"` - // The contents of the Annontation section of the top-level OVF Entity. + // The contents of the Annotation section of the top-level OVF Entity. // // If unset, // any existing annotation on the entity is left unchanged. @@ -59401,7 +59666,7 @@ type OvfCreateImportSpecParams struct { // // If set, all the disks in the deployed OVF will // have get the same specified disk type (e.g., thin provisioned). - // The valide values for disk provisioning are: + // The valid values for disk provisioning are: // - `monolithicSparse` // - `monolithicFlat` // - `twoGbMaxExtentSparse` @@ -59476,7 +59741,7 @@ func init() { minAPIVersionForType["OvfDatastoreMapping"] = "9.0.0.0" } -// A deployment option as defined in the OVF specfication. +// A deployment option as defined in the OVF specification. // // This corresponds to the Configuration element of the DeploymentOptionSection in the // specification. @@ -59911,7 +60176,7 @@ func init() { t["OvfHardwareExportFault"] = reflect.TypeOf((*OvfHardwareExportFault)(nil)).Elem() } -// Class used to indicate that the value in HostResoruce did not map to +// Class used to indicate that the value in HostResource did not map to // a valid reference element. type OvfHostResourceConstraint struct { OvfConstraint @@ -60200,7 +60465,7 @@ type OvfManagerCommonParams struct { // passed in key/value pairs are looked up before any messages // included in the OVF descriptor itself. MsgBundle []KeyValue `xml:"msgBundle,omitempty" json:"msgBundle,omitempty"` - // An optional argument for modifing the OVF parsing. + // An optional argument for modifying the OVF parsing. // // When the server parses an OVF // descriptor a set of options can be used to modify the parsing. The argument is a list @@ -60804,7 +61069,7 @@ type OvfUnknownDevice struct { // The unknown device Device BaseVirtualDevice `xml:"device,omitempty,typeattr" json:"device,omitempty"` - // The name of the Virtual Machine containing the unkown device + // The name of the Virtual Machine containing the unknown device VmName string `xml:"vmName" json:"vmName"` } @@ -61176,6 +61441,9 @@ func init() { t["OvfXmlFormatFault"] = reflect.TypeOf((*OvfXmlFormatFault)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// +// Do not use. type PMemDatastoreInfo struct { DatastoreInfo @@ -61655,7 +61923,7 @@ func init() { // // For ESX systems, a single instance of this data object exists. It cannot // be modified. It has these properties: -//
Traffic Filter ConfigSupported classes
+//
// // // @@ -61701,7 +61969,7 @@ func init() { // // Default properties for the four built-in historical intervals // include: -//
keysamplingPeriod
+//
// // // @@ -62286,7 +62554,7 @@ type PermissionUpdatedEvent struct { Propagate bool `xml:"propagate" json:"propagate"` // The previous associated role. PrevRole *RoleEventArgument `xml:"prevRole,omitempty" json:"prevRole,omitempty"` - // Previous propogate value. + // Previous propagate value. PrevPropagate *bool `xml:"prevPropagate" json:"prevPropagate,omitempty"` } @@ -62411,35 +62679,35 @@ func init() { t["PhysicalNic"] = reflect.TypeOf((*PhysicalNic)(nil)).Elem() } -// The capability of the CDP-awared device that connects to a Physical NIC. +// The capability of the CDP-aware device that connects to a Physical NIC. // // `PhysicalNicCdpInfo` type PhysicalNicCdpDeviceCapability struct { DynamicData - // The CDP-awared device has the capability of a routing for + // The CDP-aware device has the capability of a routing for // at least one network layer protocol Router bool `xml:"router" json:"router"` - // The CDP-awared device has the capability of transparent + // The CDP-aware device has the capability of transparent // bridging TransparentBridge bool `xml:"transparentBridge" json:"transparentBridge"` - // The CDP-awared device has the capability of source-route + // The CDP-aware device has the capability of source-route // bridging SourceRouteBridge bool `xml:"sourceRouteBridge" json:"sourceRouteBridge"` - // The CDP-awared device has the capability of switching. + // The CDP-aware device has the capability of switching. // // The // difference between this capability and transparentBridge is // that a switch does not run the Spanning-Tree Protocol. This // device is assumed to be deployed in a physical loop-free topology. NetworkSwitch bool `xml:"networkSwitch" json:"networkSwitch"` - // The CDP-awared device has the capability of a host, which + // The CDP-aware device has the capability of a host, which // Sends and receives packets for at least one network layer protocol. Host bool `xml:"host" json:"host"` - // The CDP-awared device is IGMP-enabled, which does not forward IGMP + // The CDP-aware device is IGMP-enabled, which does not forward IGMP // Report packets on nonrouter ports. IgmpEnabled bool `xml:"igmpEnabled" json:"igmpEnabled"` - // The CDP-awared device has the capability of a repeater + // The CDP-aware device has the capability of a repeater Repeater bool `xml:"repeater" json:"repeater"` } @@ -62448,7 +62716,7 @@ func init() { } // CDP (Cisco Discovery Protocol) is a link level protocol that allows -// for discovering the CDP-awared network hardware at either end of a +// for discovering the CDP-aware network hardware at either end of a // DIRECT connection. // // It's only good for direct connection because CDP @@ -62584,14 +62852,14 @@ type PhysicalNicHintInfo struct { // The list of network names that were detected on this // physical network adapter. Network []PhysicalNicNameHint `xml:"network,omitempty" json:"network,omitempty"` - // If the uplink directly connects to a CDP-awared network device + // If the uplink directly connects to a CDP-aware network device // and the device's CDP broadcast is enabled, this property will be // set to return the CDP information that vmkernel received on this // Physical NIC. // // CDP data contains the device information and port ID that // the Physical NIC connects to. If the uplink is not connecting to a - // CDP-awared device or CDP is not enabled on the device, this + // CDP-aware device or CDP is not enabled on the device, this // property will be unset. // `PhysicalNicCdpInfo` ConnectedSwitchPort *PhysicalNicCdpInfo `xml:"connectedSwitchPort,omitempty" json:"connectedSwitchPort,omitempty"` @@ -62739,6 +63007,27 @@ type PlaceVmResponse struct { Returnval PlacementResult `xml:"returnval" json:"returnval"` } +// Represents the list of candidate networks for a single network interface. +type PlaceVmsXClusterSpecCandidateNetworks struct { + DynamicData + + // The list of candidate networks for a single network interface. + // + // When this + // parameter is specified, virtual machines will only be placed on clusters + // whose hosts are connected to one of the specified network. + // Note - Only one of the listed network will be used for attaching the + // virtual NIC. + // + // Refers instances of `Network`. + Networks []ManagedObjectReference `xml:"networks,omitempty" json:"networks,omitempty"` +} + +func init() { + t["PlaceVmsXClusterSpecCandidateNetworks"] = reflect.TypeOf((*PlaceVmsXClusterSpecCandidateNetworks)(nil)).Elem() + minAPIVersionForType["PlaceVmsXClusterSpecCandidateNetworks"] = "9.1.0.0" +} + // Describes a placement action of a single virtual machine. // // One or more of such actions can be included in a placement recommendation, @@ -63083,6 +63372,51 @@ func init() { t["PodStorageDrsEntry"] = reflect.TypeOf((*PodStorageDrsEntry)(nil)).Elem() } +// This data object type contains the PodVM specific runtime +// information for an ESX host. +type PodVMInfo struct { + DynamicData + + // Indicates if the host has a powered on page sharing PodVM. + HasPageSharingPodVM bool `xml:"hasPageSharingPodVM" json:"hasPageSharingPodVM"` + // Contains the memory overhead info for PodVMs on the host. + PodVMOverheadInfo PodVMOverheadInfo `xml:"podVMOverheadInfo" json:"podVMOverheadInfo"` +} + +func init() { + t["PodVMInfo"] = reflect.TypeOf((*PodVMInfo)(nil)).Elem() + minAPIVersionForType["PodVMInfo"] = "9.1.0.0" +} + +// Contains information about CRX Page Sharing support on an ESX host and +// the PodVM memory overhead to be used by sched-ext in its calculations accordingly. +// +// Sched-ext will determine which of these values to use based on both host level +// and cluster level information that it has available. +// Even if CRX Page sharing is supported on a particular host, sched-ext will use +// the overhead with page sharing only if all the hosts in the cluster have this support, +// else it will fall back on the overhead without page sharing in its calculations. +// These overhead values will be updated at runtime by Spherelet, which is a daemon on ESX +// and is responsible for managing PodVMs. +type PodVMOverheadInfo struct { + DynamicData + + // Indicates whether CRX Page sharing + // feature is supported on the host. + CrxPageSharingSupported bool `xml:"crxPageSharingSupported" json:"crxPageSharingSupported"` + // Memory overhead value in MB to be used by sched-ext + // if CRX Page Sharing is `*not*` supported on the host. + PodVMOverheadWithoutPageSharing int32 `xml:"podVMOverheadWithoutPageSharing" json:"podVMOverheadWithoutPageSharing"` + // Memory overhead value in MB to be used by sched-ext + // if CRX Page Sharing is supported on the host. + PodVMOverheadWithPageSharing int32 `xml:"podVMOverheadWithPageSharing" json:"podVMOverheadWithPageSharing"` +} + +func init() { + t["PodVMOverheadInfo"] = reflect.TypeOf((*PodVMOverheadInfo)(nil)).Elem() + minAPIVersionForType["PodVMOverheadInfo"] = "9.1.0.0" +} + // The `PolicyOption` data object represents one or more configuration // values. // @@ -63576,7 +63910,7 @@ func init() { t["ProfileApplyProfileProperty"] = reflect.TypeOf((*ProfileApplyProfileProperty)(nil)).Elem() } -// This event records that a Profile was associated with a managed entitiy. +// This event records that a Profile was associated with a managed entity. type ProfileAssociatedEvent struct { ProfileEvent } @@ -63585,7 +63919,7 @@ func init() { t["ProfileAssociatedEvent"] = reflect.TypeOf((*ProfileAssociatedEvent)(nil)).Elem() } -// This event records that the profile has beed edited +// This event records that the profile has been edited type ProfileChangedEvent struct { ProfileEvent } @@ -64736,9 +65070,9 @@ type QueryChangedDiskAreasRequestType struct { // Typically, callers will make multiple calls to this function, starting // with startOffset 0 and then examine the "length" property in the // returned DiskChangeInfo structure, repeatedly calling queryChangedDiskAreas - // until a map forthe entire virtual disk has been obtained. + // until a map for the entire virtual disk has been obtained. StartOffset int64 `xml:"startOffset" json:"startOffset"` - // Identifyer referring to a point in the past that should be used + // Identifier referring to a point in the past that should be used // as the point in time at which to begin including changes to the disk in // the result. A typical use case would be a backup application obtaining a // changeId from a virtual disk's backing info when performing a @@ -65077,7 +65411,7 @@ type QueryConnectionInfoViaSpecRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` // The connection spec for the host to be queried. It must contain // values for all parameters required by `Datacenter.QueryConnectionInfo` - // See `Datacenter.QueryConnectionInfo` or a list of thrown expections. + // See `Datacenter.QueryConnectionInfo` or a list of thrown exceptions. Spec HostConnectSpec `xml:"spec" json:"spec"` } @@ -65123,7 +65457,7 @@ type QueryCryptoKeyStatusRequestType struct { // 0x02. check the VMs which use that key. // 0x04. check the hosts using this key as host key. // 0x08. Check 3rd party program which use that key. - // Other bits - reserved and will be igonred. + // Other bits - reserved and will be ignored. CheckKeyBitMap int32 `xml:"checkKeyBitMap" json:"checkKeyBitMap"` } @@ -68823,7 +69157,7 @@ type RegisterVM_TaskResponse struct { type Relation struct { DynamicData - // If contraint is not set, the relation holds for all versions. + // If constraint is not set, the relation holds for all versions. // // and if a constraint is defined it will be one of // `SoftwarePackageConstraint_enum`. @@ -70158,7 +70492,7 @@ type ReplicationConfigSpec struct { // The primary will negotiate the best compression with // the server on the secondary if this is enabled. NetCompressionEnabled *bool `xml:"netCompressionEnabled" json:"netCompressionEnabled,omitempty"` - // Flag that indicates whether or not encription should + // Flag that indicates whether or not encryption should // be used when sending traffic over the network. // // The primary will use the remoteCertificateThumbprint @@ -70177,7 +70511,7 @@ type ReplicationConfigSpec struct { // // The SHA256 thumbprint of the remote server certificate. // - // This field is only relevant when net encription is enabled. + // This field is only relevant when net encryption is enabled. RemoteCertificateThumbprint string `xml:"remoteCertificateThumbprint,omitempty" json:"remoteCertificateThumbprint,omitempty"` // Flag that indicates whether DataSets files are replicated or not. DataSetsReplicationEnabled *bool `xml:"dataSetsReplicationEnabled" json:"dataSetsReplicationEnabled,omitempty" vim:"8.0.0.0"` @@ -70239,7 +70573,7 @@ func init() { // // { // -// faultDomainId: +// faultDomainId: // // deviceGroupId: ffffffff-ffff-ffff-ffff-ffffffffffff // @@ -70415,7 +70749,7 @@ func init() { type ReplicationVmInProgressFault struct { ReplicationVmFault - // The requsted activity for VM replication + // The requested activity for VM replication RequestedActivity string `xml:"requestedActivity" json:"requestedActivity"` // The in-progress activity for VM replication InProgressActivity string `xml:"inProgressActivity" json:"inProgressActivity"` @@ -71147,7 +71481,7 @@ type ResourcePoolQuickStats struct { // Host memory utilization statistics, in MB. // // This - // is also known as consummed host memory. This is between 0 and + // is also known as consumed host memory. This is between 0 and // the configured resource limit. Valid while a virtual machine is // running. This includes the overhead memory of a virtual machine. HostMemoryUsage int64 `xml:"hostMemoryUsage,omitempty" json:"hostMemoryUsage,omitempty"` @@ -71311,6 +71645,14 @@ type ResourcePoolRuntimeInfo struct { // // Values are in Mhz. Cpu ResourcePoolResourceUsage `xml:"cpu" json:"cpu"` + // Runtime resource usage for VM resource profiles. + // + // For a given + // VM resource profile, values are in number of instances for + // that profile. + // If unset, there is no information available for the usage of + // VM resource profiles in this resource pool. + VmRp []ResourcePoolVmResourceProfileUsage `xml:"vmRp,omitempty" json:"vmRp,omitempty" vim:"9.1.0.0"` // Deprecated as of vSphere API 6.5. // Use `ManagedEntity.overallStatus`. // @@ -71357,6 +71699,39 @@ func init() { t["ResourcePoolSummary"] = reflect.TypeOf((*ResourcePoolSummary)(nil)).Elem() } +// Specifies information about the usage of a Virtual Machine Resource profile +// in a resource pool. +// +// The unit for usage is in terms of number of instances of a given VM resource +// profile. +type ResourcePoolVmResourceProfileUsage struct { + DynamicData + + // Specifies the identifier of the VM resource profile whose usage information + // is encapsulated by this VmResourceProfileUsage. + Id string `xml:"id" json:"id"` + // Specifies how many instances of this VM resource profile are reserved + // in this resource pool. + // + // Note that this indicates the configured reservation + // for this resource pool and it does not indicate currently available + // reservation. + ReservedForPool int64 `xml:"reservedForPool" json:"reservedForPool"` + // Specifies how many reserved instances of this VM resource profile in + // this resource pool are being used by virtual machines that are direct + // descendants of this resource pool. + ReservationUsedForVms int64 `xml:"reservationUsedForVms" json:"reservationUsedForVms"` + // Specifies how many reserved instances of this VM resource profile in + // this resource pool have been allocated to any of its child resource + // pools. + ReservationUsedForChildPools int64 `xml:"reservationUsedForChildPools" json:"reservationUsedForChildPools"` +} + +func init() { + t["ResourcePoolVmResourceProfileUsage"] = reflect.TypeOf((*ResourcePoolVmResourceProfileUsage)(nil)).Elem() + minAPIVersionForType["ResourcePoolVmResourceProfileUsage"] = "9.1.0.0" +} + // This event records when a conflict with a resource pool's resource // configuration is detected. type ResourceViolatedEvent struct { @@ -72242,7 +72617,7 @@ type RetrieveVStorageInfrastructureObjectPolicyResponse struct { Returnval []VslmInfrastructureObjectPolicy `xml:"returnval,omitempty" json:"returnval,omitempty"` } -// This data object is a pair of the virtural storage object id and +// This data object is a pair of the virtual storage object id and // its datastore. type RetrieveVStorageObjSpec struct { DynamicData @@ -72665,7 +73040,7 @@ type RuleViolation struct { // The rule that is violated. // // It can be an affinity or anti-affinity rule. - Rule BaseClusterRuleInfo `xml:"rule,omitempty,typeattr" json:"rule,omitempty"` + Rule BaseClusterRuleInfo `xml:"rule,typeattr" json:"rule"` } func init() { @@ -73180,7 +73555,7 @@ type ScheduledTaskInfo struct { // This field will have information about either the // ManagedEntity or the ManagedObject on which the scheduled // task is defined. - TaskObject *ManagedObjectReference `xml:"taskObject,omitempty" json:"taskObject,omitempty"` + TaskObject ManagedObjectReference `xml:"taskObject" json:"taskObject"` } func init() { @@ -73399,7 +73774,7 @@ type ScsiLun struct { // set for Raw Device Mapped (RDM) LUNs, the host startup or LUN rescan // take comparatively shorter duration than when it is unset. PerenniallyReserved *bool `xml:"perenniallyReserved" json:"perenniallyReserved,omitempty"` - // Indicates if LUN has the prequisite properties to enable Clustered Vmdk + // Indicates if LUN has the prerequisite properties to enable Clustered Vmdk // feature once formatted into VMFS Datastore. ClusteredVmdkSupported *bool `xml:"clusteredVmdkSupported" json:"clusteredVmdkSupported,omitempty"` // Indicates the current device protocol. @@ -74162,7 +74537,7 @@ type ServiceLocator struct { Credential BaseServiceLocatorCredential `xml:"credential,typeattr" json:"credential"` // The SSL thumbprint of the certificate of the service endpoint. // - // Superceded by `ServiceLocator.sslCertificate`. + // Superseded by `ServiceLocator.sslCertificate`. // Note: If both sslThumbprint and sslCertificate are set, // sslThumbprint must correspond to the sslCertificate. SslThumbprint string `xml:"sslThumbprint,omitempty" json:"sslThumbprint,omitempty"` @@ -76745,12 +77120,12 @@ type StorageIORMConfigOption struct { CongestionThresholdOption IntOption `xml:"congestionThresholdOption" json:"congestionThresholdOption"` // statsCollectionEnabledOption provides default value for // `StorageIORMConfigSpec.statsCollectionEnabled` - StatsCollectionEnabledOption *BoolOption `xml:"statsCollectionEnabledOption,omitempty" json:"statsCollectionEnabledOption,omitempty"` + StatsCollectionEnabledOption BoolOption `xml:"statsCollectionEnabledOption" json:"statsCollectionEnabledOption"` // Deprecated as of vSphere8.0 U3, and there is no replacement for it. // // reservationEnabledOption provides default value for // `StorageIORMConfigSpec.reservationEnabled` - ReservationEnabledOption *BoolOption `xml:"reservationEnabledOption,omitempty" json:"reservationEnabledOption,omitempty"` + ReservationEnabledOption BoolOption `xml:"reservationEnabledOption" json:"reservationEnabledOption"` } func init() { @@ -76820,7 +77195,7 @@ type StorageIORMInfo struct { // Mode of congestion threshold specification // For more information, see // `StorageIORMThresholdMode_enum` - CongestionThresholdMode string `xml:"congestionThresholdMode,omitempty" json:"congestionThresholdMode,omitempty"` + CongestionThresholdMode string `xml:"congestionThresholdMode" json:"congestionThresholdMode"` // The latency beyond which the storage array is considered congested. // // If storage I/O resource management is enabled on a datastore, @@ -76839,11 +77214,11 @@ type StorageIORMInfo struct { // Deprecated as of vSphere API 6.5, use `StorageIORMInfo.enabled` instead. // // Flag indicating whether service is running in stats collection mode. - StatsCollectionEnabled *bool `xml:"statsCollectionEnabled" json:"statsCollectionEnabled,omitempty"` + StatsCollectionEnabled bool `xml:"statsCollectionEnabled" json:"statsCollectionEnabled"` // Deprecated as of vSphere8.0 U3, and there is no replacement for it. // // Flag indicating whether IO reservations support is enabled. - ReservationEnabled *bool `xml:"reservationEnabled" json:"reservationEnabled,omitempty"` + ReservationEnabled bool `xml:"reservationEnabled" json:"reservationEnabled"` // Flag indicating whether stats aggregation is disabled. StatsAggregationDisabled *bool `xml:"statsAggregationDisabled" json:"statsAggregationDisabled,omitempty"` // Deprecated as of vSphere8.0 U3, and there is no replacement for it. @@ -77567,6 +77942,76 @@ func init() { t["Tag"] = reflect.TypeOf((*Tag)(nil)).Elem() } +// Describes information required to uniquely identify a vSphere tag. +// +// A vSphere tag can be either identified using its UUID or the combination +// of its name and its parent category's name. +type TagId struct { + DynamicData + + // Information about the name of the tag represented by this TagId. + // + // If + // this field is specified in addition to `TagId.uuid`, then both + // `TagId.uuid` and nameId must belong to the same vSphere tag. If this + // field is left unset, then `TagId.uuid` must be specified. + NameId *TagIdNameId `xml:"nameId,omitempty" json:"nameId,omitempty"` + // The UUID of the vSphere tag represented by this TagId. + // + // If this field + // is specified in addition to `TagId.nameId`, then both uuid and + // `TagId.nameId` must belong to the same vSphere tag. If this field is left + // unset, then `TagId.nameId` must be specified. + Uuid string `xml:"uuid,omitempty" json:"uuid,omitempty"` +} + +func init() { + t["TagId"] = reflect.TypeOf((*TagId)(nil)).Elem() + minAPIVersionForType["TagId"] = "9.1.0.0" +} + +// Specifies information required to uniquely identify a vSphere tag by its +// name. +// +// Names of tags within the scope of a given category are unique, but +// the names of tags belonging to two different categories can be same. +// Hence, to uniquely identify a tag by its name in a given vSphere, both +// tag name and its parent category's name are required. +type TagIdNameId struct { + DynamicData + + // Name of the vSphere tag represented by this TagId. + Tag string `xml:"tag" json:"tag"` + // Name of the vSphere category that this tag belongs to. + Category string `xml:"category" json:"category"` +} + +func init() { + t["TagIdNameId"] = reflect.TypeOf((*TagIdNameId)(nil)).Elem() +} + +// Specification for doing an incremental update to the association +// between a vSphere tag and an inventory object. +// +// This allows specifying the tag to which an incremental update needs to be +// applied and the operation for that update. Supported operations are: +// - add: Attach a new tag to a given object. +// - remove: Detach a tag already attached from a given object. +// +// See `ArrayUpdateSpec` for more information about possible operations. +// Note that editing a tag using this is not supported. +type TagSpec struct { + ArrayUpdateSpec + + // Information to identify the tag that needs to be attached or detached. + Id TagId `xml:"id" json:"id"` +} + +func init() { + t["TagSpec"] = reflect.TypeOf((*TagSpec)(nil)).Elem() + minAPIVersionForType["TagSpec"] = "9.1.0.0" +} + // Static strings for task objects. // // These strings are locale-specific. @@ -78727,7 +79172,7 @@ func init() { } // Thrown when tools install or upgrade fails because the -// operation was canclled by the user. +// operation was cancelled by the user. type ToolsUpgradeCancelled struct { VmToolsUpgradeFault } @@ -78742,6 +79187,38 @@ func init() { t["ToolsUpgradeCancelledFault"] = reflect.TypeOf((*ToolsUpgradeCancelledFault)(nil)).Elem() } +type TransitGatewayConfigInfo struct { + DynamicData + + ID string `xml:"ID" json:"ID"` + Name string `xml:"name" json:"name"` +} + +func init() { + t["TransitGatewayConfigInfo"] = reflect.TypeOf((*TransitGatewayConfigInfo)(nil)).Elem() +} + +type TransitGatewayConfigSpec struct { + DynamicData + + Name string `xml:"name,omitempty" json:"name,omitempty"` +} + +func init() { + t["TransitGatewayConfigSpec"] = reflect.TypeOf((*TransitGatewayConfigSpec)(nil)).Elem() +} + +type TransitGatewayCreateSpec struct { + DynamicData + + ID string `xml:"ID" json:"ID"` + Name string `xml:"name" json:"name"` +} + +func init() { + t["TransitGatewayCreateSpec"] = reflect.TypeOf((*TransitGatewayCreateSpec)(nil)).Elem() +} + // The `TraversalSpec` data object type specifies // how to derive a new set of objects to add to the filter. // @@ -80140,7 +80617,7 @@ type UpdateInternetScsiAuthenticationPropertiesRequestType struct { // the authentication settings to set. AuthenticationProperties HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties" json:"authenticationProperties"` // The set the targets to configure. Optional, - // when obmitted will configura the authentication properties + // when omitted will configure the authentication properties // for the adapter instead. TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty" json:"targetSet,omitempty"` } @@ -80450,7 +80927,7 @@ func init() { type UpdateLinkedChildrenRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` // a set of LinkInfo objects that either add a new link - // or modify an exisiting link. + // or modify an existing link. AddChangeSet []VirtualAppLinkInfo `xml:"addChangeSet,omitempty" json:"addChangeSet,omitempty"` // a set of entities that should no longer link to this vApp. // @@ -80499,7 +80976,13 @@ func init() { // The parameters of `HostAccessManager.UpdateLockdownExceptions`. type UpdateLockdownExceptionsRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` - // the new list of lockdown mode exceptions. + // the new list of lockdown mode exceptions, + // or a list of users to set or unset as lockdown exceptions + // depending on the '+' or '-' prefix of each user name. + // If a user name starts with '+' then it will be + // added to the current list of lockdown exceptions. + // If a user name starts with '-' then it will be + // removed from the current list of lockdown exceptions. Users []string `xml:"users,omitempty" json:"users,omitempty"` } @@ -80986,7 +81469,13 @@ func init() { // The parameters of `HostAccessManager.UpdateSystemUsers`. type UpdateSystemUsersRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` - // the new list of local system users. + // the new list of local system users, or a list of + // users to set or unset as system users depending + // on the '+' or '-' prefix of each user name. + // If a user name starts with '+' then it will be + // added to the current list of system users. + // If a user name starts with '-' then it will be + // removed from the current list of system users. Users []string `xml:"users,omitempty" json:"users,omitempty"` } @@ -81802,16 +82291,16 @@ type UserSession struct { // the server determines this locale. MessageLocale string `xml:"messageLocale" json:"messageLocale"` // Whether or not this session belongs to a VC Extension. - ExtensionSession *bool `xml:"extensionSession" json:"extensionSession,omitempty"` + ExtensionSession bool `xml:"extensionSession" json:"extensionSession"` // The client identity. // // It could be IP address, or pipe name depended // on client binding - IpAddress string `xml:"ipAddress,omitempty" json:"ipAddress,omitempty"` + IpAddress string `xml:"ipAddress" json:"ipAddress"` // The name of user agent or application - UserAgent string `xml:"userAgent,omitempty" json:"userAgent,omitempty"` + UserAgent string `xml:"userAgent" json:"userAgent"` // Number of API invocations since the session started - CallCount int64 `xml:"callCount,omitempty" json:"callCount,omitempty"` + CallCount int64 `xml:"callCount" json:"callCount"` } func init() { @@ -82047,7 +82536,7 @@ type VAppConfigInfo struct { EntityConfig []VAppEntityConfigInfo `xml:"entityConfig,omitempty" json:"entityConfig,omitempty"` // Description for the vApp. Annotation string `xml:"annotation" json:"annotation"` - // vCenter-specific 128-bit UUID of a vApp, represented as a hexademical + // vCenter-specific 128-bit UUID of a vApp, represented as a hexadecimal // string. // // This identifier is used by vCenter to uniquely identify all @@ -82673,6 +83162,8 @@ type VCenterUpdateVStorageObjectMetadataExRequestType struct { Id ID `xml:"id" json:"id"` // The datastore to query for the virtual storage objects. // + // Required privileges: Datastore.FileManagement + // // Refers instance of `Datastore`. Datastore ManagedObjectReference `xml:"datastore" json:"datastore"` // array of key/value strings. (keys must be unique @@ -82737,7 +83228,7 @@ func init() { t["VFlashModuleNotSupportedFault"] = reflect.TypeOf((*VFlashModuleNotSupportedFault)(nil)).Elem() } -// The vFlash module version of the vFlash cache asscociated with the +// The vFlash module version of the vFlash cache associated with the // virtual disk of a VM is not compatible with the supported versions of // the specified vFlash module on the host. type VFlashModuleVersionIncompatible struct { @@ -82749,7 +83240,7 @@ type VFlashModuleVersionIncompatible struct { VmRequestModuleVersion string `xml:"vmRequestModuleVersion" json:"vmRequestModuleVersion"` // The minimum supported version of the specified module on the host. HostMinSupportedVerson string `xml:"hostMinSupportedVerson" json:"hostMinSupportedVerson"` - // The verson of the specified module on the host. + // The version of the specified module on the host. HostModuleVersion string `xml:"hostModuleVersion" json:"hostModuleVersion"` } @@ -83292,6 +83783,7 @@ type VMwareDVSPortSetting struct { // and an appropriately populated // *ipfix configuration* // that specifies a collector IP address and port. + // Since the 9.1 release, ipfix monitoring can not be enabled on uplink portgroups. IpfixEnabled *BoolPolicy `xml:"ipfixEnabled,omitempty" json:"ipfixEnabled,omitempty"` // If true, a copy of packets sent to the switch will always be forwarded to // an uplink in addition to the regular packet forwarded done by the switch. @@ -83350,6 +83842,8 @@ type VMwareDVSPortgroupPolicy struct { // for an individual port to override the setting in // `DVPortgroupConfigInfo.defaultPortConfig` of // a portgroup. + // + // Since the 9.1 release, it can not be set to True on uplink portgroups. IpfixOverrideAllowed *bool `xml:"ipfixOverrideAllowed" json:"ipfixOverrideAllowed,omitempty"` // Allow the setting of // `VMwareDVSPortSetting.macManagementPolicy` @@ -83574,7 +84068,7 @@ type VMwareDvsLacpCapability struct { // Flag to indicate whether the vSphere Distributed Switch supports more // than one Link Aggregation Control Protocol group to be configured. // - // It is suppported in vSphere Distributed Switch Version 5.5 or later. + // It is supported in vSphere Distributed Switch Version 5.5 or later. MultiLacpGroupSupported *bool `xml:"multiLacpGroupSupported" json:"multiLacpGroupSupported,omitempty"` // Flag to indicate whether LACP Fast Mode is supported on the // vSphere Distributed Switch. @@ -83608,8 +84102,15 @@ type VMwareDvsLacpGroupConfig struct { LoadbalanceAlgorithm string `xml:"loadbalanceAlgorithm,omitempty" json:"loadbalanceAlgorithm,omitempty"` // The VLAN Specification of the Uplink Ports in the Link Aggregation group. Vlan *VMwareDvsLagVlanConfig `xml:"vlan,omitempty" json:"vlan,omitempty"` + // Deprecated as of vSphere API 9.1. + // // Ipfix configuration of the Link Aggregation // Control Protocol group. + // + // Since the 9.1 release, ipfix monitoring can not be enabled on + // Link Aggregation group anymore. Because + // `VMwareDVSPortgroupPolicy.ipfixOverrideAllowed` + // can not be set to True on uplink portgroups. Ipfix *VMwareDvsLagIpfixConfig `xml:"ipfix,omitempty" json:"ipfix,omitempty"` // Names for the Uplink Ports in the group. // @@ -83645,8 +84146,15 @@ func init() { t["VMwareDvsLacpGroupSpec"] = reflect.TypeOf((*VMwareDvsLacpGroupSpec)(nil)).Elem() } +// Deprecated as of vSphere API 9.1. +// // This class defines the ipfix configuration of the Link Aggregation // Control Protocol group. +// +// Since the 9.1 release, ipfix monitoring can not be enabled on +// Link Aggregation group anymore. Because +// `VMwareDVSPortgroupPolicy.ipfixOverrideAllowed` +// can not be set to True on uplink portgroups. type VMwareDvsLagIpfixConfig struct { DynamicData @@ -83737,8 +84245,8 @@ type VMwareIpfixConfig struct { // Deprecated as of vSphere API 9.0 // Since from 9.0, client still can set the value of IpfixConfig.idleFlowTimeout // when creating/reconfiguring DVS, but no matter what value they set, - // it will be overrided to 15 by backend. - // In 9.0, idleFlow still functions with this overrided timeout '15', + // it will be overridden to 15 by backend. + // In 9.0, idleFlow still functions with this overridden timeout '15', // but it would be fully replaced by CT-based IPFIX in newer releases. // // The number of seconds after which "idle" flows are forced to be @@ -83751,6 +84259,10 @@ type VMwareIpfixConfig struct { // // Set to 0 to disable sampling. Legal value range is 0-16384. // Default: 4096. + // Since the 9.1 release, the ipfix sampling rate is no longer supported + // if NSX is enabled on this DVS host switch on that ESXi host. + // Any specified value for the sampling rate during DVS creation or + // reconfiguration will be ignored on ESXi hosts. SamplingRate int32 `xml:"samplingRate" json:"samplingRate"` // Whether to limit analysis to traffic that has both source and // destination served by the same host. @@ -84022,7 +84534,7 @@ func init() { t["VStorageObjectAssociations"] = reflect.TypeOf((*VStorageObjectAssociations)(nil)).Elem() } -// This data object contains infomation of a VM Disk associations. +// This data object contains information of a VM Disk associations. type VStorageObjectAssociationsVmDiskAssociations struct { DynamicData @@ -84058,6 +84570,16 @@ type VStorageObjectConfigInfo struct { // supported types. If not set, the default value is // `native_512`. VirtualDiskFormat string `xml:"virtualDiskFormat,omitempty" json:"virtualDiskFormat,omitempty" vim:"9.0.0.0"` + // Base disk path of a linked clone disk. + // + // Unset, if the virtual storage object is not a linked clone. + LinkedCloneBasePath string `xml:"linkedCloneBasePath,omitempty" json:"linkedCloneBasePath,omitempty" vim:"9.1.0.0"` + // The ID of the parent virtual storage object this linked clone virtual + // storage object. + // + // Unset, if the virtual storage object is not a linked clone or if the + // parent of the linked clone is a vanilla disk + LinkedCloneParentId *ID `xml:"linkedCloneParentId,omitempty" json:"linkedCloneParentId,omitempty" vim:"9.1.0.0"` } func init() { @@ -84121,6 +84643,35 @@ type VStorageObjectCreateSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval" json:"returnval"` } +// The parameters of `VStorageObjectManagerBase.VStorageObjectDeleteSnapshotEx2_Task`. +type VStorageObjectDeleteSnapshotEx2RequestType struct { + This ManagedObjectReference `xml:"_this" json:"-"` + // The ID of the virtual storage object. + Id ID `xml:"id" json:"id"` + // The datastore where the source virtual storage object + // is located. + // + // Refers instance of `Datastore`. + Datastore ManagedObjectReference `xml:"datastore" json:"datastore"` + // The ID of the snapshot of a virtual storage object. + SnapshotId ID `xml:"snapshotId" json:"snapshotId"` +} + +func init() { + t["VStorageObjectDeleteSnapshotEx2RequestType"] = reflect.TypeOf((*VStorageObjectDeleteSnapshotEx2RequestType)(nil)).Elem() + minAPIVersionForType["VStorageObjectDeleteSnapshotEx2RequestType"] = "9.0.0.0" +} + +type VStorageObjectDeleteSnapshotEx2_Task VStorageObjectDeleteSnapshotEx2RequestType + +func init() { + t["VStorageObjectDeleteSnapshotEx2_Task"] = reflect.TypeOf((*VStorageObjectDeleteSnapshotEx2_Task)(nil)).Elem() +} + +type VStorageObjectDeleteSnapshotEx2_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval" json:"returnval"` +} + // The parameters of `VStorageObjectManagerBase.VStorageObjectDeleteSnapshotEx_Task`. type VStorageObjectDeleteSnapshotExRequestType struct { This ManagedObjectReference `xml:"_this" json:"-"` @@ -84305,6 +84856,8 @@ type VStorageObjectSnapshot struct { Id ID `xml:"id" json:"id"` // VClock associated with the FCD when the operation completes. Vclock VslmVClockInfo `xml:"vclock" json:"vclock"` + // Storage space utilization of snapshots in MB excluding the running point + UsedCapacity int64 `xml:"usedCapacity,omitempty" json:"usedCapacity,omitempty" vim:"9.0.0.0"` } func init() { @@ -84316,7 +84869,7 @@ func init() { type VStorageObjectSnapshotDetails struct { DynamicData - // Path of the snaphost object + // Path of the snapshot object Path string `xml:"path,omitempty" json:"path,omitempty"` // Changed block tracking ID of the snapshot ChangedBlockTrackingId string `xml:"changedBlockTrackingId,omitempty" json:"changedBlockTrackingId,omitempty"` @@ -85662,7 +86215,7 @@ type VirtualDeviceFileBackingInfo struct { // Backing object's durable and unmutable identifier. // // Each backing object has a unique identifier which is not settable. - BackingObjectId string `xml:"backingObjectId,omitempty" json:"backingObjectId,omitempty"` + BackingObjectId *string `xml:"backingObjectId,omitempty" json:"backingObjectId,omitempty"` } func init() { @@ -85740,7 +86293,7 @@ type VirtualDeviceOption struct { PlugAndPlay bool `xml:"plugAndPlay" json:"plugAndPlay"` // Indicates if this type of device can be hot-removed from the virtual machine // via a reconfigure operation when the virtual machine is powered on. - HotRemoveSupported *bool `xml:"hotRemoveSupported" json:"hotRemoveSupported,omitempty"` + HotRemoveSupported bool `xml:"hotRemoveSupported" json:"hotRemoveSupported"` NumaSupported *bool `xml:"numaSupported" json:"numaSupported,omitempty" vim:"8.0.0.1"` } @@ -86076,7 +86629,7 @@ type VirtualDiskConfigSpec struct { // // If left unset then migrate is used when virtual flash resource on the source host // is accessible and when the backing vFlash module version is compatible with the - // specific vFalsh module on the target host; otherwise flush is used for write back + // specific vFlash module on the target host; otherwise flush is used for write back // cache, or a no-op for write through cache. This setting can avoid VM migration failure // due to incompatibility. // If true then migrate is always used. VM migration may fail if the backing vFlash module @@ -86262,7 +86815,9 @@ type VirtualDiskFlatVer2BackingInfo struct { WriteThrough *bool `xml:"writeThrough" json:"writeThrough,omitempty"` // Flag to indicate to the underlying filesystem, whether the // virtual disk backing file should be allocated lazily (using - // thin provisioning). This flag is only used for file systems + // thin provisioning). + // + // This flag is only used for file systems // that support configuring the provisioning policy on a per file // basis, such as VMFS3. // @@ -86461,9 +87016,9 @@ type VirtualDiskFlatVer2BackingOption struct { // host accessing it must support thin-provisioning. This flag indicates only // the host capability. See `DatastoreCapability.perFileThinProvisioningSupported` // for datastore capability. - ThinProvisioned *BoolOption `xml:"thinProvisioned,omitempty" json:"thinProvisioned,omitempty"` + ThinProvisioned BoolOption `xml:"thinProvisioned" json:"thinProvisioned"` // Flag to indicate if this backing supports eager scrubbing. - EagerlyScrub *BoolOption `xml:"eagerlyScrub,omitempty" json:"eagerlyScrub,omitempty"` + EagerlyScrub BoolOption `xml:"eagerlyScrub" json:"eagerlyScrub"` // Deprecated as of vSphere API 5.1, please use // `VirtualDiskFlatVer2BackingOption.deltaDiskFormatsSupported`. // @@ -86472,9 +87027,9 @@ type VirtualDiskFlatVer2BackingOption struct { // Valid values are: // - `redoLogFormat` // - `nativeFormat` - DeltaDiskFormat *ChoiceOption `xml:"deltaDiskFormat,omitempty" json:"deltaDiskFormat,omitempty"` + DeltaDiskFormat ChoiceOption `xml:"deltaDiskFormat" json:"deltaDiskFormat"` // Delta disk formats supported for each datastore type. - DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported,omitempty" json:"deltaDiskFormatsSupported,omitempty"` + DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported" json:"deltaDiskFormatsSupported"` // Virtual disk format. // // See `DatastoreSectorFormat_enum` for the list of supported types. @@ -86501,6 +87056,8 @@ func init() { t["VirtualDiskId"] = reflect.TypeOf((*VirtualDiskId)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // This data object type contains information about backing a virtual disk // using non-volatile memory technologies (persistent memory). // @@ -86541,6 +87098,8 @@ func init() { t["VirtualDiskLocalPMemBackingInfo"] = reflect.TypeOf((*VirtualDiskLocalPMemBackingInfo)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // This data object type contains the available options when backing // a virtualdisk using persistent memory. type VirtualDiskLocalPMemBackingOption struct { @@ -86609,7 +87168,7 @@ type VirtualDiskOption struct { // Minimum, maximum, and default values for Storage I/O allocation. // // See also `StorageIOAllocationInfo`. - IoAllocationOption *StorageIOAllocationOption `xml:"ioAllocationOption,omitempty" json:"ioAllocationOption,omitempty"` + IoAllocationOption StorageIOAllocationOption `xml:"ioAllocationOption" json:"ioAllocationOption"` // Deprecated since vSphere 7.0 because vFlash Read Cache // end of availability. // @@ -87234,7 +87793,7 @@ type VirtualDiskSparseVer2BackingInfo struct { // The space in use for this sparse disk. // // This information is provided - // when retrieving configuration information for an exisiting virtual + // when retrieving configuration information for an existing virtual // machine. The client cannot modify this information using reconfigure // on a virtual machine. SpaceUsedInKB int64 `xml:"spaceUsedInKB,omitempty" json:"spaceUsedInKB,omitempty"` @@ -87736,7 +88295,7 @@ type VirtualEthernetCardResourceAllocation struct { // The utilization of the virtual network adapter will not // exceed this limit, even if there are available resources. // To clear the value of this property and revert it to unset, - // set the vaule to "-1" in an update operation. + // set the value to "-1" in an update operation. // Units in Mbits/sec. Limit *int64 `xml:"limit" json:"limit,omitempty"` } @@ -87839,7 +88398,7 @@ type VirtualHardware struct { // implies numCoresPerSocket is 1. // In other cases, this field represents the actual virtual socket // size seen by the virtual machine. - NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty" json:"numCoresPerSocket,omitempty"` + NumCoresPerSocket *int32 `xml:"numCoresPerSocket,omitempty" json:"numCoresPerSocket,omitempty"` // Cores per socket is automatically determined. AutoCoresPerSocket *bool `xml:"autoCoresPerSocket" json:"autoCoresPerSocket,omitempty" vim:"8.0.0.1"` // Memory size, in MB. @@ -87906,7 +88465,7 @@ type VirtualHardwareOption struct { // List of acceptable values for the number of CPUs supported by this // `ConfigOption`. // - // This is usually superceded by the information available in the + // This is usually superseded by the information available in the // guest operating system descriptors. // The guest operating system descriptor describes a maximum CPU // count, but the acceptable values are still constrained to the @@ -87914,7 +88473,7 @@ type VirtualHardwareOption struct { NumCPU []int32 `xml:"numCPU" json:"numCPU"` // The minimum, maximum and default number of cores per socket that // can be used when distributing virtual CPUs. - NumCoresPerSocket *IntOption `xml:"numCoresPerSocket,omitempty" json:"numCoresPerSocket,omitempty"` + NumCoresPerSocket IntOption `xml:"numCoresPerSocket" json:"numCoresPerSocket"` // Whether auto cores per socket is supported. AutoCoresPerSocket *BoolOption `xml:"autoCoresPerSocket,omitempty" json:"autoCoresPerSocket,omitempty" vim:"8.0.0.1"` // Can the number of virtual CPUs be changed @@ -87943,14 +88502,14 @@ type VirtualHardwareOption struct { NumUSBControllers IntOption `xml:"numUSBControllers" json:"numUSBControllers"` // The minimum, maximum, and default number of XHCI (USB 3.0) controllers for // this virtual machine configuration. - NumUSBXHCIControllers *IntOption `xml:"numUSBXHCIControllers,omitempty" json:"numUSBXHCIControllers,omitempty"` + NumUSBXHCIControllers IntOption `xml:"numUSBXHCIControllers" json:"numUSBXHCIControllers"` // The minimum, maximum, and default number of SIO controllers for // this virtual machine configuration. NumSIOControllers IntOption `xml:"numSIOControllers" json:"numSIOControllers"` // The minimum, maximum, and default number of PS2 controllers for // this virtual machine configuration. NumPS2Controllers IntOption `xml:"numPS2Controllers" json:"numPS2Controllers"` - // List of propery names which limits are given be a licensing + // List of property names which limits are given be a licensing // restriction of the underlying product, e.g., a limit that is // not derived based on the product or hardware features. // @@ -87963,7 +88522,7 @@ type VirtualHardwareOption struct { // supported for this virtual machine configuration. NumSupportedWwnNodes *IntOption `xml:"numSupportedWwnNodes,omitempty" json:"numSupportedWwnNodes,omitempty"` // Default value and value range for `ResourceConfigOption` - ResourceConfigOption *ResourceConfigOption `xml:"resourceConfigOption,omitempty" json:"resourceConfigOption,omitempty"` + ResourceConfigOption ResourceConfigOption `xml:"resourceConfigOption" json:"resourceConfigOption"` // The minimum, maximum and default number of virtual NVDIMM controllers // for this virtual machine configuration. NumNVDIMMControllers *IntOption `xml:"numNVDIMMControllers,omitempty" json:"numNVDIMMControllers,omitempty"` @@ -88341,9 +88900,9 @@ type VirtualMachineCapability struct { // Supports assigning NPIV WWN to virtual machines that don't have RDM disks. NpivWwnOnNonRdmVmSupported bool `xml:"npivWwnOnNonRdmVmSupported" json:"npivWwnOnNonRdmVmSupported"` // Indicates whether the NPIV disabling operation is supported the virtual machine. - VmNpivWwnDisableSupported *bool `xml:"vmNpivWwnDisableSupported" json:"vmNpivWwnDisableSupported,omitempty"` + VmNpivWwnDisableSupported bool `xml:"vmNpivWwnDisableSupported" json:"vmNpivWwnDisableSupported"` // Indicates whether the update of NPIV WWNs are supported on the virtual machine. - VmNpivWwnUpdateSupported *bool `xml:"vmNpivWwnUpdateSupported" json:"vmNpivWwnUpdateSupported,omitempty"` + VmNpivWwnUpdateSupported bool `xml:"vmNpivWwnUpdateSupported" json:"vmNpivWwnUpdateSupported"` // Flag indicating whether the virtual machine has a configurable // *swapfile placement policy*. SwapPlacementSupported bool `xml:"swapPlacementSupported" json:"swapPlacementSupported"` @@ -88360,7 +88919,7 @@ type VirtualMachineCapability struct { BootOptionsSupported bool `xml:"bootOptionsSupported" json:"bootOptionsSupported"` // Indicates whether automatic boot retry can be // configured for this virtual machine. - BootRetryOptionsSupported *bool `xml:"bootRetryOptionsSupported" json:"bootRetryOptionsSupported,omitempty"` + BootRetryOptionsSupported bool `xml:"bootRetryOptionsSupported" json:"bootRetryOptionsSupported"` // Flag indicating whether the video ram size of this virtual machine // can be configured. SettingVideoRamSizeSupported bool `xml:"settingVideoRamSizeSupported" json:"settingVideoRamSizeSupported"` @@ -88369,12 +88928,12 @@ type VirtualMachineCapability struct { // // This capability depends on the guest operating system // configured for this virtual machine. - SettingDisplayTopologySupported *bool `xml:"settingDisplayTopologySupported" json:"settingDisplayTopologySupported,omitempty"` + SettingDisplayTopologySupported bool `xml:"settingDisplayTopologySupported" json:"settingDisplayTopologySupported"` // Deprecated as of vSphere API 6.0. // // Indicates whether record and replay functionality is supported on this // virtual machine. - RecordReplaySupported *bool `xml:"recordReplaySupported" json:"recordReplaySupported,omitempty"` + RecordReplaySupported bool `xml:"recordReplaySupported" json:"recordReplaySupported"` // Indicates that change tracking is supported for virtual disks of this // virtual machine. // @@ -88382,37 +88941,37 @@ type VirtualMachineCapability struct { // not be available for all disks of the virtual machine. For example, // passthru raw disk mappings or disks backed by any Ver1BackingInfo cannot // be tracked. - ChangeTrackingSupported *bool `xml:"changeTrackingSupported" json:"changeTrackingSupported,omitempty"` + ChangeTrackingSupported bool `xml:"changeTrackingSupported" json:"changeTrackingSupported"` // Indicates whether multiple virtual cores per socket is supported on this VM. - MultipleCoresPerSocketSupported *bool `xml:"multipleCoresPerSocketSupported" json:"multipleCoresPerSocketSupported,omitempty"` + MultipleCoresPerSocketSupported bool `xml:"multipleCoresPerSocketSupported" json:"multipleCoresPerSocketSupported"` // Indicates that host based replication is supported on this virtual // machine. // // However, even if host based replication is supported, // it might not be available for all disk types. For example, passthru // raw disk mappings can not be replicated. - HostBasedReplicationSupported *bool `xml:"hostBasedReplicationSupported" json:"hostBasedReplicationSupported,omitempty"` + HostBasedReplicationSupported bool `xml:"hostBasedReplicationSupported" json:"hostBasedReplicationSupported"` // Indicates whether features like guest OS auto-lock and MKS connection // controls are supported for this virtual machine. - GuestAutoLockSupported *bool `xml:"guestAutoLockSupported" json:"guestAutoLockSupported,omitempty"` + GuestAutoLockSupported bool `xml:"guestAutoLockSupported" json:"guestAutoLockSupported"` // Indicates whether // `memoryReservationLockedToMax` // may be set to true for this virtual machine. - MemoryReservationLockSupported *bool `xml:"memoryReservationLockSupported" json:"memoryReservationLockSupported,omitempty"` + MemoryReservationLockSupported bool `xml:"memoryReservationLockSupported" json:"memoryReservationLockSupported"` // Indicates whether featureRequirement feature is supported. - FeatureRequirementSupported *bool `xml:"featureRequirementSupported" json:"featureRequirementSupported,omitempty"` + FeatureRequirementSupported bool `xml:"featureRequirementSupported" json:"featureRequirementSupported"` // Indicates whether a monitor type change is supported while this virtual // machine is in the poweredOn state. - PoweredOnMonitorTypeChangeSupported *bool `xml:"poweredOnMonitorTypeChangeSupported" json:"poweredOnMonitorTypeChangeSupported,omitempty"` + PoweredOnMonitorTypeChangeSupported bool `xml:"poweredOnMonitorTypeChangeSupported" json:"poweredOnMonitorTypeChangeSupported"` // Indicates whether this virtual machine supports the Flex-SE // (space-efficient, sparse) format for virtual disks. - SeSparseDiskSupported *bool `xml:"seSparseDiskSupported" json:"seSparseDiskSupported,omitempty"` + SeSparseDiskSupported bool `xml:"seSparseDiskSupported" json:"seSparseDiskSupported"` // Indicates whether this virtual machine supports nested hardware-assisted // virtualization. - NestedHVSupported *bool `xml:"nestedHVSupported" json:"nestedHVSupported,omitempty"` + NestedHVSupported bool `xml:"nestedHVSupported" json:"nestedHVSupported"` // Indicates whether this virtual machine supports virtualized CPU performance // counters. - VPMCSupported *bool `xml:"vPMCSupported" json:"vPMCSupported,omitempty"` + VPMCSupported bool `xml:"vPMCSupported" json:"vPMCSupported"` // Indicates whether secureBoot is supported for this virtual machine. SecureBootSupported *bool `xml:"secureBootSupported" json:"secureBootSupported,omitempty"` // Indicates whether this virtual machine supports Per-VM EVC mode. @@ -88439,7 +88998,9 @@ type VirtualMachineCapability struct { // SEV is // supported when set to true, and unsupported otherwise. SevSupported *bool `xml:"sevSupported" json:"sevSupported,omitempty" vim:"7.0.1.0"` - // Indicates support for failover to a dfferent host on VM's with pmem. + // Deprecated as of vSphere 9.0 APIs with no replacement. + // + // Indicates support for failover to a different host on VM's with pmem. // // Failover is supported when set to true, and unsupported otherwise. PmemFailoverSupported *bool `xml:"pmemFailoverSupported" json:"pmemFailoverSupported,omitempty" vim:"7.0.2.0"` @@ -88633,7 +89194,7 @@ type VirtualMachineConfigInfo struct { // Time the virtual machine's configuration was created. CreateDate *time.Time `xml:"createDate" json:"createDate,omitempty"` // VirtualCenter-specific 128-bit UUID of a virtual machine, represented - // as a hexademical string. + // as a hexadecimal string. // // This identifier is used by VirtualCenter to // uniquely identify all virtual machine instances, including those that @@ -88661,14 +89222,14 @@ type VirtualMachineConfigInfo struct { // // See also `VirtualMachineConfigInfoNpivWwnType_enum`. NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty" json:"npivWorldWideNameType,omitempty"` - // The NPIV node WWNs to be extended from the original list of WWN nummbers. + // The NPIV node WWNs to be extended from the original list of WWN numbers. // // This // property should be set to desired number which is an aggregate of existing // plus new numbers. Desired Node WWNs should always be greater than the existing // number of node WWNs NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty" json:"npivDesiredNodeWwns,omitempty"` - // The NPIV port WWNs to be extended from the original list of WWN nummbers. + // The NPIV port WWNs to be extended from the original list of WWN numbers. // // This // property should be set to desired number which is an aggregate of existing @@ -88925,6 +89486,8 @@ type VirtualMachineConfigInfo struct { SevEnabled *bool `xml:"sevEnabled" json:"sevEnabled,omitempty" vim:"7.0.1.0"` // vNUMA info. NumaInfo *VirtualMachineVirtualNumaInfo `xml:"numaInfo,omitempty" json:"numaInfo,omitempty" vim:"8.0.0.1"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Property to indicate PMem HA failover configuration. // // \- When set to TRUE, VMs configured to use PMem @@ -88961,6 +89524,8 @@ type VirtualMachineConfigInfo struct { VmOpNotificationTimeout int64 `xml:"vmOpNotificationTimeout,omitempty" json:"vmOpNotificationTimeout,omitempty" vim:"8.0.0.1"` // Status of the device swap operation. DeviceSwap *VirtualMachineVirtualDeviceSwap `xml:"deviceSwap,omitempty" json:"deviceSwap,omitempty" vim:"8.0.0.1"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Virtual persistent memory info. Pmem *VirtualMachineVirtualPMem `xml:"pmem,omitempty" json:"pmem,omitempty" vim:"7.0.3.0"` // Assignable hardware device groups. @@ -89128,7 +89693,7 @@ type VirtualMachineConfigOptionDescriptor struct { // Indicates whether the associated set of configuration options // can be used for virtual machine creation on a given host or // cluster. - CreateSupported *bool `xml:"createSupported" json:"createSupported,omitempty"` + CreateSupported bool `xml:"createSupported" json:"createSupported"` // Indicates whether the associated set of virtual machine // configuration options is the default one for a given host or // cluster. @@ -89140,14 +89705,14 @@ type VirtualMachineConfigOptionDescriptor struct { // If this setting is TRUE, virtual machine creates will use the // associated set of configuration options, unless a config version is // explicitly specified in the `ConfigSpec`. - DefaultConfigOption *bool `xml:"defaultConfigOption" json:"defaultConfigOption,omitempty"` + DefaultConfigOption bool `xml:"defaultConfigOption" json:"defaultConfigOption"` // Indicates whether the associated set of configuration options // can be used to power on a virtual machine on a given host or // cluster. - RunSupported *bool `xml:"runSupported" json:"runSupported,omitempty"` + RunSupported bool `xml:"runSupported" json:"runSupported"` // Indicates whether the associated set of configuration options // can be used as a virtual hardware upgrade target. - UpgradeSupported *bool `xml:"upgradeSupported" json:"upgradeSupported,omitempty"` + UpgradeSupported bool `xml:"upgradeSupported" json:"upgradeSupported"` } func init() { @@ -89215,7 +89780,7 @@ type VirtualMachineConfigSpec struct { // VirtualCenter-specific 128-bit UUID of a virtual machine, represented // as a hexadecimal string. // - // This identifier is used by VirtalCenter + // This identifier is used by VirtualCenter // to uniquely identify all virtual machine instances in the Virtual // Infrastructure environment, including those that may share the same // SMBIOS UUID. @@ -89226,7 +89791,7 @@ type VirtualMachineConfigSpec struct { // machines. This identifier can be modified even when a virtual // machine is powered on. Clients can specify that vCenter Server // reassign a new identifier by a providing an empty string. Reassigning - // the identifer is not allowed for Fault Tolerance virtual machines. + // the identifier is not allowed for Fault Tolerance virtual machines. // // Reconfigure privilege: VirtualMachine.Config.Settings InstanceUuid string `xml:"instanceUuid,omitempty" json:"instanceUuid,omitempty"` @@ -89269,14 +89834,14 @@ type VirtualMachineConfigSpec struct { // // Reconfigure privilege: VirtualMachine.Config.Settings. NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty" json:"npivWorldWideNameType,omitempty"` - // The NPIV node WWNs to be extended from the original list of WWN nummbers. + // The NPIV node WWNs to be extended from the original list of WWN numbers. // // This // property should be set to desired number which is an aggregate of existing // plus new numbers. Desired Node WWNs should always be greater than the existing // number of node WWNs NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty" json:"npivDesiredNodeWwns,omitempty"` - // The NPIV port WWNs to be extended from the original list of WWN nummbers. + // The NPIV port WWNs to be extended from the original list of WWN numbers. // // This // property should be set to desired number which is an aggregate of existing @@ -89384,7 +89949,7 @@ type VirtualMachineConfigSpec struct { // if present, and use default coresPerSocket behavior. // Leave "numCoresPerSocket" unset to continue with existing // configuration (either manual or default). - NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty" json:"numCoresPerSocket,omitempty"` + NumCoresPerSocket *int32 `xml:"numCoresPerSocket,omitempty" json:"numCoresPerSocket,omitempty"` // Size of a virtual machine's memory, in MB. // // Reconfigure privilege: VirtualMachine.Config.Memory @@ -89658,6 +90223,8 @@ type VirtualMachineConfigSpec struct { // Default is i440bxHostBridge. See // `VirtualHardware.motherboardLayout` MotherboardLayout string `xml:"motherboardLayout,omitempty" json:"motherboardLayout,omitempty" vim:"8.0.0.1"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Property to enable/disable PMem HA failover. // // \- When set to TRUE, VMs configured to use PMem @@ -89698,6 +90265,8 @@ type VirtualMachineConfigSpec struct { // \- Set "simultaneousThreads" with a non-zero value to configure threads. // \- If unset, then use system defaults. SimultaneousThreads int32 `xml:"simultaneousThreads,omitempty" json:"simultaneousThreads,omitempty" vim:"8.0.0.1"` + // Deprecated as of vSphere 9.0 APIs with no replacement. + // // Configuration for virtual persistent memory. Pmem *VirtualMachineVirtualPMem `xml:"pmem,omitempty" json:"pmem,omitempty" vim:"7.0.3.0"` // Assignable hardware device groups. @@ -89740,6 +90309,25 @@ type VirtualMachineConfigSpec struct { // // SEV-SNP is enabled when set to true, and disabled otherwise. SevSnpEnabled *bool `xml:"sevSnpEnabled" json:"sevSnpEnabled,omitempty" vim:"9.0.0.0"` + // Specification of the vSphere tags that need to be modified for this + // virtual machine. + // + // Each TagSpec refers to: + // \- Operation to be performed, i.e., attach a new tag to a VM with this + // ConfigSpec, or detach an existing tag of a VM with this ConfigSpec. + // \- Information required to uniquely identify the vSphere tag that needs + // to be attached or detached. + // + // When this field is specified in the ConfigSpec during VM creation or + // VM reconfigure, then each tag specified in tagSpecs is automatically + // attached or detached (based on the operation type) when VM with + // that ConfigSpec is created or reconfigured. + // + // Note: Specifying a tag in tagSpecs using `TagId.nameId` + // only takes effect when the VM is managed by Supervisor. If an entry + // in tagSpecs is specified using `TagId.nameId`, it will be + // ignored except when set by Supervisor. + TagSpecs []TagSpec `xml:"tagSpecs,omitempty" json:"tagSpecs,omitempty" vim:"9.1.0.0"` // An optional list of `VmPlacementPolicy` for this VM. // // Each policy @@ -89765,7 +90353,7 @@ type VirtualMachineConfigSpec struct { // field is left unset. For example, if this VM is already part of any // existing vSphere compute-policies or affinity rules, then they will still // be considered during this VM's placement. - VmPlacementPolicies []BaseVmPlacementPolicy `xml:"vmPlacementPolicies,omitempty,typeattr" json:"vmPlacementPolicies,omitempty" vim:"9.0.0.0"` + VmPlacementPolicies []BaseVmPlacementPolicy `xml:"vmPlacementPolicies,omitempty,typeattr" json:"vmPlacementPolicies,omitempty" vim:"9.1.0.0"` } func init() { @@ -89847,7 +90435,7 @@ type VirtualMachineConnection struct { // The label is a UTF-8 string which specifies a unique identifier for // a connection. Label string `xml:"label" json:"label"` - // The client identifer. + // The client identifier. // // This identifier is a UTF-8 string which is semantically meaningful // for the connection. Examples of the client identifier are an IP @@ -90242,7 +90830,7 @@ type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState struct { // corresponding attachment port is missing in the kernel. // // `green` indicates that the network - // adapater is successfully attached to opaque network. + // adapter is successfully attached to opaque network. AttachmentStatus string `xml:"attachmentStatus,omitempty" json:"attachmentStatus,omitempty"` // These network adapter requirements must have equivalent capabilities // on the virtual switch in order to power on or migrate to the host. @@ -90334,7 +90922,7 @@ func init() { // The EmptyIndependentFilterSpec data object is used to specify empty independent // filter spec. // -// This obejct is passed during provisioning workflows to remove all +// This object is passed during provisioning workflows to remove all // attached independent filters. type VirtualMachineEmptyIndependentFilterSpec struct { VirtualMachineBaseIndependentFilterSpec @@ -90645,7 +91233,7 @@ type VirtualMachineFileLayoutExSnapshotLayout struct { // Powered off snapshots do not have a memory component and in some cases // the memory component is combined with the data component. When a memory // component does not exist, the value is initialized to -1. - MemoryKey int32 `xml:"memoryKey,omitempty" json:"memoryKey,omitempty"` + MemoryKey int32 `xml:"memoryKey" json:"memoryKey"` // Layout of each virtual disk of the virtual machine when the // snapshot was taken. Disk []VirtualMachineFileLayoutExDiskLayout `xml:"disk,omitempty" json:"disk,omitempty"` @@ -90806,7 +91394,7 @@ type VirtualMachineFlagInfo struct { // virtual machine. // // The common CBRC cache is shared between the hot added disks in the VM. - // If this flag is set to 'true' the VM will allocate a commont digest + // If this flag is set to 'true' the VM will allocate a common digest // cache on power on. CbrcCacheEnabled *bool `xml:"cbrcCacheEnabled" json:"cbrcCacheEnabled,omitempty"` // Flag to specify if Intel Virtualization Technology for Directed I/O @@ -91391,7 +91979,7 @@ func init() { type VirtualMachinePrecisionClockInfo struct { VirtualMachineTargetInfo - // The currrent host system clock synchronization protocol. + // The current host system clock synchronization protocol. // // Used for specifying protocol in // `VirtualPrecisionClockSystemClockBackingInfo`. @@ -91410,7 +91998,7 @@ type VirtualMachineProfileDetails struct { // Storage profile associated with Virtual Machine's home directory. Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr" json:"profile,omitempty"` // An optional list that allows specifying details of the policy associated - // with virutual disks. + // with virtual disks. DiskProfileDetails []VirtualMachineProfileDetailsDiskProfileDetails `xml:"diskProfileDetails,omitempty" json:"diskProfileDetails,omitempty"` } @@ -91789,6 +92377,26 @@ type VirtualMachineRelocateSpec struct { // Encryption requirement for the virtual machine's metadata // files (non-disk files). CryptoSpec BaseCryptoSpec `xml:"cryptoSpec,omitempty,typeattr" json:"cryptoSpec,omitempty"` + // Specification of the vSphere tags that need to be modified for this + // virtual machine. + // + // Each TagSpec refers to: + // \- Operation to be performed, i.e., attach a new tag to a VM with this + // RelocateSpec or detach an existing tag from a VM with this + // RelocateSpec. + // \- Information required to uniquely identify the vSphere tag that needs + // to be attached or detached. + // + // When this field is specified in the RelocateSpec during VM relocate, + // then each tag specified in tagSpecs is automatically attached or + // detached (based on the operation type) when VM with that RelocateSpec + // is relocated. + // + // Note: Specifying a tag in tagSpecs using `TagId.nameId` + // only takes effect when the VM is managed by Supervisor. If an entry in tagSpecs is specified using + // `TagId.nameId`, it will be ignored except when set by + // Supervisor. + TagSpecs []TagSpec `xml:"tagSpecs,omitempty" json:"tagSpecs,omitempty" vim:"9.1.0.0"` // An optional list of `VmPlacementPolicy` for this VM. // // Each policy @@ -91807,7 +92415,7 @@ type VirtualMachineRelocateSpec struct { // by Supervisor. They will be automatically populated by Supervisor based // on the placement constraints defined in Supervisor. This field will be // ignored except when set by Supervisor. - VmPlacementPolicies []BaseVmPlacementPolicy `xml:"vmPlacementPolicies,omitempty,typeattr" json:"vmPlacementPolicies,omitempty" vim:"9.0.0.0"` + VmPlacementPolicies []BaseVmPlacementPolicy `xml:"vmPlacementPolicies,omitempty,typeattr" json:"vmPlacementPolicies,omitempty" vim:"9.1.0.0"` } func init() { @@ -91870,7 +92478,7 @@ func init() { } // `VirtualMachineRelocateSpecDiskLocatorBackingSpec` is a data -// object type for crytographic information about the backing of a +// object type for cryptographic information about the backing of a // device. // // The member `VirtualMachineRelocateSpecDiskLocatorBackingSpec.parent` refers the parent in the chain of @@ -91921,7 +92529,7 @@ type VirtualMachineRuntimeInfo struct { // Represents if the vm is currently being failed over by FDM VmFailoverInProgress *bool `xml:"vmFailoverInProgress" json:"vmFailoverInProgress,omitempty" vim:"7.0.2.0"` // The fault tolerance state of the virtual machine. - FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState,omitempty" json:"faultToleranceState,omitempty"` + FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState" json:"faultToleranceState"` // The vSphere HA protection state for a virtual machine. // // Property @@ -92008,7 +92616,7 @@ type VirtualMachineRuntimeInfo struct { // Deprecated as of vSphere API 6.0. // // Record / replay state of this virtual machine. - RecordReplayState VirtualMachineRecordReplayState `xml:"recordReplayState,omitempty" json:"recordReplayState,omitempty"` + RecordReplayState VirtualMachineRecordReplayState `xml:"recordReplayState" json:"recordReplayState"` // For a powered off virtual machine, indicates whether the virtual // machine's last shutdown was an orderly power off or not. // @@ -92019,7 +92627,7 @@ type VirtualMachineRuntimeInfo struct { NeedSecondaryReason string `xml:"needSecondaryReason,omitempty" json:"needSecondaryReason,omitempty"` // This property indicates whether the guest has gone into one of the // s1, s2 or s3 standby modes, false indicates the guest is awake. - OnlineStandby *bool `xml:"onlineStandby" json:"onlineStandby,omitempty"` + OnlineStandby bool `xml:"onlineStandby" json:"onlineStandby"` // For a powered-on or suspended virtual machine in a cluster with Enhanced // VMotion Compatibility (EVC) enabled, this identifies the least-featured // EVC mode (among those for the appropriate CPU vendor) that could admit @@ -92045,7 +92653,7 @@ type VirtualMachineRuntimeInfo struct { // associated disk is not committed back to the base disk. // Use `VirtualMachine.ConsolidateVMDisks_Task` to consolidate if // needed. - ConsolidationNeeded *bool `xml:"consolidationNeeded" json:"consolidationNeeded,omitempty"` + ConsolidationNeeded bool `xml:"consolidationNeeded" json:"consolidationNeeded"` // These requirements must have equivalent host capabilities // `HostConfigInfo.featureCapability` in order to power on. OfflineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"offlineFeatureRequirement,omitempty" json:"offlineFeatureRequirement,omitempty"` @@ -92269,7 +92877,7 @@ type VirtualMachineSnapshotTree struct { Description string `xml:"description" json:"description"` // The unique identifier that distinguishes this snapshot from // other snapshots of the virtual machine. - Id int32 `xml:"id,omitempty" json:"id,omitempty"` + Id int32 `xml:"id" json:"id"` // The date and time the snapshot was taken. CreateTime time.Time `xml:"createTime" json:"createTime"` // The power state of the virtual machine when this snapshot was taken. @@ -92850,7 +93458,7 @@ type VirtualMachineVcpuConfig struct { // but not setting the vcpu's LatencySensitivity would apply the VM's // latency sensitivity level to all the vcpus of the VM. // The latency sensitivity of the vcpu should not exceed the - // latency sensivity level of the VM. + // latency sensitivity level of the VM. // The only allowed levels for vcpu Latency sensitivity // are `high` or // `normal` @@ -93176,6 +93784,8 @@ func init() { minAPIVersionForType["VirtualMachineVirtualNumaInfo"] = "8.0.0.1" } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // Virtual Persistent Memory configuration for the VM. type VirtualMachineVirtualPMem struct { DynamicData @@ -93197,240 +93807,6 @@ func init() { minAPIVersionForType["VirtualMachineVirtualPMem"] = "7.0.3.0" } -// Specification of a placement policy that anti-affines this VM (for which -// this placement policy is being specified) with multiple groups of VMs. -// -// This policy allows specifying multiple groups of VMs such that this VM is -// anti-affined with every VM of the other VM groups. Each of these other -// groups is identified by a unique vSphere tag. Effectively, this VM will -// be anti-affined with any VM that has any of those other tags. -// -// However, note that while the policy will anti-affine a given VM with -// multiple "other" groups of VMs, there is no implied affinity or -// anti-affinity: -// 1\) Within the VMs of any one of those "other" groups. -// 2\) Between the VMs of any two of those "other" groups. -// Below example will explain this in more detail. -// -// Consider a VM that needs to be anti-affined with a VM that has either -// tag-2 or tag-3 attached to it. This can be expressed by specifying -// `VmToVmGroupsAntiAffinity` policy in this VM's -// `VirtualMachineConfigSpec.vmPlacementPolicies` or -// `VirtualMachineRelocateSpec.vmPlacementPolicies` and it would imply: -// \- This VM will be anti-affined with every VM that has tag-2. -// \- This VM will be anti-affined with every VM that has tag-3. -// \- Any VM that has either tag-2 or tag-3 will be anti-affined with -// this VM. -// \- To enforce the above anti-affinity while placing this VM, or any VM -// with tag-2 or tag-3, a compute-policy will be automatically created -// in this vCenter. -// \- To associate the compute-policy representing this VmToVmGroupsAntiAffinity -// VmPlacementPolicy with this VM, one of the tags associated with this -// VM will be used. -// \- In this example, one of this VM's tags, let's say tag-1, could be -// used to link this VM with such a compute-policy. Then this compute- -// policy would mean that any VM with "tag-1" will be anti-affined with -// any VM with "tag-2" or "tag-3". -// \- VMs that have "tag-2" will not have any affinity/anti-affinity among -// themselves. -// \- VMs that have "tag-3" will not have any affinity/anti-affinity among -// themselves. -// \- VMs that have "tag-2" will not have any affinity/anti-affinity with -// VMs that have "tag-3". Likewise for VMs with "tag-3". -// -// Note: -// \- This placement policy is different than `VmVmAntiAffinity` -// because `VmVmAntiAffinity` allows specifying only 1 VM group -// and all the VMs within that group become anti-affined with each other, -// whereas, this placement policy allows anti-affining a given VM (with -// a given tag) with multiple groups VMs (represented via different tags). -type VmToVmGroupsAntiAffinity struct { - VmPlacementPolicy - - // Tag identifying this VM to associate this `VmToVmGroupsAntiAffinity` - // placement policy with this VM. - // - // When a `VmToVmGroupsAntiAffinity` placement policy is specified for a - // VM, then one of the tags attached to this VM needs to link this VM with - // the corresponding compute-policy representing this - // `VmToVmGroupsAntiAffinity` placement policy. This is needed because - // when a VM is placed by vSphere DRS or HA, the compute-policies to be - // enforced are derived from the tag(s) attached to that VM. - // For example, consider a VM with tag-1 needs to be anti-affined with VMs - // of tag-2 and tag-3. When this placement policy needs to be specified for - // this VM, then tag-1 can be used as this VM's tag and the placement - // policy would say: \[tag-1\] ANTI-AFFINE \[tag-2, tag-3\]. - // - // If left unset, system will automatically generate a new vSphere tag - // and attach to this VM. - SelfTag string `xml:"selfTag,omitempty" json:"selfTag,omitempty"` - // Tags identifying the "other" VM groups that need to be anti-affined with - // this VM. - // - // A VM with any tag from the list of tags in `VmToVmGroupsAntiAffinity.antiAffinedVmGroupTags` - // will be anti-affined with the VM that has `VmToVmGroupsAntiAffinity.selfTag` tag. - // any VM that has any of the other tags in - // - // This field must have at least one value that must be different from the - // value of `VmToVmGroupsAntiAffinity.selfTag`. If this field is left unset or empty, then - // this `VmToVmGroupsAntiAffinity` placement policy will be ignored while - // placing this VM. - AntiAffinedVmGroupTags []string `xml:"antiAffinedVmGroupTags,omitempty" json:"antiAffinedVmGroupTags,omitempty"` - // Specifies the strictness of this `VmToVmGroupsAntiAffinity` placement - // policy while placing a VM for which this policy has been specified. - // - // For details, see - // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` - // - // If this field is left unset, then the default value of - // `PreferredDuringPlacementIgnoredDuringExecution` - // will be assumed. - PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` - // Specifies the topology for enforcing this `VmToVmGroupsAntiAffinity` - // placement policy while placing a VM for which this policy is specified. - // - // For possible values, see - // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. - // - // For example: - // \- If this is set to - // `VSphereZone` - // for a `VmToVmGroupsAntiAffinity` placement, then the groups of VMs - // anti-affined by this policy should be placed in different vSphere Zones. - // \- If this is set to - // `Host`, - // for a `VmToVmGroupsAntiAffinity` placement, then the groups of VMs - // anti-affined by this policy should be placed on different ESXi hosts. - // - // If this field is left unset, then the default value of - // `Host` will be assumed. - PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` -} - -func init() { - t["VmToVmGroupsAntiAffinity"] = reflect.TypeOf((*VmToVmGroupsAntiAffinity)(nil)).Elem() - minAPIVersionForType["VmToVmGroupsAntiAffinity"] = "9.0.0.0" -} - -// Specification of a VM placement policy that affines a group of -// VMs among themselves. -type VmVmAffinity struct { - VmPlacementPolicy - - // Name of the vSphere tag identifying the VMs that need to be affined - // with each other. - // - // When this type of placement policy is specified for a VM - // (via `VirtualMachineConfigSpec.vmPlacementPolicies` or - // `VirtualMachineRelocateSpec.vmPlacementPolicies`), then that VM is affined with - // all the other VMs that have `VmVmAffinity.affinedVmsTagName` a vSphere tag. - // This means that DRS will attempt to place all the VMs with - // `VmVmAffinity.affinedVmsTagName` on the same target host/cluster/vSphereZone - // (where the topology of the target is specified by - // `VmVmAffinity.policyTopology`). - // - // Example: VmVmAffinity placement policy with `VmVmAffinity.affinedVmsTagName` - // equal to "test-workloads" would mean that all the VMs that have a - // vSphere tag with the name "test-workloads" should be placed on the - // same target host/cluster/vSphereZone (as indicated by - // `VmVmAffinity.policyTopology`). - AffinedVmsTagName string `xml:"affinedVmsTagName" json:"affinedVmsTagName"` - // Specifies the strictness of this VmVmAffinity placement - // policy while placing a VM for which this policy is specified. - // - // For details, see - // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` - // - // If this field is left unset, then the default value of - // `PreferredDuringPlacementIgnoredDuringExecution` - // will be assumed. - PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` - // Specifies the topology for enforcing this VmVmAffinity placement - // policy while placing a VM for which this policy is specified. - // - // For possible values, see - // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. - // - // For example: - // \- If this is set to - // `VSphereZone`, - // the VMs that have `VmVmAffinity.affinedVmsTagName` - // tag attached to them should be placed in the same vSphere Zone. - // \- If this is set to - // `Host`, - // the VMs that have `VmVmAffinity.affinedVmsTagName` - // tag attached to them should be placed on the same ESXi host. - // - // If this field is left unset, then the default value of - // `Host` will be assumed. - PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` -} - -func init() { - t["VmVmAffinity"] = reflect.TypeOf((*VmVmAffinity)(nil)).Elem() - minAPIVersionForType["VmVmAffinity"] = "9.0.0.0" -} - -// Specification of a VM placement policy that anti-affines a group of -// VMs among themselves. -type VmVmAntiAffinity struct { - VmPlacementPolicy - - // Name of the vSphere tag identifying the VMs that need to be anti-affined - // with each other. - // - // When this type of placement policy is specified for a VM, - // (via `VirtualMachineConfigSpec.vmPlacementPolicies` or - // `VirtualMachineRelocateSpec.vmPlacementPolicies`), then that VM is anti-affined - // to all the other VMs that have `VmVmAntiAffinity.antiAffinedVmsTagName`. This means - // that DRS will attempt to place all the VMs with - // `VmVmAntiAffinity.antiAffinedVmsTagName` tag on different target hosts/clusters/ - // vSphereZones (where the topology of the target is specified by - // `VmVmAntiAffinity.policyTopology`). - // - // For example - VmVmAntiAffinity placement policy with - // `VmVmAntiAffinity.antiAffinedVmsTagName` equal to "prod-workloads" would mean that - // all the VMs that have a vSphere tag with the name "prod-workloads" should - // be placed on different target hosts/clusters/vSphereZones (as indicated by - // `VmVmAntiAffinity.policyTopology`). - AntiAffinedVmsTagName string `xml:"antiAffinedVmsTagName" json:"antiAffinedVmsTagName"` - // Specifies the strictness of this VmVmAntiAffinity placement - // policy while placing a VM for which this policy is specified. - // - // For - // details, see - // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` - // - // If this field is left unset, then the default value of - // `PreferredDuringPlacementIgnoredDuringExecution` - // will be assumed. - PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` - // Specifies the topology for enforcing this VmVmAntiAffinity placement - // policy while placing a VM for which this policy is specified. - // - // For possible values, see - // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. - // - // For example: - // \- If this is set to - // `VSphereZone`, the VMs - // that have `VmVmAntiAffinity.antiAffinedVmsTagName` tag attached to them should be - // placed in different vSphere Zones. - // \- If this is set to - // `Host`, the VMs that - // have `VmVmAntiAffinity.antiAffinedVmsTagName` tag attached to them should be placed - // on different ESXi hosts (but they may be placed in the same vSphere Zone). - // - // If this field is left unset, then the default value of - // `Host` will be assumed. - PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` -} - -func init() { - t["VmVmAntiAffinity"] = reflect.TypeOf((*VmVmAntiAffinity)(nil)).Elem() - minAPIVersionForType["VmVmAntiAffinity"] = "9.0.0.0" -} - // This data object type encapsulates configuration settings // when creating a virtual machine quiesced snapshot. type VirtualMachineWindowsQuiesceSpec struct { @@ -93476,6 +93852,8 @@ func init() { t["VirtualMachineWipeResult"] = reflect.TypeOf((*VirtualMachineWipeResult)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // The Virtual NVDIMM device. type VirtualNVDIMM struct { VirtualDevice @@ -93514,6 +93892,8 @@ func init() { t["VirtualNVDIMMBackingInfo"] = reflect.TypeOf((*VirtualNVDIMMBackingInfo)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // The Virtual NVDIMM controller. type VirtualNVDIMMController struct { VirtualController @@ -93523,6 +93903,8 @@ func init() { t["VirtualNVDIMMController"] = reflect.TypeOf((*VirtualNVDIMMController)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // VirtualNVDIMMControllerOption is the data object that contains // the options for a virtual NVDIMM controller. type VirtualNVDIMMControllerOption struct { @@ -93536,6 +93918,8 @@ func init() { t["VirtualNVDIMMControllerOption"] = reflect.TypeOf((*VirtualNVDIMMControllerOption)(nil)).Elem() } +// Deprecated as of vSphere 9.0 APIs with no replacement. +// // The VirtualNVDIMMOption contains information about // a virtual NVDIMM capacity limits and rules for // capacity growth operations. @@ -93681,14 +94065,14 @@ type VirtualPCIControllerOption struct { // // This is also limited // by the number of available slots in the PCI controller. - NumVmciDevices *IntOption `xml:"numVmciDevices,omitempty" json:"numVmciDevices,omitempty"` + NumVmciDevices IntOption `xml:"numVmciDevices" json:"numVmciDevices"` // Defines the minimum, maximum, and default // number of VirtualPCIPassthrough instances available, // at any given time, in the PCI controller. // // This is also limited // by the number of available PCI Express slots in the PCI controller. - NumPCIPassthroughDevices *IntOption `xml:"numPCIPassthroughDevices,omitempty" json:"numPCIPassthroughDevices,omitempty"` + NumPCIPassthroughDevices IntOption `xml:"numPCIPassthroughDevices" json:"numPCIPassthroughDevices"` // Defines the minimum, maximum, and default // number of VirtualLsiLogicSASController instances available, // at any given time, in the PCI controller. @@ -93696,7 +94080,7 @@ type VirtualPCIControllerOption struct { // This is also limited // by the number of available PCI Express slots in the PCI controller // as well as the total number of supported SCSI controllers. - NumSasSCSIControllers *IntOption `xml:"numSasSCSIControllers,omitempty" json:"numSasSCSIControllers,omitempty"` + NumSasSCSIControllers IntOption `xml:"numSasSCSIControllers" json:"numSasSCSIControllers"` // Defines the minimum, maximum, and default // number of VirtualVmxnet3 ethernet card instances available, // at any given time, in the PCI controller. @@ -93704,7 +94088,7 @@ type VirtualPCIControllerOption struct { // This is also limited // by the number of available PCI Express slots in the PCI controller // as well as the total number of supported ethernet cards. - NumVmxnet3EthernetCards *IntOption `xml:"numVmxnet3EthernetCards,omitempty" json:"numVmxnet3EthernetCards,omitempty"` + NumVmxnet3EthernetCards IntOption `xml:"numVmxnet3EthernetCards" json:"numVmxnet3EthernetCards"` // Defines the minimum, maximum, and default // number of ParaVirtualScsiController instances available, // at any given time, in the PCI controller. @@ -93712,7 +94096,7 @@ type VirtualPCIControllerOption struct { // This is also limited // by the number of available PCI Express slots in the PCI controller // as well as the total number of supported SCSI controllers. - NumParaVirtualSCSIControllers *IntOption `xml:"numParaVirtualSCSIControllers,omitempty" json:"numParaVirtualSCSIControllers,omitempty"` + NumParaVirtualSCSIControllers IntOption `xml:"numParaVirtualSCSIControllers" json:"numParaVirtualSCSIControllers"` // Defines the minimum, maximum, and default // number of VirtualSATAController instances available, // at any given time, in the PCI controller. @@ -93720,7 +94104,7 @@ type VirtualPCIControllerOption struct { // This is also limited // by the number of available PCI Express slots in the PCI controller // as well as the total number of supported SATA controllers. - NumSATAControllers *IntOption `xml:"numSATAControllers,omitempty" json:"numSATAControllers,omitempty"` + NumSATAControllers IntOption `xml:"numSATAControllers" json:"numSATAControllers"` // Defines the minimum, maximum, and default // number of VirtualNVMEController instances available, // at any given time, in the PCI controller. @@ -95237,7 +95621,7 @@ type VirtualUSBControllerOption struct { // Range of USB device speeds supported by this USB controller type. // // Acceptable values are specified at `VirtualMachineUsbInfoSpeed_enum`. - SupportedSpeeds []string `xml:"supportedSpeeds,omitempty" json:"supportedSpeeds,omitempty"` + SupportedSpeeds []string `xml:"supportedSpeeds" json:"supportedSpeeds"` } func init() { @@ -95337,7 +95721,7 @@ func init() { // - The name and value are separated by a colon (:). // - Name:value pairs are separated by spaces. // - The escape character is a backslash (\\). Use a single backslash to embed -// a space in a value. Use a double blackslash to embed a single backslash +// a space in a value. Use a double backslash to embed a single backslash // in the value. type VirtualUSBRemoteHostBackingInfo struct { VirtualDeviceDeviceBackingInfo @@ -95399,7 +95783,7 @@ func init() { // - The name and value are separated by a colon (:). // - Name:value pairs are separated by spaces. // - The escape character is a backslash (\\). Use a single backslash to embed -// a space in a value. Use a double blackslash to embed a single backslash +// a space in a value. Use a double backslash to embed a single backslash // in the value. type VirtualUSBUSBBackingInfo struct { VirtualDeviceDeviceBackingInfo @@ -95426,7 +95810,7 @@ func init() { // The `VirtualUSBXHCIController` data object describes a virtual // USB Extensible Host Controller Interface (USB 3.0). // -// For more informatino see `VirtualUSBController`. +// For more information see `VirtualUSBController`. type VirtualUSBXHCIController struct { VirtualController @@ -97347,9 +97731,9 @@ func init() { // A `VmPlacementPolicy` for a VM can be specified in VM's // `VirtualMachineConfigSpec` or `VirtualMachineRelocateSpec` and that policy will be enforced // when that VM's placement decision is made. The placement policies specified -// via `VirtualMachineConfigSpec.vmPlacementPolicies` are enforced whenever a VM with +// via `VirtualMachineConfigSpec.VmPlacementPolicies` are enforced whenever a VM with // that ConfigSpec needs to be placed for creation or power-on. Similarly, -// placement policies specified via `VirtualMachineRelocateSpec.vmPlacementPolicies` +// placement policies specified via `VirtualMachineRelocateSpec.VmPlacementPolicies` // are enforced whenever a VM with that RelocateSpec needs to be placed for // relocating. // @@ -97400,7 +97784,7 @@ type VmPlacementPolicy struct { func init() { t["VmPlacementPolicy"] = reflect.TypeOf((*VmPlacementPolicy)(nil)).Elem() - minAPIVersionForType["VmPlacementPolicy"] = "9.0.0.0" + minAPIVersionForType["VmPlacementPolicy"] = "9.1.0.0" } // Initial VM configuration for the specified pod. @@ -97964,6 +98348,121 @@ func init() { t["VmTimedoutStartingSecondaryEvent"] = reflect.TypeOf((*VmTimedoutStartingSecondaryEvent)(nil)).Elem() } +// Specification of a placement policy that anti-affines this VM (for which +// this placement policy is being specified) with multiple groups of VMs. +// +// This policy allows specifying multiple groups of VMs such that this VM is +// anti-affined with every VM of the other VM groups. Each of these other +// groups is identified by a unique vSphere tag. Effectively, this VM will +// be anti-affined with any VM that has any of those other tags. +// +// However, note that while the policy will anti-affine a given VM with +// multiple "other" groups of VMs, there is no implied affinity or +// anti-affinity: +// 1\) Within the VMs of any one of those "other" groups. +// 2\) Between the VMs of any two of those "other" groups. +// Below example will explain this in more detail. +// +// Consider a VM that needs to be anti-affined with a VM that has either +// tag-2 or tag-3 attached to it. This can be expressed by specifying +// `VmToVmGroupsAntiAffinity` policy in this VM's +// `VirtualMachineConfigSpec.VmPlacementPolicies` or +// `VirtualMachineRelocateSpec.VmPlacementPolicies` and it would imply: +// \- This VM will be anti-affined with every VM that has tag-2. +// \- This VM will be anti-affined with every VM that has tag-3. +// \- Any VM that has either tag-2 or tag-3 will be anti-affined with +// this VM. +// \- To enforce the above anti-affinity while placing this VM, or any VM +// with tag-2 or tag-3, a compute-policy will be automatically created +// in this vCenter. +// \- To associate the compute-policy representing this VmToVmGroupsAntiAffinity +// VmPlacementPolicy with this VM, one of the tags associated with this +// VM will be used. +// \- In this example, one of this VM's tags, let's say tag-1, could be +// used to link this VM with such a compute-policy. Then this compute- +// policy would mean that any VM with "tag-1" will be anti-affined with +// any VM with "tag-2" or "tag-3". +// \- VMs that have "tag-2" will not have any affinity/anti-affinity among +// themselves. +// \- VMs that have "tag-3" will not have any affinity/anti-affinity among +// themselves. +// \- VMs that have "tag-2" will not have any affinity/anti-affinity with +// VMs that have "tag-3". Likewise for VMs with "tag-3". +// +// Note: +// \- This placement policy is different than `VmVmAntiAffinity` +// because `VmVmAntiAffinity` allows specifying only 1 VM group +// and all the VMs within that group become anti-affined with each other, +// whereas, this placement policy allows anti-affining a given VM (with +// a given tag) with multiple groups VMs (represented via different tags). +type VmToVmGroupsAntiAffinity struct { + VmPlacementPolicy + + // Tag identifying this VM to associate this `VmToVmGroupsAntiAffinity` + // placement policy with this VM. + // + // When a `VmToVmGroupsAntiAffinity` placement policy is specified for a + // VM, then one of the tags attached to this VM needs to link this VM with + // the corresponding compute-policy representing this + // `VmToVmGroupsAntiAffinity` placement policy. This is needed because + // when a VM is placed by vSphere DRS or HA, the compute-policies to be + // enforced are derived from the tag(s) attached to that VM. + // For example, consider a VM with tag-1 needs to be anti-affined with VMs + // of tag-2 and tag-3. When this placement policy needs to be specified for + // this VM, then tag-1 can be used as this VM's tag and the placement + // policy would say: \[tag-1\] ANTI-AFFINE \[tag-2, tag-3\]. + // + // If left unset, system will automatically generate a new vSphere tag + // and attach to this VM. + SelfTag TagId `xml:"selfTag,omitempty" json:"selfTag,omitempty"` + // Tags identifying the "other" VM groups that need to be anti-affined with + // this VM. + // + // A VM with any tag from the list of tags in `VmToVmGroupsAntiAffinity.AntiAffinedVmGroupTags` + // will be anti-affined with the VM that has `VmToVmGroupsAntiAffinity.SelfTag` tag. + // any VM that has any of the other tags in + // + // This field must have at least one value that must be different from the + // value of `VmToVmGroupsAntiAffinity.SelfTag`. If this field is left unset or empty, then + // this `VmToVmGroupsAntiAffinity` placement policy will be ignored while + // placing this VM. + AntiAffinedVmGroupTags []TagId `xml:"antiAffinedVmGroupTags,omitempty" json:"antiAffinedVmGroupTags,omitempty"` + // Specifies the strictness of this `VmToVmGroupsAntiAffinity` placement + // policy while placing a VM for which this policy has been specified. + // + // For details, see + // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` + // + // If this field is left unset, then the default value of + // `PreferredDuringPlacementPreferredDuringExecution` + // will be assumed. + PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` + // Specifies the topology for enforcing this `VmToVmGroupsAntiAffinity` + // placement policy while placing a VM for which this policy is specified. + // + // For possible values, see + // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. + // + // For example: + // \- If this is set to + // `VSphereZone` + // for a `VmToVmGroupsAntiAffinity` placement, then the groups of VMs + // anti-affined by this policy should be placed in different vSphere Zones. + // \- If this is set to + // `Host`, + // for a `VmToVmGroupsAntiAffinity` placement, then the groups of VMs + // anti-affined by this policy should be placed on different ESXi hosts. + // + // If this field is left unset, then the default value of + // `Host` will be assumed. + PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` +} + +func init() { + t["VmToVmGroupsAntiAffinity"] = reflect.TypeOf((*VmToVmGroupsAntiAffinity)(nil)).Elem() + minAPIVersionForType["VmToVmGroupsAntiAffinity"] = "9.1.0.0" +} + // A base fault to indicate that something went wrong when upgrading tools. type VmToolsUpgradeFault struct { VimFault @@ -98087,6 +98586,125 @@ func init() { t["VmValidateMaxDeviceFault"] = reflect.TypeOf((*VmValidateMaxDeviceFault)(nil)).Elem() } +// Specification of a VM placement policy that affines a group of +// VMs among themselves. +type VmVmAffinity struct { + VmPlacementPolicy + + // Name of the vSphere tag identifying the VMs that need to be affined + // with each other. + // + // When this type of placement policy is specified for a VM + // (via `VirtualMachineConfigSpec.VmPlacementPolicies` or + // `VirtualMachineRelocateSpec.VmPlacementPolicies`), then that VM is affined with + // all the other VMs that have `VmVmAffinity.AffinedVmsTag` a vSphere tag. + // This means that DRS will attempt to place all the VMs with + // `VmVmAffinity.AffinedVmsTag` on the same target host/cluster/vSphereZone + // (where the topology of the target is specified by + // `VmVmAffinity.PolicyTopology`). + // + // Example: VmVmAffinity placement policy with `VmVmAffinity.AffinedVmsTag` + // equal to "test-workloads" would mean that all the VMs that have a + // vSphere tag with the name "test-workloads" should be placed on the + // same target host/cluster/vSphereZone (as indicated by + // `VmVmAffinity.PolicyTopology`). + AffinedVmsTag TagId `xml:"affinedVmsTag" json:"affinedVmsTag"` + // Specifies the strictness of this VmVmAffinity placement + // policy while placing a VM for which this policy is specified. + // + // For details, see + // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` + // + // If this field is left unset, then the default value of + // `PreferredDuringPlacementPreferredDuringExecution` + // will be assumed. + PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` + // Specifies the topology for enforcing this VmVmAffinity placement + // policy while placing a VM for which this policy is specified. + // + // For possible values, see + // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. + // + // For example: + // \- If this is set to + // `VSphereZone`, + // the VMs that have `VmVmAffinity.AffinedVmsTag` + // tag attached to them should be placed in the same vSphere Zone. + // \- If this is set to + // `Host`, + // the VMs that have `VmVmAffinity.AffinedVmsTag` + // tag attached to them should be placed on the same ESXi host. + // + // If this field is left unset, then the default value of + // `Host` will be assumed. + PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` +} + +func init() { + t["VmVmAffinity"] = reflect.TypeOf((*VmVmAffinity)(nil)).Elem() + minAPIVersionForType["VmVmAffinity"] = "9.1.0.0" +} + +// Specification of a VM placement policy that anti-affines a group of +// VMs among themselves. +type VmVmAntiAffinity struct { + VmPlacementPolicy + + // Name of the vSphere tag identifying the VMs that need to be anti-affined + // with each other. + // + // When this type of placement policy is specified for a VM, + // (via `VirtualMachineConfigSpec.VmPlacementPolicies` or + // `VirtualMachineRelocateSpec.VmPlacementPolicies`), then that VM is anti-affined + // to all the other VMs that have `VmVmAntiAffinity.AntiAffinedVmsTag`. This means + // that DRS will attempt to place all the VMs with + // `VmVmAntiAffinity.AntiAffinedVmsTag` tag on different target hosts/clusters/ + // vSphereZones (where the topology of the target is specified by + // `VmVmAntiAffinity.PolicyTopology`). + // + // For example - VmVmAntiAffinity placement policy with + // `VmVmAntiAffinity.AntiAffinedVmsTag` equal to "prod-workloads" would mean that + // all the VMs that have a vSphere tag with the name "prod-workloads" should + // be placed on different target hosts/clusters/vSphereZones (as indicated by + // `VmVmAntiAffinity.PolicyTopology`). + AntiAffinedVmsTag TagId `xml:"antiAffinedVmsTag" json:"antiAffinedVmsTag"` + // Specifies the strictness of this VmVmAntiAffinity placement + // policy while placing a VM for which this policy is specified. + // + // For + // details, see + // `VmPlacementPolicyVmPlacementPolicyStrictness_enum` + // + // If this field is left unset, then the default value of + // `PreferredDuringPlacementPreferredDuringExecution` + // will be assumed. + PolicyStrictness string `xml:"policyStrictness,omitempty" json:"policyStrictness,omitempty"` + // Specifies the topology for enforcing this VmVmAntiAffinity placement + // policy while placing a VM for which this policy is specified. + // + // For possible values, see + // `VmPlacementPolicyVmPlacementPolicyTopology_enum`. + // + // For example: + // \- If this is set to + // `VSphereZone`, the VMs + // that have `VmVmAntiAffinity.AntiAffinedVmsTag` tag attached to them should be + // placed in different vSphere Zones. + // \- If this is set to + // `Host`, the VMs that + // have `VmVmAntiAffinity.AntiAffinedVmsTag` tag attached to them should be placed + // on different ESXi hosts (but they may be placed in the same vSphere Zone). + // + // If this field is left unset, then the default value of + // `Host` will be assumed. + PolicyTopology string `xml:"policyTopology,omitempty" json:"policyTopology,omitempty"` +} + +func init() { + t["VmVmAntiAffinity"] = reflect.TypeOf((*VmVmAntiAffinity)(nil)).Elem() + minAPIVersionForType["VmVmAntiAffinity"] = "9.1.0.0" +} + // This event is generated when the reservations used by all // the virtual network adapters belonging to the virtual NIC network // resource pool goes below the reservation allocated to the resource pool @@ -98362,9 +98980,9 @@ type VmfsDatastoreInfo struct { DatastoreInfo // Maximum raw device mapping size (physical compatibility) - MaxPhysicalRDMFileSize int64 `xml:"maxPhysicalRDMFileSize,omitempty" json:"maxPhysicalRDMFileSize,omitempty"` + MaxPhysicalRDMFileSize int64 `xml:"maxPhysicalRDMFileSize" json:"maxPhysicalRDMFileSize"` // Maximum raw device mapping size (virtual compatibility) - MaxVirtualRDMFileSize int64 `xml:"maxVirtualRDMFileSize,omitempty" json:"maxVirtualRDMFileSize,omitempty"` + MaxVirtualRDMFileSize int64 `xml:"maxVirtualRDMFileSize" json:"maxVirtualRDMFileSize"` // The VMFS volume information for the datastore. // // May not be @@ -98405,7 +99023,7 @@ func init() { // from a disk. // There are often multiple ways in which extents can be allocated on a disk. // Each instance of this structure represents one of the possible options -// that can be applied to provisiong VMFS datastore storage. Only options +// that can be applied to provisioning VMFS datastore storage. Only options // that follow ESX Server best practice guidelines will be presented. type VmfsDatastoreOption struct { DynamicData @@ -98654,7 +99272,7 @@ func init() { t["VmwareDistributedVirtualSwitchVlanIdSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanIdSpec)(nil)).Elem() } -// Base class for Vlan Specifiation for ports. +// Base class for Vlan Specification for ports. type VmwareDistributedVirtualSwitchVlanSpec struct { InheritablePolicy } @@ -99872,7 +100490,7 @@ type VslmCreateSpecBackingSpec struct { // Relative location in the specified datastore where disk needs to be // created. // - // If not specified disk gets created at the defualt + // If not specified disk gets created at the default // VStorageObject location on the specified datastore. Path string `xml:"path,omitempty" json:"path,omitempty"` } @@ -99933,15 +100551,14 @@ type VslmMigrateSpec struct { // the default behavior will apply. Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr" json:"profile,omitempty"` // Flag indicates any delta disk backings will be consolidated - // during migration. + // during clone/migration. // - // If unset, delta disk backings will not be - // consolidated. + // Cloning of linked clone disks always require consolidation. Consolidate *bool `xml:"consolidate" json:"consolidate,omitempty"` // Disk chain crypto information. // // If unset and if `VslmMigrateSpec.profile` contains an encryption iofilter and if - // source VStorageObject is unencrypted, then disksCyrpto will be of type + // source VStorageObject is unencrypted, then disksCrypto will be of type // CryptoSpecEncrypt, and filled with keyId that is automatically generated // and keyProviderId that is the default kms cluster. During the migration, // the object will be encrypted. @@ -99949,10 +100566,10 @@ type VslmMigrateSpec struct { // VStorageObject is unenrypted, then disksCrypto is treated as // CryptoSpecNoOp. During migration, no cryptographic change. // If unset and if `VslmMigrateSpec.profile` contains an encryption iofilter and if - // source VStorageObject is encrypted, then disksCyrpto is treated as + // source VStorageObject is encrypted, then disksCrypto is treated as // CryptoSpecNoOp. During migration, no cryptographic change. // If unset and if `VslmMigrateSpec.profile` is a default policy and if - // source VStorageObject is encrypted, then disksCyrpto is treated as + // source VStorageObject is encrypted, then disksCrypto is treated as // CryptoSpecDecrypt, during migration, the object will be decrypted. // To recrypt the disk during migration, disksCrypto has to be present. DisksCrypto *DiskCryptoSpec `xml:"disksCrypto,omitempty" json:"disksCrypto,omitempty"` @@ -100082,8 +100699,8 @@ func init() { t["VspanPortPromiscChangeFaultFault"] = reflect.TypeOf((*VspanPortPromiscChangeFaultFault)(nil)).Elem() } -// Thrown when changing a non-promiscous portgroup to promiscuous mode if any port -// in this portgroup is used as tranmistted source or dest ports in vspan +// Thrown when changing a non-promiscuous portgroup to promiscuous mode if any port +// in this portgroup is used as transmitted source or dest ports in vspan // session. type VspanPortgroupPromiscChangeFault struct { DvsFault diff --git a/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go index e2517612d0..0e06fe05a3 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go @@ -156,76 +156,49 @@ func init() { } func init() { - Add("PodVMOverheadInfo", reflect.TypeOf((*PodVMOverheadInfo)(nil)).Elem()) + minAPIVersionForType["HostRuntimeInfoPodVMInfo"] = "9.1.0.0" + Add("HostRuntimeInfoPodVMInfo", reflect.TypeOf((*HostRuntimeInfoPodVMInfo)(nil)).Elem()) } -type PodVMOverheadInfo struct { - CrxPageSharingSupported bool `xml:"crxPageSharingSupported"` - PodVMOverheadWithoutPageSharing int32 `xml:"podVMOverheadWithoutPageSharing"` - PodVMOverheadWithPageSharing int32 `xml:"podVMOverheadWithPageSharing"` +type HostRuntimeInfoPodVMInfo struct { + DynamicData + + HasPageSharingPodVM bool `xml:"hasPageSharingPodVM"` + PodVMOverheadInfo PodVMOverheadInfo `xml:"podVMOverheadInfo"` } -// Describes an action for the initial placement of a virtual machine in a cluster. -// -// This action is used by the cross cluster placement API when a virtual machine -// needs to be placed across a set of given clusters. See `Folder.PlaceVmsXCluster`. -// This action encapsulates details about the chosen cluster (via the resource pool -// inside that cluster), the chosen host and the chosen datastores for the disks of -// the virtual machine. -type ClusterClusterInitialPlacementActionEx struct { - ClusterAction +type UpdatePodVMPropertyRequestType struct { + This ManagedObjectReference `xml:"_this" json:"-"` + // Indicates the property within PodVMInfo to update + PropertyPath string `xml:"propertyPath" json:"propertyPath"` + // Value of propertyPath requested to be updated + Property AnyType `xml:"property,omitempty,typeattr" json:"property,omitempty"` +} + +func init() { + t["UpdatePodVMPropertyRequestType"] = reflect.TypeOf((*UpdatePodVMPropertyRequestType)(nil)).Elem() +} + +type UpdatePodVMProperty UpdatePodVMPropertyRequestType + +func init() { + minAPIVersionForType["UpdatePodVMProperty"] = "9.1.0.0" + t["UpdatePodVMProperty"] = reflect.TypeOf((*UpdatePodVMProperty)(nil)).Elem() +} + +type UpdatePodVMPropertyResponse struct { +} + +type BaseClusterClusterInitialPlacementAction interface { + GetClusterClusterInitialPlacementAction() *ClusterClusterInitialPlacementAction +} - // The host where the virtual machine should be initially placed. - // - // This field is optional because the primary use case of - // `Folder.PlaceVmsXCluster` is to select the best cluster for placing VMs. This - // `ClusterClusterInitialPlacementAction.targetHost` denotes the best host - // within the best cluster and it is only returned if the client asks for it, - // which is determined by `PlaceVmsXClusterSpec.hostRecommRequired`. - // If `PlaceVmsXClusterSpec.hostRecommRequired` is set to true, then the - // targetHost is returned with a valid value and if it is either set to false - // or left unset, then targetHost is also left unset. When this field is unset, - // then it means that the client did not ask for the target host within the - // recommended cluster. It does not mean that there is no recommended host - // for placing this VM in the recommended cluster. - // - // Refers instance of `HostSystem`. - TargetHost *ManagedObjectReference `xml:"targetHost,omitempty" json:"targetHost,omitempty"` - - // The chosen resource pool for placing the virtual machine. - // - // This is non-optional because recommending the best cluster (by recommending the - // resource pool in the best cluster) is the primary use case for the - // `ClusterClusterInitialPlacementAction`. - // - // Refers instance of `ResourcePool`. - Pool ManagedObjectReference `xml:"pool" json:"pool"` - - // The config spec of the virtual machine to be placed. - // - // The `Folder.PlaceVmsXCluster` method takes input of `VirtualMachineConfigSpec` - // from client and populates the backing for each virtual disk and the VM home - // path in it unless the input ConfigSpec already provides them. The existing - // settings in the input ConfigSpec are preserved and not overridden in the - // returned ConfigSpec in this action as well as the resulting - // `ClusterRecommendation`. This field is set based on whether the client needs - // `Folder.PlaceVmsXCluster` to recommend a backing datastore for the disks of - // the candidate VMs or not, which is specified via - // `PlaceVmsXClusterSpec.datastoreRecommRequired`. If - // `PlaceVmsXClusterSpec.datastoreRecommRequired` is set to true, then this - // `ClusterClusterInitialPlacementAction.configSpec` is also set with the - // backing of each disk populated. If - // `PlaceVmsXClusterSpec.datastoreRecommRequired` is either set to false or left - // unset, then this field is also left unset. When this field is left unset, - // then it means that the client did not ask to populate the backing datastore - // for the disks of the candidate VMs. - ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty" json:"configSpec,omitempty"` - - AvailableNetworks []ManagedObjectReference `xml:"availableNetworks,omitempty" json:"availableNetworks,omitempty"` +func (a ClusterClusterInitialPlacementAction) GetClusterClusterInitialPlacementAction() *ClusterClusterInitialPlacementAction { + return &a } func init() { minAPIVersionForType["ClusterClusterInitialPlacementActionEx"] = "9.1.0.0" - t["ClusterClusterInitialPlacementActionEx"] = reflect.TypeOf((*ClusterClusterInitialPlacementActionEx)(nil)).Elem() - Add("ClusterClusterInitialPlacementAction", reflect.TypeOf((*ClusterClusterInitialPlacementActionEx)(nil)).Elem()) + t["ClusterClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterClusterInitialPlacementAction)(nil)).Elem() + t["BaseClusterClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterClusterInitialPlacementAction)(nil)).Elem() } diff --git a/vendor/github.com/vmware/govmomi/vmdk/descriptor.go b/vendor/github.com/vmware/govmomi/vmdk/descriptor.go index b53b9d1dd1..f574e3fbeb 100644 --- a/vendor/github.com/vmware/govmomi/vmdk/descriptor.go +++ b/vendor/github.com/vmware/govmomi/vmdk/descriptor.go @@ -14,17 +14,19 @@ import ( "strings" "text/template" + "github.com/vmware/govmomi/crypto" "github.com/vmware/govmomi/units" ) type Descriptor struct { - Encoding string `json:"encoding"` - Version int `json:"version"` - CID DiskContentID `json:"cid"` - ParentCID DiskContentID `json:"parentCID"` - Type string `json:"type"` - Extent []Extent `json:"extent"` - DDB map[string]string `json:"ddb"` + Encoding string `json:"encoding"` + Version int `json:"version"` + CID DiskContentID `json:"cid"` + ParentCID DiskContentID `json:"parentCID"` + Type string `json:"type"` + Extent []Extent `json:"extent"` + DDB map[string]string `json:"ddb"` + EncryptionKeys *crypto.KeyLocator `json:"encryptionKeys,omitempty"` } type DiskContentID uint32 @@ -97,8 +99,16 @@ func ParseDescriptor(r io.Reader) (*Descriptor, error) { _, _ = fmt.Sscanf(val, "%x", &d.CID) case "parentcid": _, _ = fmt.Sscanf(val, "%x", &d.ParentCID) - case "createType": + case "createtype": d.Type = val + case "encryptionkeys": + if val != "" { + kl, err := crypto.ImportKeyLocator(val) + if err != nil { + return nil, err + } + d.EncryptionKeys = kl + } } } @@ -147,6 +157,7 @@ encoding="{{ .Encoding }}" CID={{ .CID }} parentCID={{ .ParentCID }} createType="{{ .Type }}" +{{ if .EncryptionKeys }}encryptionKeys="{{ .EncryptionKeys }}"{{ end }} # Extent description ({{ cap }} capacity){{range .Extent }} {{ .Permission }} {{ .Size }} {{ .Type }} "{{ .Info }}"{{end}} diff --git a/vendor/github.com/vmware/govmomi/vmdk/writer.go b/vendor/github.com/vmware/govmomi/vmdk/writer.go new file mode 100644 index 0000000000..d47dfb7ff7 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vmdk/writer.go @@ -0,0 +1,367 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: Apache-2.0 + +package vmdk + +import ( + "bytes" + "compress/zlib" + "encoding/binary" + "fmt" + "io" + "os" +) + +const ( + // SparseMagicNumber is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L48. + SparseMagicNumber = 0x564d444b // "VMDK" + + // SparseVersionIncompatFlags is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L51. + SparseVersionIncompatFlags = 3 + + // SparseFlagCompressed is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L61. + SparseFlagCompressed = (1 << 16) + + // SparseFlagEmbeddedLBA is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L62. + SparseFlagEmbeddedLBA = (1 << 17) + + // SparseFlagValidNewlineDetector is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L57. + SparseFlagValidNewlineDetector = (1 << 0) + + // GrainMarkerEndOfStream is copied from + // https://github.com/vmware/open-vmdk/blob/c977d2012d33cff8df3e809f20aa5df01e017f64/vmdk/vmware_vmdk.h#L93. + GrainMarkerEndOfStream = 0 + + // GrainSize represents the size of a grain in sectors (128 sectors = 64KB). + // This is the default grain size for VMDK sparse extents as specified in the VMDK specification. + // The grain size must be a power of 2 and greater than 8 (4KB). + GrainSize = 128 + + // GrainDirectoryOffset is the offset in sectors where the Grain Directory starts. + // This is calculated as 1 sector for the sparse extent header + 20 sectors for the embedded descriptor. + GrainDirectoryOffset = 1 + 20 +) + +// SparseExtentHeaderOnDisk represents the on-disk structure of a sparse VMDK extent header. +// Corresponds to SparseExtentHeaderOnDisk in open-vmdk/vmdk/sparse.h +type SparseExtentHeaderOnDisk struct { + MagicNumber uint32 + Version uint32 + Flags uint32 + Capacity uint64 + GrainSize uint64 + DescriptorOffset uint64 + DescriptorSize uint64 + NumGTEsPerGT uint32 + RGDOffset uint64 + GDOffset uint64 + Overhead uint64 + UncleanShutdown byte + SingleEndLine byte + NonEndLine byte + DoubleEndLineChar1 byte + DoubleEndLineChar2 byte + CompressAlgorithm uint16 + Padding [433]byte +} + +// SparseGrainLBAHeaderOnDisk represents the on-disk structure of a sparse grain LBA header. +// Corresponds to SparseGrainLBAHeaderOnDisk in open-vmdk/vmdk/sparse.h +type SparseGrainLBAHeaderOnDisk struct { + Lba uint64 + CmpSize uint32 +} + +// SparseMetaDataMarkerOnDisk represents the on-disk structure of a sparse metadata marker. +// Corresponds to SparseMetaDataMarkerOnDisk in open-vmdk/vmdk/sparse.h +type SparseMetaDataMarkerOnDisk struct { + NumSectors uint64 + Size uint32 + SectorType uint32 + Padding [496]byte +} + +// StreamOptimizedWriter creates stream-optimised VMDK files. +// It converts raw disk images into compressed VMDK format on-the-fly. +type StreamOptimizedWriter struct { + file *os.File + header SparseExtentHeaderOnDisk + Capacity int64 + GrainTables []uint64 // stores individual grain table locations + GrainDirectory []uint64 // stores grain table locations +} + +// NewStreamOptimizedWriter creates a new StreamOptimizedWriter for writing VMDK files. +// It takes the output filename and the total capacity of the virtual disk in bytes as inputs +// It returns a pointer to the StreamOptimizedWriter and an error if any. +// +// Corresponds to StreamOptimized_Create() in open-vmdk/vmdk/sparse.c +func NewStreamOptimizedWriter(filename string, capacity int64) (*StreamOptimizedWriter, error) { + outputFile, err := os.Create(filename) + if err != nil { + return nil, fmt.Errorf("failed to create output file: %v", err) + } + + return &StreamOptimizedWriter{ + file: outputFile, + Capacity: capacity, + header: SparseExtentHeaderOnDisk{ + MagicNumber: SparseMagicNumber, + Version: 3, + Capacity: uint64(capacity / SectorSize), + DescriptorOffset: 1, + GrainSize: GrainSize, + CompressAlgorithm: 1, // zlib + SingleEndLine: '\n', + NonEndLine: ' ', + DoubleEndLineChar1: '\r', + DoubleEndLineChar2: '\n', + DescriptorSize: 20, + NumGTEsPerGT: 512, + Flags: SparseFlagCompressed | SparseFlagEmbeddedLBA | SparseFlagValidNewlineDetector, + Overhead: 1 + 20 + getGrainDirectorySize(capacity) + (getGrainTables(capacity) * 4), + GDOffset: GrainDirectoryOffset, + }, + GrainDirectory: calculateGrainTableLocations(capacity), + GrainTables: make([]uint64, getGrains(capacity)), + }, nil +} + +// getGrains calculates the number of grains needed for the given capacity. +func getGrains(capacity int64) uint64 { + return uint64(capacity) / (GrainSize * SectorSize) +} + +// getGrainTables calculates the number of Grain Tables needed for the given capacity. +func getGrainTables(capacity int64) uint64 { + grains := getGrains(capacity) + grainTables := grains / uint64(512) + if grains%uint64(512) != 0 { + grainTables++ + } + return grainTables +} + +// getGrainDirectorySize calculates the size of the Grain Directory in sectors. +func getGrainDirectorySize(capacity int64) uint64 { + grainTables := getGrainTables(capacity) + grainDirectory := (grainTables * 4) / 512 + if (grainTables*4)%512 != 0 { + grainDirectory++ + } + return grainDirectory +} + +// Write reads raw disk data from the provided io.Reader, compresses it, and writes it to the VMDK file. +// It handles grain allocation, compression, and updates the Grain Tables and Grain Directory accordingly. +// Corresponds to StreamOptimizedPwrite() in open-vmdk/vmdk/sparse.c +func (w *StreamOptimizedWriter) Write(data io.Reader) error { + err := w.writeMetadata() + if err != nil { + return fmt.Errorf("failed to write metadata: %v", err) + } + var compressedBuf bytes.Buffer + zlibWriter := zlib.NewWriter(&compressedBuf) + + grainIndex := 0 + for { + // Read a grain of raw data + // Write the compressed data to the header + // Track locations in GrainTables and GrainDirectory + rawGrain := make([]byte, GrainSize*SectorSize) + n, err := io.ReadFull(data, rawGrain) + if err == io.EOF || err == io.ErrUnexpectedEOF { + break + } + if err != nil { + return fmt.Errorf("failed to read grain data: %v", err) + } + if n < len(rawGrain) { + rawGrain = rawGrain[:n] + } + + // Check if the grain is all zeroes + if isZeroed(rawGrain) { + // Mark grain as unallocated in GrainTables + w.GrainTables[grainIndex] = 0 + grainIndex++ + if grainIndex >= len(w.GrainTables) { + break + } + continue + } + + // Compress it using zlib + compressedBuf.Reset() + zlibWriter.Reset(&compressedBuf) + _, err = zlibWriter.Write(rawGrain) + if err != nil { + w.Abort() + return fmt.Errorf("failed to compress grain data: %v", err) + } + zlibWriter.Close() + compressedData := compressedBuf.Bytes() + // Update GrainTables and GrainDirectory + nextOffset, err := w.file.Seek(0, io.SeekCurrent) + if err != nil { + w.Abort() + return fmt.Errorf("failed to get current file offset: %v", err) + } + + // Write SparseGrainLBAHeaderOnDisk + sparseGrainLBAHeaderOnDisk := SparseGrainLBAHeaderOnDisk{ + Lba: uint64(grainIndex) * uint64(GrainSize), + CmpSize: uint32(len(compressedBuf.Bytes())), + } + err = binary.Write(w.file, binary.LittleEndian, &sparseGrainLBAHeaderOnDisk) + if err != nil { + w.Abort() + return fmt.Errorf("failed to write SparseGrainLBAHeaderOnDisk: %v", err) + } + + w.GrainTables[grainIndex] = uint64(nextOffset) / SectorSize + + // Write compressed data to file + _, err = w.file.Write(compressedData) + if err != nil { + w.Abort() + return fmt.Errorf("failed to write compressed grain data: %v", err) + } + + grainIndex++ + if grainIndex >= len(w.GrainTables) { + break + } + } + return nil +} + +// isZeroed checks if the given byte slice is entirely zeroes. +// Corresponds to the zero-checking logic in StreamOptimizedPwrite() in open-vmdk/vmdk/sparse.c +func isZeroed(data []byte) bool { + for _, b := range data { + if b != 0 { + return false + } + } + return true +} + +// calculateGrainTableLocations calculates the locations of Grain Tables in the VMDK file. +// Corresponds to the Grain Table location calculation in StreamOptimized_Create() in open-vmdk/vmdk/sparse.c +func calculateGrainTableLocations(capacity int64) []uint64 { + // Calculate where the first grain table starts + grainDirectoryStart := uint64(GrainDirectoryOffset) + grainDirectorySize := getGrainDirectorySize(capacity) + grainDirectoryEnd := grainDirectoryStart + grainDirectorySize - 1 + grainTableStart := grainDirectoryEnd + 1 + // Loop through the number of grain tables + grainTableLocations := make([]uint64, getGrainTables(capacity)) + for i := uint64(0); i < getGrainTables(capacity); i++ { + grainTableLocations[i] = grainTableStart + (i * 4) + } + + // Add each grain table's location to the slice (each one is 4 sectors apart) + return grainTableLocations +} + +// writeMetadata writes the SparseExtentHeaderOnDisk, Descriptor, and reserves space for Grain Directory and Grain Tables. +func (w *StreamOptimizedWriter) writeMetadata() error { + // Write SparseExtentHeaderOnDisk + err := binary.Write(w.file, binary.LittleEndian, &w.header) + if err != nil { + return fmt.Errorf("failed to write SparseMetaDataMarkerOnDisk: %v", err) + } + + // Write the descriptor + extent := Extent{ + Size: w.Capacity / SectorSize, + Type: "SPARSE", + } + descriptor := NewDescriptor(extent) + buf := &bytes.Buffer{} + err = descriptor.Write(buf) + if err != nil { + return fmt.Errorf("failed to write descriptor: %v", err) + } + n, err := w.file.Write(buf.Bytes()) + if err != nil { + return fmt.Errorf("failed to write descriptor to file: %v", err) + } + // Add padding to make descriptor size 20 sectors + paddingSize := (20 * SectorSize) - n + if paddingSize > 0 { + padding := make([]byte, paddingSize) + _, err = w.file.Write(padding) + if err != nil { + return fmt.Errorf("failed to write padding to file: %v", err) + } + } + + // Reserve space for Grain Directory and Grain Tables + overhead := make([]byte, (w.header.Overhead-1-20)*SectorSize) + if _, err := w.file.Write(overhead); err != nil { + w.Abort() + return fmt.Errorf("failed to write overhead space: %v", err) + } + + return nil +} + +// Close finalizes the VMDK file by writing Grain Tables, Grain Directory, and Metadata Marker. +// And marking the End of Stream. +// Corresponds to StreamOptimizedClose() in open-vmdk/vmdk/sparse.c +func (w *StreamOptimizedWriter) Close() error { + // Write Metadata Marker + metadataMarker := SparseMetaDataMarkerOnDisk{ + NumSectors: 0, + Size: 0, + SectorType: GrainMarkerEndOfStream, + } + err := binary.Write(w.file, binary.LittleEndian, &metadataMarker) + if err != nil { + return fmt.Errorf("failed to write SparseMetaDataMarkerOnDisk: %v", err) + } + + // Write Grain Tables to the reserved space we created in writeMetadata + // seek back to where the Grain Directory starts + _, err = w.file.Seek(int64(w.header.GDOffset*SectorSize), io.SeekStart) + if err != nil { + return fmt.Errorf("failed to seek to Grain Directory: %v", err) + } + // Write Grain Directory + for _, grainDirOffset := range w.GrainDirectory { + err := binary.Write(w.file, binary.LittleEndian, grainDirOffset) + if err != nil { + return fmt.Errorf("failed to write Grain Directory: %v", err) + } + } + // Write Grain Tables + for _, grainTableOffset := range w.GrainTables { + err := binary.Write(w.file, binary.LittleEndian, grainTableOffset) + if err != nil { + return fmt.Errorf("failed to write Grain Table: %v", err) + } + } + + return w.file.Close() +} + +// Abort cleans up the VMDK file in case of an error during writing. +// It closes and removes the partially written file. +// Corresponds to StreamOptimizedAbort() in open-vmdk/vmdk/sparse.c +func (w *StreamOptimizedWriter) Abort() error { + if err := w.file.Close(); err != nil { + return fmt.Errorf("failed to close file during abort: %v", err) + } + if err := os.Remove(w.file.Name()); err != nil { + return fmt.Errorf("failed to remove file during abort: %v", err) + } + return nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5261291068..ace3b44887 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1513,8 +1513,8 @@ github.com/uudashr/iface/identical github.com/uudashr/iface/internal/directive github.com/uudashr/iface/opaque github.com/uudashr/iface/unused -# github.com/vmware/govmomi v0.52.0 -## explicit; go 1.23.0 +# github.com/vmware/govmomi v0.53.0 +## explicit; go 1.24.13 github.com/vmware/govmomi github.com/vmware/govmomi/cli/esx github.com/vmware/govmomi/crypto
keysamplingPeriod