pulumi-vsphere 4.10.0a1709017641__py3-none-any.whl → 4.17.0a1763710194__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulumi-vsphere might be problematic. Click here for more details.

Files changed (89) hide show
  1. pulumi_vsphere/__init__.py +51 -1
  2. pulumi_vsphere/_inputs.py +2568 -1025
  3. pulumi_vsphere/_utilities.py +50 -10
  4. pulumi_vsphere/compute_cluster.py +1564 -2373
  5. pulumi_vsphere/compute_cluster_host_group.py +191 -55
  6. pulumi_vsphere/compute_cluster_vm_affinity_rule.py +157 -113
  7. pulumi_vsphere/compute_cluster_vm_anti_affinity_rule.py +133 -89
  8. pulumi_vsphere/compute_cluster_vm_dependency_rule.py +314 -106
  9. pulumi_vsphere/compute_cluster_vm_group.py +256 -55
  10. pulumi_vsphere/compute_cluster_vm_host_rule.py +323 -123
  11. pulumi_vsphere/config/__init__.py +2 -1
  12. pulumi_vsphere/config/__init__.pyi +7 -2
  13. pulumi_vsphere/config/vars.py +20 -15
  14. pulumi_vsphere/configuration_profile.py +286 -0
  15. pulumi_vsphere/content_library.py +177 -71
  16. pulumi_vsphere/content_library_item.py +252 -106
  17. pulumi_vsphere/custom_attribute.py +118 -38
  18. pulumi_vsphere/datacenter.py +128 -107
  19. pulumi_vsphere/datastore_cluster.py +636 -731
  20. pulumi_vsphere/datastore_cluster_vm_anti_affinity_rule.py +251 -89
  21. pulumi_vsphere/distributed_port_group.py +1129 -967
  22. pulumi_vsphere/distributed_virtual_switch.py +1971 -2239
  23. pulumi_vsphere/distributed_virtual_switch_pvlan_mapping.py +294 -0
  24. pulumi_vsphere/dpm_host_override.py +222 -72
  25. pulumi_vsphere/drs_vm_override.py +236 -72
  26. pulumi_vsphere/entity_permissions.py +96 -69
  27. pulumi_vsphere/file.py +173 -178
  28. pulumi_vsphere/folder.py +236 -113
  29. pulumi_vsphere/get_compute_cluster.py +34 -23
  30. pulumi_vsphere/get_compute_cluster_host_group.py +52 -41
  31. pulumi_vsphere/get_configuration_profile.py +145 -0
  32. pulumi_vsphere/get_content_library.py +33 -21
  33. pulumi_vsphere/get_content_library_item.py +47 -31
  34. pulumi_vsphere/get_custom_attribute.py +26 -17
  35. pulumi_vsphere/get_datacenter.py +40 -18
  36. pulumi_vsphere/get_datastore.py +60 -24
  37. pulumi_vsphere/get_datastore_cluster.py +47 -22
  38. pulumi_vsphere/get_datastore_stats.py +204 -0
  39. pulumi_vsphere/get_distributed_virtual_switch.py +36 -23
  40. pulumi_vsphere/get_dynamic.py +55 -45
  41. pulumi_vsphere/get_folder.py +163 -25
  42. pulumi_vsphere/get_guest_os_customization.py +68 -37
  43. pulumi_vsphere/get_host.py +34 -23
  44. pulumi_vsphere/get_host_base_images.py +104 -0
  45. pulumi_vsphere/get_host_pci_device.py +78 -35
  46. pulumi_vsphere/get_host_thumbprint.py +58 -38
  47. pulumi_vsphere/get_host_vgpu_profile.py +195 -0
  48. pulumi_vsphere/get_license.py +44 -28
  49. pulumi_vsphere/get_network.py +157 -46
  50. pulumi_vsphere/get_ovf_vm_template.py +184 -301
  51. pulumi_vsphere/get_policy.py +23 -15
  52. pulumi_vsphere/get_resource_pool.py +107 -40
  53. pulumi_vsphere/get_role.py +49 -35
  54. pulumi_vsphere/get_tag.py +34 -23
  55. pulumi_vsphere/get_tag_category.py +32 -21
  56. pulumi_vsphere/get_vapp_container.py +31 -21
  57. pulumi_vsphere/get_virtual_machine.py +499 -287
  58. pulumi_vsphere/get_vmfs_disks.py +42 -29
  59. pulumi_vsphere/guest_os_customization.py +135 -79
  60. pulumi_vsphere/ha_vm_override.py +470 -577
  61. pulumi_vsphere/host.py +515 -262
  62. pulumi_vsphere/host_port_group.py +352 -355
  63. pulumi_vsphere/host_virtual_switch.py +580 -580
  64. pulumi_vsphere/license.py +110 -92
  65. pulumi_vsphere/nas_datastore.py +398 -270
  66. pulumi_vsphere/offline_software_depot.py +190 -0
  67. pulumi_vsphere/outputs.py +1582 -1027
  68. pulumi_vsphere/provider.py +172 -152
  69. pulumi_vsphere/pulumi-plugin.json +2 -1
  70. pulumi_vsphere/resource_pool.py +357 -273
  71. pulumi_vsphere/role.py +79 -47
  72. pulumi_vsphere/storage_drs_vm_override.py +225 -89
  73. pulumi_vsphere/supervisor.py +1064 -0
  74. pulumi_vsphere/tag.py +217 -55
  75. pulumi_vsphere/tag_category.py +158 -72
  76. pulumi_vsphere/vapp_container.py +425 -259
  77. pulumi_vsphere/vapp_entity.py +324 -174
  78. pulumi_vsphere/virtual_disk.py +245 -153
  79. pulumi_vsphere/virtual_machine.py +1696 -1836
  80. pulumi_vsphere/virtual_machine_class.py +448 -0
  81. pulumi_vsphere/virtual_machine_snapshot.py +137 -131
  82. pulumi_vsphere/vm_storage_policy.py +160 -154
  83. pulumi_vsphere/vmfs_datastore.py +460 -186
  84. pulumi_vsphere/vnic.py +249 -231
  85. {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/METADATA +7 -6
  86. pulumi_vsphere-4.17.0a1763710194.dist-info/RECORD +89 -0
  87. {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/WHEEL +1 -1
  88. pulumi_vsphere-4.10.0a1709017641.dist-info/RECORD +0 -80
  89. {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,17 @@
1
1
  # coding=utf-8
2
- # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
3
  # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
 
5
- import copy
5
+ import builtins as _builtins
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = ['DrsVmOverrideArgs', 'DrsVmOverride']
@@ -14,25 +19,25 @@ __all__ = ['DrsVmOverrideArgs', 'DrsVmOverride']
14
19
  @pulumi.input_type
15
20
  class DrsVmOverrideArgs:
16
21
  def __init__(__self__, *,
17
- compute_cluster_id: pulumi.Input[str],
18
- virtual_machine_id: pulumi.Input[str],
19
- drs_automation_level: Optional[pulumi.Input[str]] = None,
20
- drs_enabled: Optional[pulumi.Input[bool]] = None):
22
+ compute_cluster_id: pulumi.Input[_builtins.str],
23
+ virtual_machine_id: pulumi.Input[_builtins.str],
24
+ drs_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
25
+ drs_enabled: Optional[pulumi.Input[_builtins.bool]] = None):
21
26
  """
22
27
  The set of arguments for constructing a DrsVmOverride resource.
23
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
28
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
24
29
  ID of the cluster to put the override in. Forces a new
25
30
  resource if changed.
26
- :param pulumi.Input[str] virtual_machine_id: The UUID of the virtual machine to create
31
+ :param pulumi.Input[_builtins.str] virtual_machine_id: The UUID of the virtual machine to create
27
32
  the override for. Forces a new resource if changed.
28
- :param pulumi.Input[str] drs_automation_level: Overrides the automation level for this virtual
33
+ :param pulumi.Input[_builtins.str] drs_automation_level: Overrides the automation level for this virtual
29
34
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
30
35
  `fullyAutomated`. Default: `manual`.
31
36
 
32
37
  > **NOTE:** Using this resource _always_ implies an override, even if one of
33
38
  `drs_enabled` or `drs_automation_level` is omitted. Take note of the defaults
34
39
  for both options.
35
- :param pulumi.Input[bool] drs_enabled: Overrides the default DRS setting for this virtual
40
+ :param pulumi.Input[_builtins.bool] drs_enabled: Overrides the default DRS setting for this virtual
36
41
  machine. Can be either `true` or `false`. Default: `false`.
37
42
  """
38
43
  pulumi.set(__self__, "compute_cluster_id", compute_cluster_id)
@@ -42,9 +47,9 @@ class DrsVmOverrideArgs:
42
47
  if drs_enabled is not None:
43
48
  pulumi.set(__self__, "drs_enabled", drs_enabled)
44
49
 
45
- @property
50
+ @_builtins.property
46
51
  @pulumi.getter(name="computeClusterId")
47
- def compute_cluster_id(self) -> pulumi.Input[str]:
52
+ def compute_cluster_id(self) -> pulumi.Input[_builtins.str]:
48
53
  """
49
54
  The managed object reference
50
55
  ID of the cluster to put the override in. Forces a new
@@ -53,12 +58,12 @@ class DrsVmOverrideArgs:
53
58
  return pulumi.get(self, "compute_cluster_id")
54
59
 
55
60
  @compute_cluster_id.setter
56
- def compute_cluster_id(self, value: pulumi.Input[str]):
61
+ def compute_cluster_id(self, value: pulumi.Input[_builtins.str]):
57
62
  pulumi.set(self, "compute_cluster_id", value)
58
63
 
59
- @property
64
+ @_builtins.property
60
65
  @pulumi.getter(name="virtualMachineId")
61
- def virtual_machine_id(self) -> pulumi.Input[str]:
66
+ def virtual_machine_id(self) -> pulumi.Input[_builtins.str]:
62
67
  """
63
68
  The UUID of the virtual machine to create
64
69
  the override for. Forces a new resource if changed.
@@ -66,12 +71,12 @@ class DrsVmOverrideArgs:
66
71
  return pulumi.get(self, "virtual_machine_id")
67
72
 
68
73
  @virtual_machine_id.setter
69
- def virtual_machine_id(self, value: pulumi.Input[str]):
74
+ def virtual_machine_id(self, value: pulumi.Input[_builtins.str]):
70
75
  pulumi.set(self, "virtual_machine_id", value)
71
76
 
72
- @property
77
+ @_builtins.property
73
78
  @pulumi.getter(name="drsAutomationLevel")
74
- def drs_automation_level(self) -> Optional[pulumi.Input[str]]:
79
+ def drs_automation_level(self) -> Optional[pulumi.Input[_builtins.str]]:
75
80
  """
76
81
  Overrides the automation level for this virtual
77
82
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
@@ -84,12 +89,12 @@ class DrsVmOverrideArgs:
84
89
  return pulumi.get(self, "drs_automation_level")
85
90
 
86
91
  @drs_automation_level.setter
87
- def drs_automation_level(self, value: Optional[pulumi.Input[str]]):
92
+ def drs_automation_level(self, value: Optional[pulumi.Input[_builtins.str]]):
88
93
  pulumi.set(self, "drs_automation_level", value)
89
94
 
90
- @property
95
+ @_builtins.property
91
96
  @pulumi.getter(name="drsEnabled")
92
- def drs_enabled(self) -> Optional[pulumi.Input[bool]]:
97
+ def drs_enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
93
98
  """
94
99
  Overrides the default DRS setting for this virtual
95
100
  machine. Can be either `true` or `false`. Default: `false`.
@@ -97,32 +102,32 @@ class DrsVmOverrideArgs:
97
102
  return pulumi.get(self, "drs_enabled")
98
103
 
99
104
  @drs_enabled.setter
100
- def drs_enabled(self, value: Optional[pulumi.Input[bool]]):
105
+ def drs_enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
101
106
  pulumi.set(self, "drs_enabled", value)
102
107
 
103
108
 
104
109
  @pulumi.input_type
105
110
  class _DrsVmOverrideState:
106
111
  def __init__(__self__, *,
107
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
108
- drs_automation_level: Optional[pulumi.Input[str]] = None,
109
- drs_enabled: Optional[pulumi.Input[bool]] = None,
110
- virtual_machine_id: Optional[pulumi.Input[str]] = None):
112
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
113
+ drs_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
114
+ drs_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
115
+ virtual_machine_id: Optional[pulumi.Input[_builtins.str]] = None):
111
116
  """
112
117
  Input properties used for looking up and filtering DrsVmOverride resources.
113
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
118
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
114
119
  ID of the cluster to put the override in. Forces a new
115
120
  resource if changed.
116
- :param pulumi.Input[str] drs_automation_level: Overrides the automation level for this virtual
121
+ :param pulumi.Input[_builtins.str] drs_automation_level: Overrides the automation level for this virtual
117
122
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
118
123
  `fullyAutomated`. Default: `manual`.
119
124
 
120
125
  > **NOTE:** Using this resource _always_ implies an override, even if one of
121
126
  `drs_enabled` or `drs_automation_level` is omitted. Take note of the defaults
122
127
  for both options.
123
- :param pulumi.Input[bool] drs_enabled: Overrides the default DRS setting for this virtual
128
+ :param pulumi.Input[_builtins.bool] drs_enabled: Overrides the default DRS setting for this virtual
124
129
  machine. Can be either `true` or `false`. Default: `false`.
125
- :param pulumi.Input[str] virtual_machine_id: The UUID of the virtual machine to create
130
+ :param pulumi.Input[_builtins.str] virtual_machine_id: The UUID of the virtual machine to create
126
131
  the override for. Forces a new resource if changed.
127
132
  """
128
133
  if compute_cluster_id is not None:
@@ -134,9 +139,9 @@ class _DrsVmOverrideState:
134
139
  if virtual_machine_id is not None:
135
140
  pulumi.set(__self__, "virtual_machine_id", virtual_machine_id)
136
141
 
137
- @property
142
+ @_builtins.property
138
143
  @pulumi.getter(name="computeClusterId")
139
- def compute_cluster_id(self) -> Optional[pulumi.Input[str]]:
144
+ def compute_cluster_id(self) -> Optional[pulumi.Input[_builtins.str]]:
140
145
  """
141
146
  The managed object reference
142
147
  ID of the cluster to put the override in. Forces a new
@@ -145,12 +150,12 @@ class _DrsVmOverrideState:
145
150
  return pulumi.get(self, "compute_cluster_id")
146
151
 
147
152
  @compute_cluster_id.setter
148
- def compute_cluster_id(self, value: Optional[pulumi.Input[str]]):
153
+ def compute_cluster_id(self, value: Optional[pulumi.Input[_builtins.str]]):
149
154
  pulumi.set(self, "compute_cluster_id", value)
150
155
 
151
- @property
156
+ @_builtins.property
152
157
  @pulumi.getter(name="drsAutomationLevel")
153
- def drs_automation_level(self) -> Optional[pulumi.Input[str]]:
158
+ def drs_automation_level(self) -> Optional[pulumi.Input[_builtins.str]]:
154
159
  """
155
160
  Overrides the automation level for this virtual
156
161
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
@@ -163,12 +168,12 @@ class _DrsVmOverrideState:
163
168
  return pulumi.get(self, "drs_automation_level")
164
169
 
165
170
  @drs_automation_level.setter
166
- def drs_automation_level(self, value: Optional[pulumi.Input[str]]):
171
+ def drs_automation_level(self, value: Optional[pulumi.Input[_builtins.str]]):
167
172
  pulumi.set(self, "drs_automation_level", value)
168
173
 
169
- @property
174
+ @_builtins.property
170
175
  @pulumi.getter(name="drsEnabled")
171
- def drs_enabled(self) -> Optional[pulumi.Input[bool]]:
176
+ def drs_enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
172
177
  """
173
178
  Overrides the default DRS setting for this virtual
174
179
  machine. Can be either `true` or `false`. Default: `false`.
@@ -176,12 +181,12 @@ class _DrsVmOverrideState:
176
181
  return pulumi.get(self, "drs_enabled")
177
182
 
178
183
  @drs_enabled.setter
179
- def drs_enabled(self, value: Optional[pulumi.Input[bool]]):
184
+ def drs_enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
180
185
  pulumi.set(self, "drs_enabled", value)
181
186
 
182
- @property
187
+ @_builtins.property
183
188
  @pulumi.getter(name="virtualMachineId")
184
- def virtual_machine_id(self) -> Optional[pulumi.Input[str]]:
189
+ def virtual_machine_id(self) -> Optional[pulumi.Input[_builtins.str]]:
185
190
  """
186
191
  The UUID of the virtual machine to create
187
192
  the override for. Forces a new resource if changed.
@@ -189,37 +194,117 @@ class _DrsVmOverrideState:
189
194
  return pulumi.get(self, "virtual_machine_id")
190
195
 
191
196
  @virtual_machine_id.setter
192
- def virtual_machine_id(self, value: Optional[pulumi.Input[str]]):
197
+ def virtual_machine_id(self, value: Optional[pulumi.Input[_builtins.str]]):
193
198
  pulumi.set(self, "virtual_machine_id", value)
194
199
 
195
200
 
201
+ @pulumi.type_token("vsphere:index/drsVmOverride:DrsVmOverride")
196
202
  class DrsVmOverride(pulumi.CustomResource):
197
203
  @overload
198
204
  def __init__(__self__,
199
205
  resource_name: str,
200
206
  opts: Optional[pulumi.ResourceOptions] = None,
201
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
202
- drs_automation_level: Optional[pulumi.Input[str]] = None,
203
- drs_enabled: Optional[pulumi.Input[bool]] = None,
204
- virtual_machine_id: Optional[pulumi.Input[str]] = None,
207
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
208
+ drs_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
209
+ drs_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
210
+ virtual_machine_id: Optional[pulumi.Input[_builtins.str]] = None,
205
211
  __props__=None):
206
212
  """
207
- Create a DrsVmOverride resource with the given unique name, props, and options.
213
+ The `DrsVmOverride` resource can be used to add a DRS override to a
214
+ cluster for a specific virtual machine. With this resource, one can enable or
215
+ disable DRS and control the automation level for a single virtual machine
216
+ without affecting the rest of the cluster.
217
+
218
+ For more information on vSphere clusters and DRS, see [this
219
+ page][ref-vsphere-drs-clusters].
220
+
221
+ [ref-vsphere-drs-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/creating-a-drs-cluster.html
222
+
223
+ > **NOTE:** This resource requires vCenter and is not available on direct ESXi
224
+ connections.
225
+
226
+ ## Example Usage
227
+
228
+ The example below creates a virtual machine in a cluster using the
229
+ `VirtualMachine` resource, creating the
230
+ virtual machine in the cluster looked up by the
231
+ `ComputeCluster` data source, but also
232
+ pinning the VM to a host defined by the
233
+ `Host` data source, which is assumed to
234
+ be a host within the cluster. To ensure that the VM stays on this host and does
235
+ not need to be migrated back at any point in time, an override is entered using
236
+ the `DrsVmOverride` resource that disables DRS for this virtual
237
+ machine, ensuring that it does not move.
238
+
239
+ ```python
240
+ import pulumi
241
+ import pulumi_vsphere as vsphere
242
+
243
+ datacenter = vsphere.get_datacenter(name="dc-01")
244
+ datastore = vsphere.get_datastore(name="datastore1",
245
+ datacenter_id=datacenter.id)
246
+ cluster = vsphere.get_compute_cluster(name="cluster-01",
247
+ datacenter_id=datacenter.id)
248
+ host = vsphere.get_host(name="esxi-01.example.com",
249
+ datacenter_id=datacenter.id)
250
+ network = vsphere.get_network(name="network1",
251
+ datacenter_id=datacenter.id)
252
+ vm = vsphere.VirtualMachine("vm",
253
+ name="test",
254
+ resource_pool_id=cluster.resource_pool_id,
255
+ host_system_id=host.id,
256
+ datastore_id=datastore.id,
257
+ num_cpus=2,
258
+ memory=2048,
259
+ guest_id="otherLinux64Guest",
260
+ network_interfaces=[{
261
+ "network_id": network.id,
262
+ }],
263
+ disks=[{
264
+ "label": "disk0",
265
+ "size": 20,
266
+ }])
267
+ drs_vm_override = vsphere.DrsVmOverride("drs_vm_override",
268
+ compute_cluster_id=cluster.id,
269
+ virtual_machine_id=vm.id,
270
+ drs_enabled=False)
271
+ ```
272
+
273
+ ## Import
274
+
275
+ An existing override can be imported into this resource by
276
+
277
+ supplying both the path to the cluster, and the path to the virtual machine, to
278
+
279
+ `pulumi import`. If no override exists, an error will be given. An example
280
+
281
+ is below:
282
+
283
+ [docs-import]: https://developer.hashicorp.com/terraform/cli/import
284
+
285
+ ```sh
286
+ $ pulumi import vsphere:index/drsVmOverride:DrsVmOverride drs_vm_override \\
287
+ ```
288
+
289
+ '{"compute_cluster_path": "/dc1/host/cluster1", \\
290
+
291
+ "virtual_machine_path": "/dc1/vm/srv1"}'
292
+
208
293
  :param str resource_name: The name of the resource.
209
294
  :param pulumi.ResourceOptions opts: Options for the resource.
210
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
295
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
211
296
  ID of the cluster to put the override in. Forces a new
212
297
  resource if changed.
213
- :param pulumi.Input[str] drs_automation_level: Overrides the automation level for this virtual
298
+ :param pulumi.Input[_builtins.str] drs_automation_level: Overrides the automation level for this virtual
214
299
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
215
300
  `fullyAutomated`. Default: `manual`.
216
301
 
217
302
  > **NOTE:** Using this resource _always_ implies an override, even if one of
218
303
  `drs_enabled` or `drs_automation_level` is omitted. Take note of the defaults
219
304
  for both options.
220
- :param pulumi.Input[bool] drs_enabled: Overrides the default DRS setting for this virtual
305
+ :param pulumi.Input[_builtins.bool] drs_enabled: Overrides the default DRS setting for this virtual
221
306
  machine. Can be either `true` or `false`. Default: `false`.
222
- :param pulumi.Input[str] virtual_machine_id: The UUID of the virtual machine to create
307
+ :param pulumi.Input[_builtins.str] virtual_machine_id: The UUID of the virtual machine to create
223
308
  the override for. Forces a new resource if changed.
224
309
  """
225
310
  ...
@@ -229,7 +314,86 @@ class DrsVmOverride(pulumi.CustomResource):
229
314
  args: DrsVmOverrideArgs,
230
315
  opts: Optional[pulumi.ResourceOptions] = None):
