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__ = ['ComputeClusterVmAffinityRuleArgs', 'ComputeClusterVmAffinityRule']
@@ -14,26 +19,26 @@ __all__ = ['ComputeClusterVmAffinityRuleArgs', 'ComputeClusterVmAffinityRule']
14
19
  @pulumi.input_type
15
20
  class ComputeClusterVmAffinityRuleArgs:
16
21
  def __init__(__self__, *,
17
- compute_cluster_id: pulumi.Input[str],
18
- virtual_machine_ids: pulumi.Input[Sequence[pulumi.Input[str]]],
19
- enabled: Optional[pulumi.Input[bool]] = None,
20
- mandatory: Optional[pulumi.Input[bool]] = None,
21
- name: Optional[pulumi.Input[str]] = None):
22
+ compute_cluster_id: pulumi.Input[_builtins.str],
23
+ virtual_machine_ids: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]],
24
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
25
+ mandatory: Optional[pulumi.Input[_builtins.bool]] = None,
26
+ name: Optional[pulumi.Input[_builtins.str]] = None):
22
27
  """
23
28
  The set of arguments for constructing a ComputeClusterVmAffinityRule resource.
24
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
29
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
25
30
  ID of the cluster to put the group in. Forces a new
26
31
  resource if changed.
27
- :param pulumi.Input[Sequence[pulumi.Input[str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
32
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
28
33
  on the same host together.
29
- :param pulumi.Input[bool] enabled: Enable this rule in the cluster. Default: `true`.
30
- :param pulumi.Input[bool] mandatory: When this value is `true`, prevents any virtual
34
+ :param pulumi.Input[_builtins.bool] enabled: Enable this rule in the cluster. Default: `true`.
35
+ :param pulumi.Input[_builtins.bool] mandatory: When this value is `true`, prevents any virtual
31
36
  machine operations that may violate this rule. Default: `false`.
32
37
 
33
38
  > **NOTE:** The namespace for rule names on this resource (defined by the
34
39
  `name` argument) is shared with all rules in the cluster - consider
35
40
  this when naming your rules.
36
- :param pulumi.Input[str] name: The name of the rule. This must be unique in the cluster.
41
+ :param pulumi.Input[_builtins.str] name: The name of the rule. This must be unique in the cluster.
37
42
  """
38
43
  pulumi.set(__self__, "compute_cluster_id", compute_cluster_id)
39
44
  pulumi.set(__self__, "virtual_machine_ids", virtual_machine_ids)
@@ -44,9 +49,9 @@ class ComputeClusterVmAffinityRuleArgs:
44
49
  if name is not None:
45
50
  pulumi.set(__self__, "name", name)
46
51
 
47
- @property
52
+ @_builtins.property
48
53
  @pulumi.getter(name="computeClusterId")
49
- def compute_cluster_id(self) -> pulumi.Input[str]:
54
+ def compute_cluster_id(self) -> pulumi.Input[_builtins.str]:
50
55
  """
51
56
  The managed object reference
52
57
  ID of the cluster to put the group in. Forces a new
@@ -55,12 +60,12 @@ class ComputeClusterVmAffinityRuleArgs:
55
60
  return pulumi.get(self, "compute_cluster_id")
56
61
 
57
62
  @compute_cluster_id.setter
58
- def compute_cluster_id(self, value: pulumi.Input[str]):
63
+ def compute_cluster_id(self, value: pulumi.Input[_builtins.str]):
59
64
  pulumi.set(self, "compute_cluster_id", value)
60
65
 
61
- @property
66
+ @_builtins.property
62
67
  @pulumi.getter(name="virtualMachineIds")
63
- def virtual_machine_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
68
+ def virtual_machine_ids(self) -> pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]:
64
69
  """
65
70
  The UUIDs of the virtual machines to run
66
71
  on the same host together.
@@ -68,24 +73,24 @@ class ComputeClusterVmAffinityRuleArgs:
68
73
  return pulumi.get(self, "virtual_machine_ids")
69
74
 
70
75
  @virtual_machine_ids.setter
71
- def virtual_machine_ids(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
76
+ def virtual_machine_ids(self, value: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]):
72
77
  pulumi.set(self, "virtual_machine_ids", value)
73
78
 
74
- @property
79
+ @_builtins.property
75
80
  @pulumi.getter
