pulumi-vsphere 4.13.0a1737527662__py3-none-any.whl → 4.13.0a1737580962__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 (30) hide show
  1. pulumi_vsphere/__init__.py +9 -0
  2. pulumi_vsphere/_inputs.py +3 -3
  3. pulumi_vsphere/compute_cluster.py +4 -4
  4. pulumi_vsphere/compute_cluster_vm_host_rule.py +124 -0
  5. pulumi_vsphere/custom_attribute.py +2 -2
  6. pulumi_vsphere/datastore_cluster.py +2 -2
  7. pulumi_vsphere/distributed_port_group.py +4 -53
  8. pulumi_vsphere/distributed_virtual_switch.py +11 -11
  9. pulumi_vsphere/distributed_virtual_switch_pvlan_mapping.py +293 -0
  10. pulumi_vsphere/dpm_host_override.py +2 -2
  11. pulumi_vsphere/drs_vm_override.py +96 -2
  12. pulumi_vsphere/get_resource_pool.py +2 -2
  13. pulumi_vsphere/get_virtual_machine.py +22 -3
  14. pulumi_vsphere/ha_vm_override.py +2 -2
  15. pulumi_vsphere/host_port_group.py +2 -2
  16. pulumi_vsphere/host_virtual_switch.py +98 -2
  17. pulumi_vsphere/outputs.py +2 -2
  18. pulumi_vsphere/pulumi-plugin.json +1 -1
  19. pulumi_vsphere/storage_drs_vm_override.py +2 -2
  20. pulumi_vsphere/tag.py +2 -2
  21. pulumi_vsphere/tag_category.py +2 -2
  22. pulumi_vsphere/vapp_container.py +2 -2
  23. pulumi_vsphere/vapp_entity.py +2 -2
  24. pulumi_vsphere/virtual_disk.py +7 -7
  25. pulumi_vsphere/virtual_machine.py +34 -0
  26. pulumi_vsphere/virtual_machine_snapshot.py +4 -4
  27. {pulumi_vsphere-4.13.0a1737527662.dist-info → pulumi_vsphere-4.13.0a1737580962.dist-info}/METADATA +1 -1
  28. {pulumi_vsphere-4.13.0a1737527662.dist-info → pulumi_vsphere-4.13.0a1737580962.dist-info}/RECORD +30 -29
  29. {pulumi_vsphere-4.13.0a1737527662.dist-info → pulumi_vsphere-4.13.0a1737580962.dist-info}/WHEEL +0 -0
  30. {pulumi_vsphere-4.13.0a1737527662.dist-info → pulumi_vsphere-4.13.0a1737580962.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,293 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import copy
6
+ import warnings
7
+ import sys
8
+ import pulumi
9
+ import pulumi.runtime
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
15
+ from . import _utilities
16
+
17
+ __all__ = ['DistributedVirtualSwitchPvlanMappingInitArgs', 'DistributedVirtualSwitchPvlanMapping']
18
+
19
+ @pulumi.input_type
20
+ class DistributedVirtualSwitchPvlanMappingInitArgs:
21
+ def __init__(__self__, *,
22
+ distributed_virtual_switch_id: pulumi.Input[str],
23
+ primary_vlan_id: pulumi.Input[int],
24
+ pvlan_type: pulumi.Input[str],
25
+ secondary_vlan_id: pulumi.Input[int]):
26
+ """
27
+ The set of arguments for constructing a DistributedVirtualSwitchPvlanMapping resource.
28
+ :param pulumi.Input[str] distributed_virtual_switch_id: The ID of the distributed virtual switch to attach this mapping to.
29
+ :param pulumi.Input[int] primary_vlan_id: The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
30
+ :param pulumi.Input[str] pvlan_type: The private VLAN type. Valid values are promiscuous, community and isolated.
31
+ :param pulumi.Input[int] secondary_vlan_id: The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
32
+ """
33
+ pulumi.set(__self__, "distributed_virtual_switch_id", distributed_virtual_switch_id)
34
+ pulumi.set(__self__, "primary_vlan_id", primary_vlan_id)
35
+ pulumi.set(__self__, "pvlan_type", pvlan_type)
36
+ pulumi.set(__self__, "secondary_vlan_id", secondary_vlan_id)
37
+
38
+ @property
39
+ @pulumi.getter(name="distributedVirtualSwitchId")
40
+ def distributed_virtual_switch_id(self) -> pulumi.Input[str]:
41
+ """
42
+ The ID of the distributed virtual switch to attach this mapping to.
43
+ """
44
+ return pulumi.get(self, "distributed_virtual_switch_id")
45
+
46
+ @distributed_virtual_switch_id.setter
47
+ def distributed_virtual_switch_id(self, value: pulumi.Input[str]):
48
+ pulumi.set(self, "distributed_virtual_switch_id", value)
49
+
50
+ @property
51
+ @pulumi.getter(name="primaryVlanId")
52
+ def primary_vlan_id(self) -> pulumi.Input[int]:
53
+ """
54
+ The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
55
+ """
56
+ return pulumi.get(self, "primary_vlan_id")
57
+
58
+ @primary_vlan_id.setter
59
+ def primary_vlan_id(self, value: pulumi.Input[int]):
60
+ pulumi.set(self, "primary_vlan_id", value)
61
+
62
+ @property
63
+ @pulumi.getter(name="pvlanType")
64
+ def pvlan_type(self) -> pulumi.Input[str]:
65
+ """
66
+ The private VLAN type. Valid values are promiscuous, community and isolated.
67
+ """
68
+ return pulumi.get(self, "pvlan_type")
69
+
70
+ @pvlan_type.setter
71
+ def pvlan_type(self, value: pulumi.Input[str]):
72
+ pulumi.set(self, "pvlan_type", value)
73
+
74
+ @property
75
+ @pulumi.getter(name="secondaryVlanId")
76
+ def secondary_vlan_id(self) -> pulumi.Input[int]:
77
+ """
78
+ The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
79
+ """
80
+ return pulumi.get(self, "secondary_vlan_id")
81
+
82
+ @secondary_vlan_id.setter
83
+ def secondary_vlan_id(self, value: pulumi.Input[int]):
84
+ pulumi.set(self, "secondary_vlan_id", value)
85
+
86
+
87
+ @pulumi.input_type
88
+ class _DistributedVirtualSwitchPvlanMappingState:
89
+ def __init__(__self__, *,
90
+ distributed_virtual_switch_id: Optional[pulumi.Input[str]] = None,
91
+ primary_vlan_id: Optional[pulumi.Input[int]] = None,
92
+ pvlan_type: Optional[pulumi.Input[str]] = None,
93
+ secondary_vlan_id: Optional[pulumi.Input[int]] = None):
94
+ """
95
+ Input properties used for looking up and filtering DistributedVirtualSwitchPvlanMapping resources.
96
+ :param pulumi.Input[str] distributed_virtual_switch_id: The ID of the distributed virtual switch to attach this mapping to.
97
+ :param pulumi.Input[int] primary_vlan_id: The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
98
+ :param pulumi.Input[str] pvlan_type: The private VLAN type. Valid values are promiscuous, community and isolated.
99
+ :param pulumi.Input[int] secondary_vlan_id: The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
100
+ """
101
+ if distributed_virtual_switch_id is not None:
102
+ pulumi.set(__self__, "distributed_virtual_switch_id", distributed_virtual_switch_id)
103
+ if primary_vlan_id is not None:
104
+ pulumi.set(__self__, "primary_vlan_id", primary_vlan_id)
105
+ if pvlan_type is not None:
106
+ pulumi.set(__self__, "pvlan_type", pvlan_type)
107
+ if secondary_vlan_id is not None:
108
+ pulumi.set(__self__, "secondary_vlan_id", secondary_vlan_id)
109
+
110
+ @property
111
+ @pulumi.getter(name="distributedVirtualSwitchId")
112
+ def distributed_virtual_switch_id(self) -> Optional[pulumi.Input[str]]:
113
+ """
114
+ The ID of the distributed virtual switch to attach this mapping to.
115
+ """
116
+ return pulumi.get(self, "distributed_virtual_switch_id")
117
+
118
+ @distributed_virtual_switch_id.setter
119
+ def distributed_virtual_switch_id(self, value: Optional[pulumi.Input[str]]):
120
+ pulumi.set(self, "distributed_virtual_switch_id", value)
121
+
122
+ @property
123
+ @pulumi.getter(name="primaryVlanId")
124
+ def primary_vlan_id(self) -> Optional[pulumi.Input[int]]:
125
+ """
126
+ The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
127
+ """
128
+ return pulumi.get(self, "primary_vlan_id")
129
+
130
+ @primary_vlan_id.setter
131
+ def primary_vlan_id(self, value: Optional[pulumi.Input[int]]):
132
+ pulumi.set(self, "primary_vlan_id", value)
133
+
134
+ @property
135
+ @pulumi.getter(name="pvlanType")
136
+ def pvlan_type(self) -> Optional[pulumi.Input[str]]:
137
+ """
138
+ The private VLAN type. Valid values are promiscuous, community and isolated.
139
+ """
140
+ return pulumi.get(self, "pvlan_type")
141
+
142
+ @pvlan_type.setter
143
+ def pvlan_type(self, value: Optional[pulumi.Input[str]]):
144
+ pulumi.set(self, "pvlan_type", value)
145
+
146
+ @property
147
+ @pulumi.getter(name="secondaryVlanId")
148
+ def secondary_vlan_id(self) -> Optional[pulumi.Input[int]]:
149
+ """
150
+ The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
151
+ """
152
+ return pulumi.get(self, "secondary_vlan_id")
153
+
154
+ @secondary_vlan_id.setter
155
+ def secondary_vlan_id(self, value: Optional[pulumi.Input[int]]):
156
+ pulumi.set(self, "secondary_vlan_id", value)
157
+
158
+
159
+ class DistributedVirtualSwitchPvlanMapping(pulumi.CustomResource):
160
+ @overload
161
+ def __init__(__self__,
162
+ resource_name: str,
163
+ opts: Optional[pulumi.ResourceOptions] = None,
164
+ distributed_virtual_switch_id: Optional[pulumi.Input[str]] = None,
165
+ primary_vlan_id: Optional[pulumi.Input[int]] = None,
166
+ pvlan_type: Optional[pulumi.Input[str]] = None,
167
+ secondary_vlan_id: Optional[pulumi.Input[int]] = None,
168
+ __props__=None):
169
+ """
170
+ Create a DistributedVirtualSwitchPvlanMapping resource with the given unique name, props, and options.
171
+ :param str resource_name: The name of the resource.
172
+ :param pulumi.ResourceOptions opts: Options for the resource.
173
+ :param pulumi.Input[str] distributed_virtual_switch_id: The ID of the distributed virtual switch to attach this mapping to.
174
+ :param pulumi.Input[int] primary_vlan_id: The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
175
+ :param pulumi.Input[str] pvlan_type: The private VLAN type. Valid values are promiscuous, community and isolated.
176
+ :param pulumi.Input[int] secondary_vlan_id: The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
177
+ """
178
+ ...
179
+ @overload
180
+ def __init__(__self__,
181
+ resource_name: str,
182
+ args: DistributedVirtualSwitchPvlanMappingInitArgs,
183
+ opts: Optional[pulumi.ResourceOptions] = None):
184
+ """
185
+ Create a DistributedVirtualSwitchPvlanMapping resource with the given unique name, props, and options.
186
+ :param str resource_name: The name of the resource.
187
+ :param DistributedVirtualSwitchPvlanMappingInitArgs args: The arguments to use to populate this resource's properties.
188
+ :param pulumi.ResourceOptions opts: Options for the resource.
189
+ """
190
+ ...
191
+ def __init__(__self__, resource_name: str, *args, **kwargs):
192
+ resource_args, opts = _utilities.get_resource_args_opts(DistributedVirtualSwitchPvlanMappingInitArgs, pulumi.ResourceOptions, *args, **kwargs)
193
+ if resource_args is not None:
194
+ __self__._internal_init(resource_name, opts, **resource_args.__dict__)
195
+ else:
196
+ __self__._internal_init(resource_name, *args, **kwargs)
197
+
198
+ def _internal_init(__self__,
199
+ resource_name: str,
200
+ opts: Optional[pulumi.ResourceOptions] = None,
201
+ distributed_virtual_switch_id: Optional[pulumi.Input[str]] = None,
202
+ primary_vlan_id: Optional[pulumi.Input[int]] = None,
203
+ pvlan_type: Optional[pulumi.Input[str]] = None,
204
+ secondary_vlan_id: Optional[pulumi.Input[int]] = None,
205
+ __props__=None):
206
+ opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
207
+ if not isinstance(opts, pulumi.ResourceOptions):
208
+ raise TypeError('Expected resource options to be a ResourceOptions instance')
209
+ if opts.id is None:
210
+ if __props__ is not None:
211
+ raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
212
+ __props__ = DistributedVirtualSwitchPvlanMappingInitArgs.__new__(DistributedVirtualSwitchPvlanMappingInitArgs)
213
+
214
+ if distributed_virtual_switch_id is None and not opts.urn:
215
+ raise TypeError("Missing required property 'distributed_virtual_switch_id'")
216
+ __props__.__dict__["distributed_virtual_switch_id"] = distributed_virtual_switch_id
217
+ if primary_vlan_id is None and not opts.urn:
218
+ raise TypeError("Missing required property 'primary_vlan_id'")
219
+ __props__.__dict__["primary_vlan_id"] = primary_vlan_id
220
+ if pvlan_type is None and not opts.urn:
221
+ raise TypeError("Missing required property 'pvlan_type'")
222
+ __props__.__dict__["pvlan_type"] = pvlan_type
223
+ if secondary_vlan_id is None and not opts.urn:
224
+ raise TypeError("Missing required property 'secondary_vlan_id'")
225
+ __props__.__dict__["secondary_vlan_id"] = secondary_vlan_id
226
+ super(DistributedVirtualSwitchPvlanMapping, __self__).__init__(
227
+ 'vsphere:index/distributedVirtualSwitchPvlanMapping:DistributedVirtualSwitchPvlanMapping',
228
+ resource_name,
229
+ __props__,
230
+ opts)
231
+
232
+ @staticmethod
233
+ def get(resource_name: str,
234
+ id: pulumi.Input[str],
235
+ opts: Optional[pulumi.ResourceOptions] = None,
236
+ distributed_virtual_switch_id: Optional[pulumi.Input[str]] = None,
237
+ primary_vlan_id: Optional[pulumi.Input[int]] = None,
238
+ pvlan_type: Optional[pulumi.Input[str]] = None,
239
+ secondary_vlan_id: Optional[pulumi.Input[int]] = None) -> 'DistributedVirtualSwitchPvlanMapping':
240
+ """
241
+ Get an existing DistributedVirtualSwitchPvlanMapping resource's state with the given name, id, and optional extra
242
+ properties used to qualify the lookup.
243
+
244
+ :param str resource_name: The unique name of the resulting resource.
245
+ :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
246
+ :param pulumi.ResourceOptions opts: Options for the resource.
247
+ :param pulumi.Input[str] distributed_virtual_switch_id: The ID of the distributed virtual switch to attach this mapping to.
248
+ :param pulumi.Input[int] primary_vlan_id: The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
249
+ :param pulumi.Input[str] pvlan_type: The private VLAN type. Valid values are promiscuous, community and isolated.
250
+ :param pulumi.Input[int] secondary_vlan_id: The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
251
+ """
252
+ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
253
+
254
+ __props__ = _DistributedVirtualSwitchPvlanMappingState.__new__(_DistributedVirtualSwitchPvlanMappingState)
255
+
256
+ __props__.__dict__["distributed_virtual_switch_id"] = distributed_virtual_switch_id
257
+ __props__.__dict__["primary_vlan_id"] = primary_vlan_id
258
+ __props__.__dict__["pvlan_type"] = pvlan_type
259
+ __props__.__dict__["secondary_vlan_id"] = secondary_vlan_id
260
+ return DistributedVirtualSwitchPvlanMapping(resource_name, opts=opts, __props__=__props__)
261
+
262
+ @property
263
+ @pulumi.getter(name="distributedVirtualSwitchId")
264
+ def distributed_virtual_switch_id(self) -> pulumi.Output[str]:
265
+ """
266
+ The ID of the distributed virtual switch to attach this mapping to.
267
+ """
268
+ return pulumi.get(self, "distributed_virtual_switch_id")
269
+
270
+ @property
271
+ @pulumi.getter(name="primaryVlanId")
272
+ def primary_vlan_id(self) -> pulumi.Output[int]:
273
+ """
274
+ The primary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
275
+ """
276
+ return pulumi.get(self, "primary_vlan_id")
277
+
278
+ @property
279
+ @pulumi.getter(name="pvlanType")
280
+ def pvlan_type(self) -> pulumi.Output[str]:
281
+ """
282
+ The private VLAN type. Valid values are promiscuous, community and isolated.
283
+ """
284
+ return pulumi.get(self, "pvlan_type")
285
+
286
+ @property
287
+ @pulumi.getter(name="secondaryVlanId")
288
+ def secondary_vlan_id(self) -> pulumi.Output[int]:
289
+ """
290
+ The secondary VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used in this property.
291
+ """
292
+ return pulumi.get(self, "secondary_vlan_id")
293
+
@@ -213,7 +213,7 @@ class DpmHostOverride(pulumi.CustomResource):
213
213
  For more information on DPM within vSphere clusters, see [this
214
214
  page][ref-vsphere-cluster-dpm].
215
215
 
216
- [ref-vsphere-cluster-dpm]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-5E5E349A-4644-4C9C-B434-1C0243EBDC80.html
216
+ [ref-vsphere-cluster-dpm]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/using-drs-clusters-to-manage-resources/managing-power-resources.html
217
217
 
218
218
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
219
219
  connections.
@@ -265,7 +265,7 @@ class DpmHostOverride(pulumi.CustomResource):
265
265
  For more information on DPM within vSphere clusters, see [this
266
266
  page][ref-vsphere-cluster-dpm].
267
267
 
268
- [ref-vsphere-cluster-dpm]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-5E5E349A-4644-4C9C-B434-1C0243EBDC80.html
268
+ [ref-vsphere-cluster-dpm]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/using-drs-clusters-to-manage-resources/managing-power-resources.html
269
269
 
270
270
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
271
271
  connections.
@@ -217,11 +217,58 @@ class DrsVmOverride(pulumi.CustomResource):
217
217
  For more information on vSphere clusters and DRS, see [this
218
218
  page][ref-vsphere-drs-clusters].
219
219
 
220
- [ref-vsphere-drs-clusters]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-8ACF3502-5314-469F-8CC9-4A9BD5925BC2.html
220
+ [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
221
221
 
222
222
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
223
223
  connections.
224
224
 
225
+ ## Example Usage
226
+
227
+ The example below creates a virtual machine in a cluster using the
228
+ `VirtualMachine` resource, creating the
229
+ virtual machine in the cluster looked up by the
230
+ `ComputeCluster` data source, but also
231
+ pinning the VM to a host defined by the
232
+ `Host` data source, which is assumed to
233
+ be a host within the cluster. To ensure that the VM stays on this host and does
234
+ not need to be migrated back at any point in time, an override is entered using
235
+ the `DrsVmOverride` resource that disables DRS for this virtual
236
+ machine, ensuring that it does not move.
237
+
238
+ ```python
239
+ import pulumi
240
+ import pulumi_vsphere as vsphere
241
+
242
+ datacenter = vsphere.get_datacenter(name="dc-01")
243
+ datastore = vsphere.get_datastore(name="datastore1",
244
+ datacenter_id=datacenter.id)
245
+ cluster = vsphere.get_compute_cluster(name="cluster-01",
246
+ datacenter_id=datacenter.id)
247
+ host = vsphere.get_host(name="esxi-01.example.com",
248
+ datacenter_id=datacenter.id)
249
+ network = vsphere.get_network(name="network1",
250
+ datacenter_id=datacenter.id)
251
+ vm = vsphere.VirtualMachine("vm",
252
+ name="test",
253
+ resource_pool_id=cluster.resource_pool_id,
254
+ host_system_id=host.id,
255
+ datastore_id=datastore.id,
256
+ num_cpus=2,
257
+ memory=2048,
258
+ guest_id="otherLinux64Guest",
259
+ network_interfaces=[{
260
+ "network_id": network.id,
261
+ }],
262
+ disks=[{
263
+ "label": "disk0",
264
+ "size": 20,
265
+ }])
266
+ drs_vm_override = vsphere.DrsVmOverride("drs_vm_override",
267
+ compute_cluster_id=cluster.id,
268
+ virtual_machine_id=vm.id,
269
+ drs_enabled=False)
270
+ ```
271
+
225
272
  ## Import
226
273
 
227
274
  An existing override can be imported into this resource by
@@ -272,11 +319,58 @@ class DrsVmOverride(pulumi.CustomResource):
272
319
  For more information on vSphere clusters and DRS, see [this
273
320
  page][ref-vsphere-drs-clusters].
274
321
 
275
- [ref-vsphere-drs-clusters]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-8ACF3502-5314-469F-8CC9-4A9BD5925BC2.html
322
+ [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
276
323
 
277
324
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
278
325
  connections.
279
326
 
327
+ ## Example Usage
328
+
329
+ The example below creates a virtual machine in a cluster using the
330
+ `VirtualMachine` resource, creating the
331
+ virtual machine in the cluster looked up by the
332
+ `ComputeCluster` data source, but also
333
+ pinning the VM to a host defined by the
334
+ `Host` data source, which is assumed to
335
+ be a host within the cluster. To ensure that the VM stays on this host and does
336
+ not need to be migrated back at any point in time, an override is entered using
337
+ the `DrsVmOverride` resource that disables DRS for this virtual
338
+ machine, ensuring that it does not move.
339
+
340
+ ```python
341
+ import pulumi
342
+ import pulumi_vsphere as vsphere
343
+
344
+ datacenter = vsphere.get_datacenter(name="dc-01")
345
+ datastore = vsphere.get_datastore(name="datastore1",
346
+ datacenter_id=datacenter.id)
347
+ cluster = vsphere.get_compute_cluster(name="cluster-01",
348
+ datacenter_id=datacenter.id)
349
+ host = vsphere.get_host(name="esxi-01.example.com",
350
+ datacenter_id=datacenter.id)
351
+ network = vsphere.get_network(name="network1",
352
+ datacenter_id=datacenter.id)
353
+ vm = vsphere.VirtualMachine("vm",
354
+ name="test",
355
+ resource_pool_id=cluster.resource_pool_id,
356
+ host_system_id=host.id,
357
+ datastore_id=datastore.id,
358
+ num_cpus=2,
359
+ memory=2048,
360
+ guest_id="otherLinux64Guest",
361
+ network_interfaces=[{
362
+ "network_id": network.id,
363
+ }],
364
+ disks=[{
365
+ "label": "disk0",
366
+ "size": 20,
367
+ }])
368
+ drs_vm_override = vsphere.DrsVmOverride("drs_vm_override",
369
+ compute_cluster_id=cluster.id,
370
+ virtual_machine_id=vm.id,
371
+ drs_enabled=False)
372
+ ```
373
+
280
374
  ## Import
281
375
 
282
376
  An existing override can be imported into this resource by
@@ -109,7 +109,7 @@ def get_resource_pool(datacenter_id: Optional[str] = None,
109
109
  [Managing Resource Pools][vmware-docs-resource-pools] in the vSphere
110
110
  documentation.
111
111
 
112
- [vmware-docs-resource-pools]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-60077B40-66FF-4625-934A-641703ED7601.html
112
+ [vmware-docs-resource-pools]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/managing-resource-pools.html
113
113
 
114
114
 
115
115
  :param str datacenter_id: The managed object reference ID
@@ -176,7 +176,7 @@ def get_resource_pool_output(datacenter_id: Optional[pulumi.Input[Optional[str]]
176
176
  [Managing Resource Pools][vmware-docs-resource-pools] in the vSphere
177
177
  documentation.
178
178
 
179
- [vmware-docs-resource-pools]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-60077B40-66FF-4625-934A-641703ED7601.html
179
+ [vmware-docs-resource-pools]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/managing-resource-pools.html
180
180
 
181
181
 
182
182
  :param str datacenter_id: The managed object reference ID
@@ -28,7 +28,7 @@ class GetVirtualMachineResult:
28
28
  """
29
29
  A collection of values returned by getVirtualMachine.
30
30
  """
31
- def __init__(__self__, alternate_guest_name=None, annotation=None, boot_delay=None, boot_retry_delay=None, boot_retry_enabled=None, change_version=None, cpu_hot_add_enabled=None, cpu_hot_remove_enabled=None, cpu_limit=None, cpu_performance_counters_enabled=None, cpu_reservation=None, cpu_share_count=None, cpu_share_level=None, datacenter_id=None, default_ip_address=None, disks=None, efi_secure_boot_enabled=None, enable_disk_uuid=None, enable_logging=None, ept_rvi_mode=None, extra_config=None, extra_config_reboot_required=None, firmware=None, folder=None, guest_id=None, guest_ip_addresses=None, hardware_version=None, hv_mode=None, id=None, ide_controller_scan_count=None, instance_uuid=None, latency_sensitivity=None, memory=None, memory_hot_add_enabled=None, memory_limit=None, memory_reservation=None, memory_reservation_locked_to_max=None, memory_share_count=None, memory_share_level=None, moid=None, name=None, nested_hv_enabled=None, network_interface_types=None, network_interfaces=None, num_cores_per_socket=None, num_cpus=None, replace_trigger=None, run_tools_scripts_after_power_on=None, run_tools_scripts_after_resume=None, run_tools_scripts_before_guest_reboot=None, run_tools_scripts_before_guest_shutdown=None, run_tools_scripts_before_guest_standby=None, sata_controller_scan_count=None, scsi_bus_sharing=None, scsi_controller_scan_count=None, scsi_type=None, storage_policy_id=None, swap_placement_policy=None, sync_time_with_host=None, sync_time_with_host_periodically=None, tools_upgrade_policy=None, uuid=None, vapp=None, vapp_transports=None, vbs_enabled=None, vtpm=None, vvtd_enabled=None):
31
+ def __init__(__self__, alternate_guest_name=None, annotation=None, boot_delay=None, boot_retry_delay=None, boot_retry_enabled=None, change_version=None, cpu_hot_add_enabled=None, cpu_hot_remove_enabled=None, cpu_limit=None, cpu_performance_counters_enabled=None, cpu_reservation=None, cpu_share_count=None, cpu_share_level=None, datacenter_id=None, default_ip_address=None, disks=None, efi_secure_boot_enabled=None, enable_disk_uuid=None, enable_logging=None, ept_rvi_mode=None, extra_config=None, extra_config_reboot_required=None, firmware=None, folder=None, guest_id=None, guest_ip_addresses=None, hardware_version=None, hv_mode=None, id=None, ide_controller_scan_count=None, instance_uuid=None, latency_sensitivity=None, memory=None, memory_hot_add_enabled=None, memory_limit=None, memory_reservation=None, memory_reservation_locked_to_max=None, memory_share_count=None, memory_share_level=None, moid=None, name=None, nested_hv_enabled=None, network_interface_types=None, network_interfaces=None, num_cores_per_socket=None, num_cpus=None, nvme_controller_scan_count=None, replace_trigger=None, run_tools_scripts_after_power_on=None, run_tools_scripts_after_resume=None, run_tools_scripts_before_guest_reboot=None, run_tools_scripts_before_guest_shutdown=None, run_tools_scripts_before_guest_standby=None, sata_controller_scan_count=None, scsi_bus_sharing=None, scsi_controller_scan_count=None, scsi_type=None, storage_policy_id=None, swap_placement_policy=None, sync_time_with_host=None, sync_time_with_host_periodically=None, tools_upgrade_policy=None, uuid=None, vapp=None, vapp_transports=None, vbs_enabled=None, vtpm=None, vvtd_enabled=None):
32
32
  if alternate_guest_name and not isinstance(alternate_guest_name, str):
33
33
  raise TypeError("Expected argument 'alternate_guest_name' to be a str")
34
34
  pulumi.set(__self__, "alternate_guest_name", alternate_guest_name)
@@ -167,6 +167,9 @@ class GetVirtualMachineResult:
167
167
  if num_cpus and not isinstance(num_cpus, int):
168
168
  raise TypeError("Expected argument 'num_cpus' to be a int")
169
169
  pulumi.set(__self__, "num_cpus", num_cpus)
170
+ if nvme_controller_scan_count and not isinstance(nvme_controller_scan_count, int):
171
+ raise TypeError("Expected argument 'nvme_controller_scan_count' to be a int")
172
+ pulumi.set(__self__, "nvme_controller_scan_count", nvme_controller_scan_count)
170
173
  if replace_trigger and not isinstance(replace_trigger, str):
171
174
  raise TypeError("Expected argument 'replace_trigger' to be a str")
172
175
  pulumi.set(__self__, "replace_trigger", replace_trigger)
@@ -531,6 +534,11 @@ class GetVirtualMachineResult:
531
534
  """
532
535
  return pulumi.get(self, "num_cpus")
533
536
 
537
+ @property
538
+ @pulumi.getter(name="nvmeControllerScanCount")
539
+ def nvme_controller_scan_count(self) -> Optional[int]:
540
+ return pulumi.get(self, "nvme_controller_scan_count")
541
+
534
542
  @property
535
543
  @pulumi.getter(name="replaceTrigger")
536
544
  def replace_trigger(self) -> Optional[str]:
@@ -704,6 +712,7 @@ class AwaitableGetVirtualMachineResult(GetVirtualMachineResult):
704
712
  network_interfaces=self.network_interfaces,
705
713
  num_cores_per_socket=self.num_cores_per_socket,
706
714
  num_cpus=self.num_cpus,
715
+ nvme_controller_scan_count=self.nvme_controller_scan_count,
707
716
  replace_trigger=self.replace_trigger,
708
717
  run_tools_scripts_after_power_on=self.run_tools_scripts_after_power_on,
709
718
  run_tools_scripts_after_resume=self.run_tools_scripts_after_resume,
@@ -765,6 +774,7 @@ def get_virtual_machine(alternate_guest_name: Optional[str] = None,
765
774
  nested_hv_enabled: Optional[bool] = None,
766
775
  num_cores_per_socket: Optional[int] = None,
767
776
  num_cpus: Optional[int] = None,
777
+ nvme_controller_scan_count: Optional[int] = None,
768
778
  replace_trigger: Optional[str] = None,
769
779
  run_tools_scripts_after_power_on: Optional[bool] = None,
770
780
  run_tools_scripts_after_resume: Optional[bool] = None,
@@ -841,7 +851,7 @@ def get_virtual_machine(alternate_guest_name: Optional[str] = None,
841
851
  machine.
842
852
  :param int num_cpus: The total number of virtual processor cores assigned to this
843
853
  virtual machine.
844
- :param int scsi_controller_scan_count: The number of SCSI controllers to
854
+ :param int nvme_controller_scan_count: The number of NVMe controllers to
845
855
  scan for disk attributes and controller types on. Default: `1`.
846
856
 
847
857
  > **NOTE:** For best results, ensure that all the disks on any templates you
@@ -849,6 +859,8 @@ def get_virtual_machine(alternate_guest_name: Optional[str] = None,
849
859
  value at the default. See the `VirtualMachine`
850
860
  resource documentation for the significance of this setting, specifically the
851
861
  additional requirements and notes for cloning section.
862
+ :param int scsi_controller_scan_count: The number of SCSI controllers to
863
+ scan for disk attributes and controller types on. Default: `1`.
852
864
  :param str uuid: Specify this field for a UUID lookup, `name` and `datacenter_id`
853
865
  are not required if this is specified.
854
866
  """
@@ -891,6 +903,7 @@ def get_virtual_machine(alternate_guest_name: Optional[str] = None,
891
903
  __args__['nestedHvEnabled'] = nested_hv_enabled
892
904
  __args__['numCoresPerSocket'] = num_cores_per_socket
893
905
  __args__['numCpus'] = num_cpus
906
+ __args__['nvmeControllerScanCount'] = nvme_controller_scan_count
894
907
  __args__['replaceTrigger'] = replace_trigger
895
908
  __args__['runToolsScriptsAfterPowerOn'] = run_tools_scripts_after_power_on
896
909
  __args__['runToolsScriptsAfterResume'] = run_tools_scripts_after_resume
@@ -958,6 +971,7 @@ def get_virtual_machine(alternate_guest_name: Optional[str] = None,
958
971
  network_interfaces=pulumi.get(__ret__, 'network_interfaces'),
959
972
  num_cores_per_socket=pulumi.get(__ret__, 'num_cores_per_socket'),
960
973
  num_cpus=pulumi.get(__ret__, 'num_cpus'),
974
+ nvme_controller_scan_count=pulumi.get(__ret__, 'nvme_controller_scan_count'),
961
975
  replace_trigger=pulumi.get(__ret__, 'replace_trigger'),
962
976
  run_tools_scripts_after_power_on=pulumi.get(__ret__, 'run_tools_scripts_after_power_on'),
963
977
  run_tools_scripts_after_resume=pulumi.get(__ret__, 'run_tools_scripts_after_resume'),
@@ -1017,6 +1031,7 @@ def get_virtual_machine_output(alternate_guest_name: Optional[pulumi.Input[Optio
1017
1031
  nested_hv_enabled: Optional[pulumi.Input[Optional[bool]]] = None,
1018
1032
  num_cores_per_socket: Optional[pulumi.Input[Optional[int]]] = None,
1019
1033
  num_cpus: Optional[pulumi.Input[Optional[int]]] = None,
1034
+ nvme_controller_scan_count: Optional[pulumi.Input[Optional[int]]] = None,
1020
1035
  replace_trigger: Optional[pulumi.Input[Optional[str]]] = None,
1021
1036
  run_tools_scripts_after_power_on: Optional[pulumi.Input[Optional[bool]]] = None,
1022
1037
  run_tools_scripts_after_resume: Optional[pulumi.Input[Optional[bool]]] = None,
@@ -1093,7 +1108,7 @@ def get_virtual_machine_output(alternate_guest_name: Optional[pulumi.Input[Optio
1093
1108
  machine.
1094
1109
  :param int num_cpus: The total number of virtual processor cores assigned to this
1095
1110
  virtual machine.
1096
- :param int scsi_controller_scan_count: The number of SCSI controllers to
1111
+ :param int nvme_controller_scan_count: The number of NVMe controllers to
1097
1112
  scan for disk attributes and controller types on. Default: `1`.
1098
1113
 
1099
1114
  > **NOTE:** For best results, ensure that all the disks on any templates you
@@ -1101,6 +1116,8 @@ def get_virtual_machine_output(alternate_guest_name: Optional[pulumi.Input[Optio
1101
1116
  value at the default. See the `VirtualMachine`
1102
1117
  resource documentation for the significance of this setting, specifically the
1103
1118
  additional requirements and notes for cloning section.
1119
+ :param int scsi_controller_scan_count: The number of SCSI controllers to
1120
+ scan for disk attributes and controller types on. Default: `1`.
1104
1121
  :param str uuid: Specify this field for a UUID lookup, `name` and `datacenter_id`
1105
1122
  are not required if this is specified.
1106
1123
  """
@@ -1143,6 +1160,7 @@ def get_virtual_machine_output(alternate_guest_name: Optional[pulumi.Input[Optio
1143
1160
  __args__['nestedHvEnabled'] = nested_hv_enabled
1144
1161
  __args__['numCoresPerSocket'] = num_cores_per_socket
1145
1162
  __args__['numCpus'] = num_cpus
1163
+ __args__['nvmeControllerScanCount'] = nvme_controller_scan_count
1146
1164
  __args__['replaceTrigger'] = replace_trigger
1147
1165
  __args__['runToolsScriptsAfterPowerOn'] = run_tools_scripts_after_power_on
1148
1166
  __args__['runToolsScriptsAfterResume'] = run_tools_scripts_after_resume
@@ -1209,6 +1227,7 @@ def get_virtual_machine_output(alternate_guest_name: Optional[pulumi.Input[Optio
1209
1227
  network_interfaces=pulumi.get(__response__, 'network_interfaces'),
1210
1228
  num_cores_per_socket=pulumi.get(__response__, 'num_cores_per_socket'),
1211
1229
  num_cpus=pulumi.get(__response__, 'num_cpus'),
1230
+ nvme_controller_scan_count=pulumi.get(__response__, 'nvme_controller_scan_count'),
1212
1231
  replace_trigger=pulumi.get(__response__, 'replace_trigger'),
1213
1232
  run_tools_scripts_after_power_on=pulumi.get(__response__, 'run_tools_scripts_after_power_on'),
1214
1233
  run_tools_scripts_after_resume=pulumi.get(__response__, 'run_tools_scripts_after_resume'),
@@ -588,7 +588,7 @@ class HaVmOverride(pulumi.CustomResource):
588
588
 
589
589
  For more information on vSphere HA, see [this page][ref-vsphere-ha-clusters].
590
590
 
591
- [ref-vsphere-ha-clusters]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-availability/GUID-5432CA24-14F1-44E3-87FB-61D937831CF6.html
591
+ [ref-vsphere-ha-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-availability.html
592
592
 
593
593
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
594
594
  connections.
@@ -704,7 +704,7 @@ class HaVmOverride(pulumi.CustomResource):
704
704
 
705
705
  For more information on vSphere HA, see [this page][ref-vsphere-ha-clusters].
706
706
 
707
- [ref-vsphere-ha-clusters]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-availability/GUID-5432CA24-14F1-44E3-87FB-61D937831CF6.html
707
+ [ref-vsphere-ha-clusters]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-availability.html
708
708
 
709
709
  > **NOTE:** This resource requires vCenter and is not available on direct ESXi
710
710
  connections.
@@ -695,7 +695,7 @@ class HostPortGroup(pulumi.CustomResource):
695
695
 
696
696
  For an overview on vSphere networking concepts, see [the product documentation][ref-vsphere-net-concepts].
697
697
 
698
- [ref-vsphere-net-concepts]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.networking.doc/GUID-2B11DBB8-CB3C-4AFF-8885-EFEA0FC562F4.html
698
+ [ref-vsphere-net-concepts]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-networking-8-0/introduction-to-vsphere-networking.html
699
699
 
700
700
  ## Example Usage
701
701
 
@@ -810,7 +810,7 @@ class HostPortGroup(pulumi.CustomResource):
810
810
 
811
811
  For an overview on vSphere networking concepts, see [the product documentation][ref-vsphere-net-concepts].
812
812
 
813
- [ref-vsphere-net-concepts]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.networking.doc/GUID-2B11DBB8-CB3C-4AFF-8885-EFEA0FC562F4.html
813
+ [ref-vsphere-net-concepts]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-networking-8-0/introduction-to-vsphere-networking.html
814
814
 
815
815
  ## Example Usage
816
816