231
316
  """
232
- Create a DrsVmOverride resource with the given unique name, props, and options.
317
+ The `DrsVmOverride` resource can be used to add a DRS override to a
318
+ cluster for a specific virtual machine. With this resource, one can enable or
319
+ disable DRS and control the automation level for a single virtual machine
320
+ without affecting the rest of the cluster.
321
+
322
+ For more information on vSphere clusters and DRS, see [this
323
+ page][ref-vsphere-drs-clusters].
324
+
325
+ [ref-vsphere-drs-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/creating-a-drs-cluster.html
326
+
327
+ > **NOTE:** This resource requires vCenter and is not available on direct ESXi
328
+ connections.
329
+
330
+ ## Example Usage
331
+
332
+ The example below creates a virtual machine in a cluster using the
333
+ `VirtualMachine` resource, creating the
334
+ virtual machine in the cluster looked up by the
335
+ `ComputeCluster` data source, but also
336
+ pinning the VM to a host defined by the
337
+ `Host` data source, which is assumed to
338
+ be a host within the cluster. To ensure that the VM stays on this host and does
339
+ not need to be migrated back at any point in time, an override is entered using
340
+ the `DrsVmOverride` resource that disables DRS for this virtual
341
+ machine, ensuring that it does not move.
342
+
343
+ ```python
344
+ import pulumi
345
+ import pulumi_vsphere as vsphere
346
+
347
+ datacenter = vsphere.get_datacenter(name="dc-01")
348
+ datastore = vsphere.get_datastore(name="datastore1",
349
+ datacenter_id=datacenter.id)
350
+ cluster = vsphere.get_compute_cluster(name="cluster-01",
351
+ datacenter_id=datacenter.id)
352
+ host = vsphere.get_host(name="esxi-01.example.com",
353
+ datacenter_id=datacenter.id)
354
+ network = vsphere.get_network(name="network1",
355
+ datacenter_id=datacenter.id)
356
+ vm = vsphere.VirtualMachine("vm",
357
+ name="test",
358
+ resource_pool_id=cluster.resource_pool_id,
359
+ host_system_id=host.id,
360
+ datastore_id=datastore.id,
361
+ num_cpus=2,
362
+ memory=2048,
363
+ guest_id="otherLinux64Guest",
364
+ network_interfaces=[{
365
+ "network_id": network.id,
366
+ }],
367
+ disks=[{
368
+ "label": "disk0",
369
+ "size": 20,
370
+ }])
371
+ drs_vm_override = vsphere.DrsVmOverride("drs_vm_override",
372
+ compute_cluster_id=cluster.id,
373
+ virtual_machine_id=vm.id,
374
+ drs_enabled=False)
375
+ ```
376
+
377
+ ## Import
378
+
379
+ An existing override can be imported into this resource by
380
+
381
+ supplying both the path to the cluster, and the path to the virtual machine, to
382
+
383
+ `pulumi import`. If no override exists, an error will be given. An example
384
+
385
+ is below:
386
+
387
+ [docs-import]: https://developer.hashicorp.com/terraform/cli/import
388
+
389
+ ```sh
390
+ $ pulumi import vsphere:index/drsVmOverride:DrsVmOverride drs_vm_override \\
391
+ ```
392
+
393
+ '{"compute_cluster_path": "/dc1/host/cluster1", \\
394
+
395
+ "virtual_machine_path": "/dc1/vm/srv1"}'
396
+
233
397
  :param str resource_name: The name of the resource.
234
398
  :param DrsVmOverrideArgs args: The arguments to use to populate this resource's properties.
235
399
  :param pulumi.ResourceOptions opts: Options for the resource.
@@ -245,10 +409,10 @@ class DrsVmOverride(pulumi.CustomResource):
245
409
  def _internal_init(__self__,
246
410
  resource_name: str,
247
411
  opts: Optional[pulumi.ResourceOptions] = None,
248
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
249
- drs_automation_level: Optional[pulumi.Input[str]] = None,
250
- drs_enabled: Optional[pulumi.Input[bool]] = None,
251
- virtual_machine_id: Optional[pulumi.Input[str]] = None,
412
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
413
+ drs_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
414
+ drs_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
415
+ virtual_machine_id: Optional[pulumi.Input[_builtins.str]] = None,
252
416
  __props__=None):
253
417
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
254
418
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -276,10 +440,10 @@ class DrsVmOverride(pulumi.CustomResource):
276
440
  def get(resource_name: str,
277
441
  id: pulumi.Input[str],
278
442
  opts: Optional[pulumi.ResourceOptions] = None,
279
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
280
- drs_automation_level: Optional[pulumi.Input[str]] = None,
281
- drs_enabled: Optional[pulumi.Input[bool]] = None,
282
- virtual_machine_id: Optional[pulumi.Input[str]] = None) -> 'DrsVmOverride':
443
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
444
+ drs_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
445
+ drs_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
446
+ virtual_machine_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'DrsVmOverride':
283
447
  """