76
- def enabled(self) -> Optional[pulumi.Input[bool]]:
81
+ def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
77
82
  """
78
83
  Enable this rule in the cluster. Default: `true`.
79
84
  """
80
85
  return pulumi.get(self, "enabled")
81
86
 
82
87
  @enabled.setter
83
- def enabled(self, value: Optional[pulumi.Input[bool]]):
88
+ def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
84
89
  pulumi.set(self, "enabled", value)
85
90
 
86
- @property
91
+ @_builtins.property
87
92
  @pulumi.getter
88
- def mandatory(self) -> Optional[pulumi.Input[bool]]:
93
+ def mandatory(self) -> Optional[pulumi.Input[_builtins.bool]]:
89
94
  """
90
95
  When this value is `true`, prevents any virtual
91
96
  machine operations that may violate this rule. Default: `false`.
@@ -97,44 +102,44 @@ class ComputeClusterVmAffinityRuleArgs:
97
102
  return pulumi.get(self, "mandatory")
98
103
 
99
104
  @mandatory.setter
100
- def mandatory(self, value: Optional[pulumi.Input[bool]]):
105
+ def mandatory(self, value: Optional[pulumi.Input[_builtins.bool]]):
101
106
  pulumi.set(self, "mandatory", value)
102
107
 
103
- @property
108
+ @_builtins.property
104
109
  @pulumi.getter
105
- def name(self) -> Optional[pulumi.Input[str]]:
110
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
106
111
  """
107
112
  The name of the rule. This must be unique in the cluster.
108
113
  """
109
114
  return pulumi.get(self, "name")
110
115
 
111
116
  @name.setter
112
- def name(self, value: Optional[pulumi.Input[str]]):
117
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
113
118
  pulumi.set(self, "name", value)
114
119
 
115
120
 
116
121
  @pulumi.input_type
117
122
  class _ComputeClusterVmAffinityRuleState:
118
123
  def __init__(__self__, *,
119
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
120
- enabled: Optional[pulumi.Input[bool]] = None,
121
- mandatory: Optional[pulumi.Input[bool]] = None,
122
- name: Optional[pulumi.Input[str]] = None,
123
- virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
124
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
125
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
126
+ mandatory: Optional[pulumi.Input[_builtins.bool]] = None,
127
+ name: Optional[pulumi.Input[_builtins.str]] = None,
128
+ virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None):
124
129
  """
125
130
  Input properties used for looking up and filtering ComputeClusterVmAffinityRule resources.
126
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
131
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
127
132
  ID of the cluster to put the group in. Forces a new
128
133
  resource if changed.
129
- :param pulumi.Input[bool] enabled: Enable this rule in the cluster. Default: `true`.
130
- :param pulumi.Input[bool] mandatory: When this value is `true`, prevents any virtual
134
+ :param pulumi.Input[_builtins.bool] enabled: Enable this rule in the cluster. Default: `true`.
135
+ :param pulumi.Input[_builtins.bool] mandatory: When this value is `true`, prevents any virtual
131
136
  machine operations that may violate this rule. Default: `false`.
132
137
 
133
138
  > **NOTE:** The namespace for rule names on this resource (defined by the
134
139
  `name` argument) is shared with all rules in the cluster - consider
135
140
  this when naming your rules.
