github.com/vmware/govmomi@v0.43.0/eam/types/enum.go (about) 1 /* 2 Copyright (c) 2021-2024 VMware, Inc. All Rights Reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package types 18 19 import ( 20 "reflect" 21 22 "github.com/vmware/govmomi/vim25/types" 23 ) 24 25 // Defines if the deployed VMs needs to run on different hosts. 26 type AgencyVMPlacementPolicyVMAntiAffinity string 27 28 const ( 29 // Denotes no specific VM anti-affinity policy. 30 AgencyVMPlacementPolicyVMAntiAffinityNone = AgencyVMPlacementPolicyVMAntiAffinity("none") 31 // Best effort is made the VMs to run on different hosts as long as 32 // this does not impact the ability of the host to satisfy current CPU 33 // or memory requirements for virtual machines on the system. 34 // 35 // NOTE: Currently not supported - i.e. the agency configuration is 36 // considered as invalid. 37 AgencyVMPlacementPolicyVMAntiAffinitySoft = AgencyVMPlacementPolicyVMAntiAffinity("soft") 38 ) 39 40 func (e AgencyVMPlacementPolicyVMAntiAffinity) Values() []AgencyVMPlacementPolicyVMAntiAffinity { 41 return []AgencyVMPlacementPolicyVMAntiAffinity{ 42 AgencyVMPlacementPolicyVMAntiAffinityNone, 43 AgencyVMPlacementPolicyVMAntiAffinitySoft, 44 } 45 } 46 47 func (e AgencyVMPlacementPolicyVMAntiAffinity) Strings() []string { 48 return types.EnumValuesAsStrings(e.Values()) 49 } 50 51 func init() { 52 types.Add("eam:AgencyVMPlacementPolicyVMAntiAffinity", reflect.TypeOf((*AgencyVMPlacementPolicyVMAntiAffinity)(nil)).Elem()) 53 } 54 55 // Defines if the deployed VM is affinied to run on the same host it is 56 // deployed on. 57 type AgencyVMPlacementPolicyVMDataAffinity string 58 59 const ( 60 // Denotes no specific VM data affinity policy. 61 AgencyVMPlacementPolicyVMDataAffinityNone = AgencyVMPlacementPolicyVMDataAffinity("none") 62 // Best effort is made the VM to run on the same host it is deployed on 63 // as long as this does not impact the ability of the host to satisfy 64 // current CPU or memory requirements for virtual machines on the 65 // system. 66 // 67 // NOTE: Currently not supported - i.e. the agency configuration is 68 // considered as invalid. 69 AgencyVMPlacementPolicyVMDataAffinitySoft = AgencyVMPlacementPolicyVMDataAffinity("soft") 70 ) 71 72 func (e AgencyVMPlacementPolicyVMDataAffinity) Values() []AgencyVMPlacementPolicyVMDataAffinity { 73 return []AgencyVMPlacementPolicyVMDataAffinity{ 74 AgencyVMPlacementPolicyVMDataAffinityNone, 75 AgencyVMPlacementPolicyVMDataAffinitySoft, 76 } 77 } 78 79 func (e AgencyVMPlacementPolicyVMDataAffinity) Strings() []string { 80 return types.EnumValuesAsStrings(e.Values()) 81 } 82 83 func init() { 84 types.Add("eam:AgencyVMPlacementPolicyVMDataAffinity", reflect.TypeOf((*AgencyVMPlacementPolicyVMDataAffinity)(nil)).Elem()) 85 } 86 87 type AgentConfigInfoAuthenticationScheme string 88 89 const ( 90 AgentConfigInfoAuthenticationSchemeNONE = AgentConfigInfoAuthenticationScheme("NONE") 91 AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID = AgentConfigInfoAuthenticationScheme("VMWARE_SESSION_ID") 92 ) 93 94 func (e AgentConfigInfoAuthenticationScheme) Values() []AgentConfigInfoAuthenticationScheme { 95 return []AgentConfigInfoAuthenticationScheme{ 96 AgentConfigInfoAuthenticationSchemeNONE, 97 AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID, 98 } 99 } 100 101 func (e AgentConfigInfoAuthenticationScheme) Strings() []string { 102 return types.EnumValuesAsStrings(e.Values()) 103 } 104 105 func init() { 106 types.Add("eam:AgentConfigInfoAuthenticationScheme", reflect.TypeOf((*AgentConfigInfoAuthenticationScheme)(nil)).Elem()) 107 } 108 109 // Defines the type of disk provisioning for the target Agent VMs. 110 type AgentConfigInfoOvfDiskProvisioning string 111 112 const ( 113 // Denotes no specific type for disk provisioning. 114 // 115 // Disks will be 116 // provisioned as defaulted by vSphere. 117 AgentConfigInfoOvfDiskProvisioningNone = AgentConfigInfoOvfDiskProvisioning("none") 118 // Disks will be provisioned with only used space allocated. 119 AgentConfigInfoOvfDiskProvisioningThin = AgentConfigInfoOvfDiskProvisioning("thin") 120 // Disks will be provisioned with full size allocated. 121 AgentConfigInfoOvfDiskProvisioningThick = AgentConfigInfoOvfDiskProvisioning("thick") 122 ) 123 124 func (e AgentConfigInfoOvfDiskProvisioning) Values() []AgentConfigInfoOvfDiskProvisioning { 125 return []AgentConfigInfoOvfDiskProvisioning{ 126 AgentConfigInfoOvfDiskProvisioningNone, 127 AgentConfigInfoOvfDiskProvisioningThin, 128 AgentConfigInfoOvfDiskProvisioningThick, 129 } 130 } 131 132 func (e AgentConfigInfoOvfDiskProvisioning) Strings() []string { 133 return types.EnumValuesAsStrings(e.Values()) 134 } 135 136 func init() { 137 types.Add("eam:AgentConfigInfoOvfDiskProvisioning", reflect.TypeOf((*AgentConfigInfoOvfDiskProvisioning)(nil)).Elem()) 138 } 139 140 // Represents the state of the VM lifecycle. 141 type AgentVmHookVmState string 142 143 const ( 144 // The VM is provisioned and not powered-on. 145 AgentVmHookVmStateProvisioned = AgentVmHookVmState("provisioned") 146 // The VM is powered on. 147 AgentVmHookVmStatePoweredOn = AgentVmHookVmState("poweredOn") 148 // The VM is about to be powered on as part of a VM upgrade workflow. 149 AgentVmHookVmStatePrePowerOn = AgentVmHookVmState("prePowerOn") 150 ) 151 152 func (e AgentVmHookVmState) Values() []AgentVmHookVmState { 153 return []AgentVmHookVmState{ 154 AgentVmHookVmStateProvisioned, 155 AgentVmHookVmStatePoweredOn, 156 AgentVmHookVmStatePrePowerOn, 157 } 158 } 159 160 func (e AgentVmHookVmState) Strings() []string { 161 return types.EnumValuesAsStrings(e.Values()) 162 } 163 164 func init() { 165 types.Add("eam:AgentVmHookVmState", reflect.TypeOf((*AgentVmHookVmState)(nil)).Elem()) 166 } 167 168 // The <code>GoalState</code> enumeration defines the goal of the entity. 169 type EamObjectRuntimeInfoGoalState string 170 171 const ( 172 // The entity should be fully deployed and active. 173 // 174 // If the entity is an 175 // `Agency`, it should install VIBs and deploy and power on all agent 176 // virtual machines. If the entity is an `Agent`, its VIB should be installed and its 177 // agent virtual machine should be deployed and powered on. 178 EamObjectRuntimeInfoGoalStateEnabled = EamObjectRuntimeInfoGoalState("enabled") 179 // The entity should be fully deployed but inactive. 180 // 181 // f the entity is an 182 // `Agency`, the behavior is similar to the <code>enabled</code> goal state, but 183 // agents are not powered on (if they have been powered on they are powered 184 // off). 185 EamObjectRuntimeInfoGoalStateDisabled = EamObjectRuntimeInfoGoalState("disabled") 186 // The entity should be completely removed from the vCenter Server. 187 // 188 // If the entity is an 189 // `Agency`, no more VIBs or agent virtual machines are deployed. All installed VIBs 190 // installed by the `Agency` are uninstalled and any deployed agent virtual machines 191 // are powered off (if they have been powered on) and deleted. 192 // If the entity is an `Agent`, its VIB is uninstalled and the virtual machine is 193 // powered off and deleted. 194 EamObjectRuntimeInfoGoalStateUninstalled = EamObjectRuntimeInfoGoalState("uninstalled") 195 ) 196 197 func (e EamObjectRuntimeInfoGoalState) Values() []EamObjectRuntimeInfoGoalState { 198 return []EamObjectRuntimeInfoGoalState{ 199 EamObjectRuntimeInfoGoalStateEnabled, 200 EamObjectRuntimeInfoGoalStateDisabled, 201 EamObjectRuntimeInfoGoalStateUninstalled, 202 } 203 } 204 205 func (e EamObjectRuntimeInfoGoalState) Strings() []string { 206 return types.EnumValuesAsStrings(e.Values()) 207 } 208 209 func init() { 210 types.Add("eam:EamObjectRuntimeInfoGoalState", reflect.TypeOf((*EamObjectRuntimeInfoGoalState)(nil)).Elem()) 211 } 212 213 // <code>Status</code> defines a health value that denotes how well the entity 214 // conforms to the goal state. 215 type EamObjectRuntimeInfoStatus string 216 217 const ( 218 // The entity is in perfect compliance with the goal state. 219 EamObjectRuntimeInfoStatusGreen = EamObjectRuntimeInfoStatus("green") 220 // The entity is actively working to reach the desired goal state. 221 EamObjectRuntimeInfoStatusYellow = EamObjectRuntimeInfoStatus("yellow") 222 // The entity has reached an issue which prevents it from reaching the desired goal 223 // state. 224 // 225 // To remediate any offending issues, look at `EamObjectRuntimeInfo.issue` 226 // and use either `EamObject.Resolve` or 227 // `EamObject.ResolveAll`. 228 EamObjectRuntimeInfoStatusRed = EamObjectRuntimeInfoStatus("red") 229 ) 230 231 func (e EamObjectRuntimeInfoStatus) Values() []EamObjectRuntimeInfoStatus { 232 return []EamObjectRuntimeInfoStatus{ 233 EamObjectRuntimeInfoStatusGreen, 234 EamObjectRuntimeInfoStatusYellow, 235 EamObjectRuntimeInfoStatusRed, 236 } 237 } 238 239 func (e EamObjectRuntimeInfoStatus) Strings() []string { 240 return types.EnumValuesAsStrings(e.Values()) 241 } 242 243 func init() { 244 types.Add("eam:EamObjectRuntimeInfoStatus", reflect.TypeOf((*EamObjectRuntimeInfoStatus)(nil)).Elem()) 245 } 246 247 // <code>MaintenanceModePolicy</code> defines how ESX Agent Manager is going 248 // to put into maintenance mode hosts which are part of a cluster not managed 249 type EsxAgentManagerMaintenanceModePolicy string 250 251 const ( 252 // Only a single host at a time will be put into maintenance mode. 253 EsxAgentManagerMaintenanceModePolicySingleHost = EsxAgentManagerMaintenanceModePolicy("singleHost") 254 // Hosts will be put into maintenance mode simultaneously. 255 // 256 // If vSphere DRS 257 // is enabled, its recommendations will be used. Otherwise, it will be 258 // attempted to put in maintenance mode simultaneously as many host as 259 // possible. 260 EsxAgentManagerMaintenanceModePolicyMultipleHosts = EsxAgentManagerMaintenanceModePolicy("multipleHosts") 261 ) 262 263 func (e EsxAgentManagerMaintenanceModePolicy) Values() []EsxAgentManagerMaintenanceModePolicy { 264 return []EsxAgentManagerMaintenanceModePolicy{ 265 EsxAgentManagerMaintenanceModePolicySingleHost, 266 EsxAgentManagerMaintenanceModePolicyMultipleHosts, 267 } 268 } 269 270 func (e EsxAgentManagerMaintenanceModePolicy) Strings() []string { 271 return types.EnumValuesAsStrings(e.Values()) 272 } 273 274 func init() { 275 types.Add("eam:EsxAgentManagerMaintenanceModePolicy", reflect.TypeOf((*EsxAgentManagerMaintenanceModePolicy)(nil)).Elem()) 276 types.AddMinAPIVersionForType("eam:EsxAgentManagerMaintenanceModePolicy", "7.4") 277 } 278 279 // Supported types of hooks for agents. 280 type HooksHookType string 281 282 const ( 283 // Hook raised for an agent immediately after a Virtual Machine was 284 // created. 285 HooksHookTypePOST_PROVISIONING = HooksHookType("POST_PROVISIONING") 286 // Hook raised for an agent immediately after a Virtual Machine was 287 // powered on. 288 HooksHookTypePOST_POWER_ON = HooksHookType("POST_POWER_ON") 289 ) 290 291 func (e HooksHookType) Values() []HooksHookType { 292 return []HooksHookType{ 293 HooksHookTypePOST_PROVISIONING, 294 HooksHookTypePOST_POWER_ON, 295 } 296 } 297 298 func (e HooksHookType) Strings() []string { 299 return types.EnumValuesAsStrings(e.Values()) 300 } 301 302 func init() { 303 types.Add("eam:HooksHookType", reflect.TypeOf((*HooksHookType)(nil)).Elem()) 304 } 305 306 // Reasons solution is not valid for application. 307 type SolutionsInvalidReason string 308 309 const ( 310 // The OVF descriptor provided in the VM source is invalid. 311 SolutionsInvalidReasonINVALID_OVF_DESCRIPTOR = SolutionsInvalidReason("INVALID_OVF_DESCRIPTOR") 312 // The provided VM source is inaccessible from ESX Agent Manager. 313 SolutionsInvalidReasonINACCESSBLE_VM_SOURCE = SolutionsInvalidReason("INACCESSBLE_VM_SOURCE") 314 // The provided networks are not suitable for application purposes. 315 SolutionsInvalidReasonINVALID_NETWORKS = SolutionsInvalidReason("INVALID_NETWORKS") 316 // The provided datastores are not suitable for application purposes. 317 SolutionsInvalidReasonINVALID_DATASTORES = SolutionsInvalidReason("INVALID_DATASTORES") 318 // The provided resource pool is not accessible or part of the cluster. 319 SolutionsInvalidReasonINVALID_RESOURCE_POOL = SolutionsInvalidReason("INVALID_RESOURCE_POOL") 320 // The provided folder is inaccessible or not part of the same datacenter 321 // with the cluster. 322 SolutionsInvalidReasonINVALID_FOLDER = SolutionsInvalidReason("INVALID_FOLDER") 323 // The provided OVF properties are insufficient to satisfy the required 324 // user configurable properties in the VM described in the vmSource. 325 SolutionsInvalidReasonINVALID_PROPERTIES = SolutionsInvalidReason("INVALID_PROPERTIES") 326 // The legacy agency requested for transition is not valid/cannot be 327 // mapped to systm Virtual Machines solution. 328 SolutionsInvalidReasonINVALID_TRANSITION = SolutionsInvalidReason("INVALID_TRANSITION") 329 ) 330 331 func (e SolutionsInvalidReason) Values() []SolutionsInvalidReason { 332 return []SolutionsInvalidReason{ 333 SolutionsInvalidReasonINVALID_OVF_DESCRIPTOR, 334 SolutionsInvalidReasonINACCESSBLE_VM_SOURCE, 335 SolutionsInvalidReasonINVALID_NETWORKS, 336 SolutionsInvalidReasonINVALID_DATASTORES, 337 SolutionsInvalidReasonINVALID_RESOURCE_POOL, 338 SolutionsInvalidReasonINVALID_FOLDER, 339 SolutionsInvalidReasonINVALID_PROPERTIES, 340 SolutionsInvalidReasonINVALID_TRANSITION, 341 } 342 } 343 344 func (e SolutionsInvalidReason) Strings() []string { 345 return types.EnumValuesAsStrings(e.Values()) 346 } 347 348 func init() { 349 types.Add("eam:SolutionsInvalidReason", reflect.TypeOf((*SolutionsInvalidReason)(nil)).Elem()) 350 } 351 352 // Describes possible reasons a solution is non compliant. 353 type SolutionsNonComplianceReason string 354 355 const ( 356 // There is ongoing work to acheive the desired state. 357 SolutionsNonComplianceReasonWORKING = SolutionsNonComplianceReason("WORKING") 358 // ESX Agent Manager has ecnountered am issue attempting to acheive the 359 // desired state. 360 SolutionsNonComplianceReasonISSUE = SolutionsNonComplianceReason("ISSUE") 361 // ESX Agent Manager is awaiting user input to continue attempting to 362 // acheive the desired state. 363 SolutionsNonComplianceReasonIN_HOOK = SolutionsNonComplianceReason("IN_HOOK") 364 // An obsoleted spec is currently in application for this solution. 365 // 366 // This state should take precedence over: 367 // - `WORKING` 368 // - `ISSUE` 369 // - `IN_HOOK` 370 SolutionsNonComplianceReasonOBSOLETE_SPEC = SolutionsNonComplianceReason("OBSOLETE_SPEC") 371 // Application for this solutiona has never been requested with 372 // `Solutions.Apply`. 373 SolutionsNonComplianceReasonNO_SPEC = SolutionsNonComplianceReason("NO_SPEC") 374 ) 375 376 func (e SolutionsNonComplianceReason) Values() []SolutionsNonComplianceReason { 377 return []SolutionsNonComplianceReason{ 378 SolutionsNonComplianceReasonWORKING, 379 SolutionsNonComplianceReasonISSUE, 380 SolutionsNonComplianceReasonIN_HOOK, 381 SolutionsNonComplianceReasonOBSOLETE_SPEC, 382 SolutionsNonComplianceReasonNO_SPEC, 383 } 384 } 385 386 func (e SolutionsNonComplianceReason) Strings() []string { 387 return types.EnumValuesAsStrings(e.Values()) 388 } 389 390 func init() { 391 types.Add("eam:SolutionsNonComplianceReason", reflect.TypeOf((*SolutionsNonComplianceReason)(nil)).Elem()) 392 } 393 394 // Virtual Machine deployment optimization strategies. 395 type SolutionsVMDeploymentOptimization string 396 397 const ( 398 // Utilizes all cloning methods available, will create initial snapshots 399 // on the Virtual Machines. 400 SolutionsVMDeploymentOptimizationALL_CLONES = SolutionsVMDeploymentOptimization("ALL_CLONES") 401 // Utilize only full copy cloning menthods, will create initial snapshots 402 // on the Virtual Machines. 403 SolutionsVMDeploymentOptimizationFULL_CLONES_ONLY = SolutionsVMDeploymentOptimization("FULL_CLONES_ONLY") 404 // Virtual Machiness will not be cloned from pre-existing deployment. 405 SolutionsVMDeploymentOptimizationNO_CLONES = SolutionsVMDeploymentOptimization("NO_CLONES") 406 ) 407 408 func (e SolutionsVMDeploymentOptimization) Values() []SolutionsVMDeploymentOptimization { 409 return []SolutionsVMDeploymentOptimization{ 410 SolutionsVMDeploymentOptimizationALL_CLONES, 411 SolutionsVMDeploymentOptimizationFULL_CLONES_ONLY, 412 SolutionsVMDeploymentOptimizationNO_CLONES, 413 } 414 } 415 416 func (e SolutionsVMDeploymentOptimization) Strings() []string { 417 return types.EnumValuesAsStrings(e.Values()) 418 } 419 420 func init() { 421 types.Add("eam:SolutionsVMDeploymentOptimization", reflect.TypeOf((*SolutionsVMDeploymentOptimization)(nil)).Elem()) 422 } 423 424 // Provisioning types for system Virtual Machines. 425 type SolutionsVMDiskProvisioning string 426 427 const ( 428 // Disks will be provisioned with only used space allocated. 429 SolutionsVMDiskProvisioningTHIN = SolutionsVMDiskProvisioning("THIN") 430 // Disks will be provisioned with full size allocated. 431 SolutionsVMDiskProvisioningTHICK = SolutionsVMDiskProvisioning("THICK") 432 ) 433 434 func (e SolutionsVMDiskProvisioning) Values() []SolutionsVMDiskProvisioning { 435 return []SolutionsVMDiskProvisioning{ 436 SolutionsVMDiskProvisioningTHIN, 437 SolutionsVMDiskProvisioningTHICK, 438 } 439 } 440 441 func (e SolutionsVMDiskProvisioning) Strings() []string { 442 return types.EnumValuesAsStrings(e.Values()) 443 } 444 445 func init() { 446 types.Add("eam:SolutionsVMDiskProvisioning", reflect.TypeOf((*SolutionsVMDiskProvisioning)(nil)).Elem()) 447 } 448 449 // Defines the DRS placement policies applied on the VMs. 450 type SolutionsVmPlacementPolicy string 451 452 const ( 453 // VMs are anti-affined to each other. 454 SolutionsVmPlacementPolicyVM_VM_ANTI_AFFINITY = SolutionsVmPlacementPolicy("VM_VM_ANTI_AFFINITY") 455 ) 456 457 func (e SolutionsVmPlacementPolicy) Values() []SolutionsVmPlacementPolicy { 458 return []SolutionsVmPlacementPolicy{ 459 SolutionsVmPlacementPolicyVM_VM_ANTI_AFFINITY, 460 } 461 } 462 463 func (e SolutionsVmPlacementPolicy) Strings() []string { 464 return types.EnumValuesAsStrings(e.Values()) 465 } 466 467 func init() { 468 types.Add("eam:SolutionsVmPlacementPolicy", reflect.TypeOf((*SolutionsVmPlacementPolicy)(nil)).Elem()) 469 }