284
448
  Get an existing DrsVmOverride resource's state with the given name, id, and optional extra
285
449
  properties used to qualify the lookup.
@@ -287,19 +451,19 @@ class DrsVmOverride(pulumi.CustomResource):
287
451
  :param str resource_name: The unique name of the resulting resource.
288
452
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
289
453
  :param pulumi.ResourceOptions opts: Options for the resource.
290
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
454
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
291
455
  ID of the cluster to put the override in. Forces a new
292
456
  resource if changed.
293
- :param pulumi.Input[str] drs_automation_level: Overrides the automation level for this virtual
457
+ :param pulumi.Input[_builtins.str] drs_automation_level: Overrides the automation level for this virtual
294
458
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
295
459
  `fullyAutomated`. Default: `manual`.
296
460
 
297
461
  > **NOTE:** Using this resource _always_ implies an override, even if one of
298
462
  `drs_enabled` or `drs_automation_level` is omitted. Take note of the defaults
299
463
  for both options.
300
- :param pulumi.Input[bool] drs_enabled: Overrides the default DRS setting for this virtual
464
+ :param pulumi.Input[_builtins.bool] drs_enabled: Overrides the default DRS setting for this virtual
301
465
  machine. Can be either `true` or `false`. Default: `false`.
302
- :param pulumi.Input[str] virtual_machine_id: The UUID of the virtual machine to create
466
+ :param pulumi.Input[_builtins.str] virtual_machine_id: The UUID of the virtual machine to create
303
467
  the override for. Forces a new resource if changed.