136
- :param pulumi.Input[str] name: The name of the rule. This must be unique in the cluster.
137
- :param pulumi.Input[Sequence[pulumi.Input[str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
141
+ :param pulumi.Input[_builtins.str] name: The name of the rule. This must be unique in the cluster.
142
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
138
143
  on the same host together.
139
144
  """
140
145
  if compute_cluster_id is not None:
@@ -148,9 +153,9 @@ class _ComputeClusterVmAffinityRuleState:
148
153
  if virtual_machine_ids is not None:
149
154
  pulumi.set(__self__, "virtual_machine_ids", virtual_machine_ids)
150
155
 
151
- @property
156
+ @_builtins.property
152
157
  @pulumi.getter(name="computeClusterId")
153
- def compute_cluster_id(self) -> Optional[pulumi.Input[str]]:
158
+ def compute_cluster_id(self) -> Optional[pulumi.Input[_builtins.str]]:
154
159
  """
155
160
  The managed object reference
156
161
  ID of the cluster to put the group in. Forces a new
@@ -159,24 +164,24 @@ class _ComputeClusterVmAffinityRuleState:
159
164
  return pulumi.get(self, "compute_cluster_id")
160
165
 
161
166
  @compute_cluster_id.setter
162
- def compute_cluster_id(self, value: Optional[pulumi.Input[str]]):
167
+ def compute_cluster_id(self, value: Optional[pulumi.Input[_builtins.str]]):
163
168
  pulumi.set(self, "compute_cluster_id", value)
164
169
 
165
- @property
170
+ @_builtins.property
166
171
  @pulumi.getter
167
- def enabled(self) -> Optional[pulumi.Input[bool]]:
172
+ def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
168
173
  """
169
174
  Enable this rule in the cluster. Default: `true`.
170
175
  """
171
176
  return pulumi.get(self, "enabled")
172
177
 
173
178
  @enabled.setter
174
- def enabled(self, value: Optional[pulumi.Input[bool]]):
179
+ def enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
175
180
  pulumi.set(self, "enabled", value)
176
181
 
177
- @property
182
+ @_builtins.property
178
183
  @pulumi.getter
179
- def mandatory(self) -> Optional[pulumi.Input[bool]]:
184
+ def mandatory(self) -> Optional[pulumi.Input[_builtins.bool]]:
180
185
  """
181
186
  When this value is `true`, prevents any virtual
182
187
  machine operations that may violate this rule. Default: `false`.
@@ -188,24 +193,24 @@ class _ComputeClusterVmAffinityRuleState:
188
193
  return pulumi.get(self, "mandatory")
189
194
 
190
195
  @mandatory.setter
191
- def mandatory(self, value: Optional[pulumi.Input[bool]]):
196
+ def mandatory(self, value: Optional[pulumi.Input[_builtins.bool]]):
192
197
  pulumi.set(self, "mandatory", value)
193
198
 
194
- @property
199
+ @_builtins.property
195
200
  @pulumi.getter
196
- def name(self) -> Optional[pulumi.Input[str]]:
201
+ def name(self) -> Optional[pulumi.Input[_builtins.str]]:
197
202
  """
198
203
  The name of the rule. This must be unique in the cluster.
199
204
  """
200
205
  return pulumi.get(self, "name")
201
206
 
202
207
  @name.setter
203
- def name(self, value: Optional[pulumi.Input[str]]):
208
+ def name(self, value: Optional[pulumi.Input[_builtins.str]]):
204
209
  pulumi.set(self, "name", value)
205
210
 
206
- @property
211
+ @_builtins.property
207
212
  @pulumi.getter(name="virtualMachineIds")
208
- def virtual_machine_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
213
+ def virtual_machine_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
209
214
  """
210
215
  The UUIDs of the virtual machines to run
211
216
  on the same host together.
@@ -213,20 +218,21 @@ class _ComputeClusterVmAffinityRuleState:
213
218
  return pulumi.get(self, "virtual_machine_ids")
214
219
 
215
220
  @virtual_machine_ids.setter
216
- def virtual_machine_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
221
+ def virtual_machine_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
217
222
  pulumi.set(self, "virtual_machine_ids", value)
218
223
 
219
224
 
225
+ @pulumi.type_token("vsphere:index/computeClusterVmAffinityRule:ComputeClusterVmAffinityRule")
220
226
  class ComputeClusterVmAffinityRule(pulumi.CustomResource):
221
227
  @overload
222
228
  def __init__(__self__,
223
229
  resource_name: str,
224
230
  opts: Optional[pulumi.ResourceOptions] = None,
225
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
226
- enabled: Optional[pulumi.Input[bool]] = None,
227
- mandatory: Optional[pulumi.Input[bool]] = None,
228
- name: Optional[pulumi.Input[str]] = None,
229
- virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
231
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
232
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
233
+ mandatory: Optional[pulumi.Input[_builtins.bool]] = None,
234
+ name: Optional[pulumi.Input[_builtins.str]] = None,
235
+ virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
230
236
  __props__=None):
231
237
  """
232
238
  The `ComputeClusterVmAffinityRule` resource can be used to
@@ -249,8 +255,6 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
249
255
  > **NOTE:** This resource requires vCenter Server and is not available on
250
256
  direct ESXi host connections.
251
257
 
252
- > **NOTE:** vSphere DRS requires a vSphere Enterprise Plus license.
253
-
254
258
  ## Example Usage
255
259
 
256
260
  The following example creates two virtual machines in a cluster using the
@@ -274,19 +278,21 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
274
278
  vm = []
275
279
  for range in [{"value": i} for i in range(0, 2)]:
276
280
  vm.append(vsphere.VirtualMachine(f"vm-{range['value']}",
281
+ name=f"foo-{range['value']}",
277
282
  resource_pool_id=cluster.resource_pool_id,
278
283
  datastore_id=datastore.id,
279
284
  num_cpus=1,
280
285
  memory=1024,
281
286
  guest_id="otherLinux64Guest",
282
- network_interfaces=[vsphere.VirtualMachineNetworkInterfaceArgs(
283
- network_id=network.id,
284
- )],
285
- disks=[vsphere.VirtualMachineDiskArgs(
286
- label="disk0",
287
- size=20,
288
- )]))
289
- vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vmAffinityRule",
287
+ network_interfaces=[{
288
+ "network_id": network.id,
289
+ }],
290
+ disks=[{
291
+ "label": "disk0",
292
+ "size": 20,
293
+ }]))
294
+ vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
295
+ name="vm-affinity-rule",
290
296
  compute_cluster_id=cluster.id,
291
297
  virtual_machine_ids=[v.id for k, v in vm])
292
298
  ```
@@ -306,28 +312,47 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
306
312
  datacenter = vsphere.get_datacenter(name="dc-01")
307
313
  cluster = vsphere.get_compute_cluster(name="cluster-01",
308
314
  datacenter_id=datacenter.id)
309
- vms_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
315
+ vms_get_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
310
316
  datacenter_id=datacenter.id) for __index in range(len(vms))]
311
- vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vmAffinityRule",
317
+ vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
318
+ name="vm-affinity-rule",
312
319
  enabled=True,
313
320
  compute_cluster_id=cluster.id,
314
- virtual_machine_ids=[__item.id for __item in vms_virtual_machine])
321
+ virtual_machine_ids=[__item.id for __item in vms_get_virtual_machine])
322
+ ```
323
+
324
+ ## Import
325
+
326
+ An existing rule can be imported into this resource by supplying
327
+
328
+ both the path to the cluster, and the name the rule. If the name or cluster is
329
+
330
+ not found, or if the rule is of a different type, an error will be returned. An
331
+
332
+ example is below:
333
+
334
+ ```sh
335
+ $ pulumi import vsphere:index/computeClusterVmAffinityRule:ComputeClusterVmAffinityRule vm_affinity_rule \\
315
336
  ```
316
337
 
338
+ '{"compute_cluster_path": "/dc-01/host/cluster-01", \\
339
+
340
+ "name": "vm-affinity-rule"}'
341
+
317
342
  :param str resource_name: The name of the resource.
318
343
  :param pulumi.ResourceOptions opts: Options for the resource.
319
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
344
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
320
345
  ID of the cluster to put the group in. Forces a new
321
346
  resource if changed.
322
- :param pulumi.Input[bool] enabled: Enable this rule in the cluster. Default: `true`.
323
- :param pulumi.Input[bool] mandatory: When this value is `true`, prevents any virtual
347
+ :param pulumi.Input[_builtins.bool] enabled: Enable this rule in the cluster. Default: `true`.
348
+ :param pulumi.Input[_builtins.bool] mandatory: When this value is `true`, prevents any virtual
324
349
  machine operations that may violate this rule. Default: `false`.
325
350
 
326
351
  > **NOTE:** The namespace for rule names on this resource (defined by the
327
352
  `name` argument) is shared with all rules in the cluster - consider
328
353
  this when naming your rules.
329
- :param pulumi.Input[str] name: The name of the rule. This must be unique in the cluster.
330
- :param pulumi.Input[Sequence[pulumi.Input[str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
354
+ :param pulumi.Input[_builtins.str] name: The name of the rule. This must be unique in the cluster.
355
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
331
356
  on the same host together.
332
357
  """
333
358
  ...
@@ -357,8 +382,6 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
357
382
  > **NOTE:** This resource requires vCenter Server and is not available on
358
383
  direct ESXi host connections.
359
384
 
360
- > **NOTE:** vSphere DRS requires a vSphere Enterprise Plus license.
361
-
362
385
  ## Example Usage
363
386
 
364
387
  The following example creates two virtual machines in a cluster using the
@@ -382,19 +405,21 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
382
405
  vm = []
383
406
  for range in [{"value": i} for i in range(0, 2)]:
384
407
  vm.append(vsphere.VirtualMachine(f"vm-{range['value']}",
408
+ name=f"foo-{range['value']}",
385
409
  resource_pool_id=cluster.resource_pool_id,
386
410
  datastore_id=datastore.id,
387
411
  num_cpus=1,
388
412
  memory=1024,
389
413
  guest_id="otherLinux64Guest",
390
- network_interfaces=[vsphere.VirtualMachineNetworkInterfaceArgs(
391
- network_id=network.id,
392
- )],
393
- disks=[vsphere.VirtualMachineDiskArgs(
394
- label="disk0",
395
- size=20,
396
- )]))
397
- vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vmAffinityRule",
414
+ network_interfaces=[{
415
+ "network_id": network.id,
416
+ }],
417
+ disks=[{
418
+ "label": "disk0",
419
+ "size": 20,
420
+ }]))
421
+ vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
422
+ name="vm-affinity-rule",
398
423
  compute_cluster_id=cluster.id,
399
424
  virtual_machine_ids=[v.id for k, v in vm])
400
425
  ```
@@ -414,14 +439,33 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
414
439
  datacenter = vsphere.get_datacenter(name="dc-01")
415
440
  cluster = vsphere.get_compute_cluster(name="cluster-01",
416
441
  datacenter_id=datacenter.id)
417
- vms_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
442
+ vms_get_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
418
443
  datacenter_id=datacenter.id) for __index in range(len(vms))]
419
- vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vmAffinityRule",
444
+ vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
445
+ name="vm-affinity-rule",
420
446
  enabled=True,
421
447
  compute_cluster_id=cluster.id,
422
- virtual_machine_ids=[__item.id for __item in vms_virtual_machine])
448
+ virtual_machine_ids=[__item.id for __item in vms_get_virtual_machine])
449
+ ```
450
+
451
+ ## Import
452
+
453
+ An existing rule can be imported into this resource by supplying
454
+
455
+ both the path to the cluster, and the name the rule. If the name or cluster is
456
+
457
+ not found, or if the rule is of a different type, an error will be returned. An
458
+
459
+ example is below:
460
+
461
+ ```sh
462
+ $ pulumi import vsphere:index/computeClusterVmAffinityRule:ComputeClusterVmAffinityRule vm_affinity_rule \\
423
463
  ```
424
464
 
465
+ '{"compute_cluster_path": "/dc-01/host/cluster-01", \\
466
+
467
+ "name": "vm-affinity-rule"}'
468
+
425
469
  :param str resource_name: The name of the resource.