304
468
  """
305
469
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
@@ -312,9 +476,9 @@ class DrsVmOverride(pulumi.CustomResource):
312
476
  __props__.__dict__["virtual_machine_id"] = virtual_machine_id
313
477
  return DrsVmOverride(resource_name, opts=opts, __props__=__props__)
314
478
 
315
- @property
479
+ @_builtins.property
316
480
  @pulumi.getter(name="computeClusterId")
317
- def compute_cluster_id(self) -> pulumi.Output[str]:
481
+ def compute_cluster_id(self) -> pulumi.Output[_builtins.str]:
318
482
  """
319
483
  The managed object reference
320
484
  ID of the cluster to put the override in. Forces a new
@@ -322,9 +486,9 @@ class DrsVmOverride(pulumi.CustomResource):
322
486
  """
323
487
  return pulumi.get(self, "compute_cluster_id")
324
488
 
325
- @property
489
+ @_builtins.property
326
490
  @pulumi.getter(name="drsAutomationLevel")
327
- def drs_automation_level(self) -> pulumi.Output[Optional[str]]:
491
+ def drs_automation_level(self) -> pulumi.Output[Optional[_builtins.str]]:
328
492
  """
329
493
  Overrides the automation level for this virtual
330
494
  machine in the cluster. Can be one of `manual`, `partiallyAutomated`, or
@@ -336,18 +500,18 @@ class DrsVmOverride(pulumi.CustomResource):
336
500
  """
337
501
  return pulumi.get(self, "drs_automation_level")
338
502
 
339
- @property
503
+ @_builtins.property
340
504
  @pulumi.getter(name="drsEnabled")
341
- def drs_enabled(self) -> pulumi.Output[Optional[bool]]:
505
+ def drs_enabled(self) -> pulumi.Output[Optional[_builtins.bool]]:
342
506
  """
343
507
  Overrides the default DRS setting for this virtual
344
508
  machine. Can be either `true` or `false`. Default: `false`.
345
509
  """
346
510
  return pulumi.get(self, "drs_enabled")
347
511
 
348
- @property
512
+ @_builtins.property
349
513
  @pulumi.getter(name="virtualMachineId")
350
- def virtual_machine_id(self) -> pulumi.Output[str]:
514
+ def virtual_machine_id(self) -> pulumi.Output[_builtins.str]:
351
515
  """
352
516
  The UUID of the virtual machine to create
353
517
  the override for. Forces a new resource if changed.