426
470
  :param ComputeClusterVmAffinityRuleArgs args: The arguments to use to populate this resource's properties.
427
471
  :param pulumi.ResourceOptions opts: Options for the resource.
@@ -437,11 +481,11 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
437
481
  def _internal_init(__self__,
438
482
  resource_name: str,
439
483
  opts: Optional[pulumi.ResourceOptions] = None,
440
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
441
- enabled: Optional[pulumi.Input[bool]] = None,
442
- mandatory: Optional[pulumi.Input[bool]] = None,
443
- name: Optional[pulumi.Input[str]] = None,
444
- virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
484
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
485
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
486
+ mandatory: Optional[pulumi.Input[_builtins.bool]] = None,
487
+ name: Optional[pulumi.Input[_builtins.str]] = None,
488
+ virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
445
489
  __props__=None):
446
490
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
447
491
  if not isinstance(opts, pulumi.ResourceOptions):
@@ -470,11 +514,11 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
470
514
  def get(resource_name: str,
471
515
  id: pulumi.Input[str],
472
516
  opts: Optional[pulumi.ResourceOptions] = None,
473
- compute_cluster_id: Optional[pulumi.Input[str]] = None,
474
- enabled: Optional[pulumi.Input[bool]] = None,
475
- mandatory: Optional[pulumi.Input[bool]] = None,
476
- name: Optional[pulumi.Input[str]] = None,
477
- virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'ComputeClusterVmAffinityRule':
517
+ compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
518
+ enabled: Optional[pulumi.Input[_builtins.bool]] = None,
519
+ mandatory: Optional[pulumi.Input[_builtins.bool]] = None,
520
+ name: Optional[pulumi.Input[_builtins.str]] = None,
521
+ virtual_machine_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None) -> 'ComputeClusterVmAffinityRule':
478
522
  """
479
523
  Get an existing ComputeClusterVmAffinityRule resource's state with the given name, id, and optional extra
480
524
  properties used to qualify the lookup.
@@ -482,18 +526,18 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
482
526
  :param str resource_name: The unique name of the resulting resource.
483
527
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
484
528
  :param pulumi.ResourceOptions opts: Options for the resource.
485
- :param pulumi.Input[str] compute_cluster_id: The managed object reference
529
+ :param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
486
530
  ID of the cluster to put the group in. Forces a new
487
531
  resource if changed.
488
- :param pulumi.Input[bool] enabled: Enable this rule in the cluster. Default: `true`.
489
- :param pulumi.Input[bool] mandatory: When this value is `true`, prevents any virtual
532
+ :param pulumi.Input[_builtins.bool] enabled: Enable this rule in the cluster. Default: `true`.
533
+ :param pulumi.Input[_builtins.bool] mandatory: When this value is `true`, prevents any virtual
490
534
  machine operations that may violate this rule. Default: `false`.
491
535
 
492
536
  > **NOTE:** The namespace for rule names on this resource (defined by the
493
537
  `name` argument) is shared with all rules in the cluster - consider
494
538
  this when naming your rules.
495
- :param pulumi.Input[str] name: The name of the rule. This must be unique in the cluster.
496
- :param pulumi.Input[Sequence[pulumi.Input[str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
539
+ :param pulumi.Input[_builtins.str] name: The name of the rule. This must be unique in the cluster.
540
+ :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] virtual_machine_ids: The UUIDs of the virtual machines to run
497
541
  on the same host together.
498
542
  """
499
543
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
@@ -507,9 +551,9 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
507
551
  __props__.__dict__["virtual_machine_ids"] = virtual_machine_ids
508
552
  return ComputeClusterVmAffinityRule(resource_name, opts=opts, __props__=__props__)
509
553
 
510
- @property
554
+ @_builtins.property
511
555
  @pulumi.getter(name="computeClusterId")
512
- def compute_cluster_id(self) -> pulumi.Output[str]:
556
+ def compute_cluster_id(self) -> pulumi.Output[_builtins.str]:
513
557
  """
514
558
  The managed object reference
515
559
  ID of the cluster to put the group in. Forces a new
@@ -517,17 +561,17 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
517
561
  """
518
562
  return pulumi.get(self, "compute_cluster_id")
519
563
 
520
- @property
564
+ @_builtins.property
521
565
  @pulumi.getter
522
- def enabled(self) -> pulumi.Output[Optional[bool]]:
566
+ def enabled(self) -> pulumi.Output[Optional[_builtins.bool]]:
523
567
  """
524
568
  Enable this rule in the cluster. Default: `true`.
525
569
  """
526
570
  return pulumi.get(self, "enabled")
527
571
 
528
- @property
572
+ @_builtins.property
529
573
  @pulumi.getter
530
- def mandatory(self) -> pulumi.Output[Optional[bool]]:
574
+ def mandatory(self) -> pulumi.Output[Optional[_builtins.bool]]:
531
575
  """
532
576
  When this value is `true`, prevents any virtual
533
577
  machine operations that may violate this rule. Default: `false`.
@@ -538,17 +582,17 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
538
582
  """
539
583
  return pulumi.get(self, "mandatory")
540
584
 
541
- @property
585
+ @_builtins.property
542
586
  @pulumi.getter
543
- def name(self) -> pulumi.Output[str]:
587
+ def name(self) -> pulumi.Output[_builtins.str]:
544
588
  """
545
589
  The name of the rule. This must be unique in the cluster.
546
590
  """
547
591
  return pulumi.get(self, "name")
548
592
 
549
- @property
593
+ @_builtins.property
550
594
  @pulumi.getter(name="virtualMachineIds")
551
- def virtual_machine_ids(self) -> pulumi.Output[Sequence[str]]:
595
+ def virtual_machine_ids(self) -> pulumi.Output[Sequence[_builtins.str]]:
552
596
  """
553
597
  The UUIDs of the virtual machines to run
554
598
  on the same host together.