pulumi-vsphere 4.14.0a1746734806__py3-none-any.whl → 4.14.0a1747752163__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.
- pulumi_vsphere/compute_cluster.py +10 -10
- pulumi_vsphere/compute_cluster_host_group.py +70 -0
- pulumi_vsphere/compute_cluster_vm_anti_affinity_rule.py +4 -0
- pulumi_vsphere/compute_cluster_vm_dependency_rule.py +4 -0
- pulumi_vsphere/compute_cluster_vm_group.py +4 -0
- pulumi_vsphere/compute_cluster_vm_host_rule.py +4 -0
- pulumi_vsphere/content_library.py +4 -0
- pulumi_vsphere/content_library_item.py +4 -0
- pulumi_vsphere/custom_attribute.py +4 -0
- pulumi_vsphere/datastore_cluster.py +88 -0
- pulumi_vsphere/datastore_cluster_vm_anti_affinity_rule.py +4 -0
- pulumi_vsphere/distributed_port_group.py +4 -0
- pulumi_vsphere/distributed_virtual_switch.py +4 -0
- pulumi_vsphere/dpm_host_override.py +88 -0
- pulumi_vsphere/drs_vm_override.py +4 -0
- pulumi_vsphere/file.py +34 -49
- pulumi_vsphere/folder.py +16 -12
- pulumi_vsphere/get_compute_cluster_host_group.py +0 -4
- pulumi_vsphere/get_datastore_cluster.py +1 -1
- pulumi_vsphere/get_datastore_stats.py +0 -4
- pulumi_vsphere/get_dynamic.py +0 -4
- pulumi_vsphere/get_folder.py +130 -8
- pulumi_vsphere/get_guest_os_customization.py +21 -2
- pulumi_vsphere/get_license.py +8 -6
- pulumi_vsphere/get_network.py +35 -1
- pulumi_vsphere/get_ovf_vm_template.py +4 -4
- pulumi_vsphere/ha_vm_override.py +4 -0
- pulumi_vsphere/host.py +60 -6
- pulumi_vsphere/host_virtual_switch.py +4 -0
- pulumi_vsphere/license.py +66 -26
- pulumi_vsphere/nas_datastore.py +62 -0
- pulumi_vsphere/offline_software_depot.py +4 -0
- pulumi_vsphere/outputs.py +33 -0
- pulumi_vsphere/pulumi-plugin.json +1 -1
- pulumi_vsphere/resource_pool.py +489 -163
- pulumi_vsphere/storage_drs_vm_override.py +4 -0
- pulumi_vsphere/supervisor.py +2 -2
- pulumi_vsphere/tag.py +4 -0
- pulumi_vsphere/tag_category.py +4 -0
- pulumi_vsphere/vapp_container.py +4 -0
- pulumi_vsphere/vapp_entity.py +4 -0
- pulumi_vsphere/virtual_disk.py +4 -0
- pulumi_vsphere/virtual_machine.py +4 -4
- pulumi_vsphere/virtual_machine_class.py +4 -4
- pulumi_vsphere/vmfs_datastore.py +4 -0
- {pulumi_vsphere-4.14.0a1746734806.dist-info → pulumi_vsphere-4.14.0a1747752163.dist-info}/METADATA +1 -1
- pulumi_vsphere-4.14.0a1747752163.dist-info/RECORD +87 -0
- {pulumi_vsphere-4.14.0a1746734806.dist-info → pulumi_vsphere-4.14.0a1747752163.dist-info}/WHEEL +1 -1
- pulumi_vsphere-4.14.0a1746734806.dist-info/RECORD +0 -87
- {pulumi_vsphere-4.14.0a1746734806.dist-info → pulumi_vsphere-4.14.0a1747752163.dist-info}/top_level.txt +0 -0
|
@@ -2561,6 +2561,8 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2561
2561
|
|
|
2562
2562
|
path to the cluster, via the following command:
|
|
2563
2563
|
|
|
2564
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
2565
|
+
|
|
2564
2566
|
hcl
|
|
2565
2567
|
|
|
2566
2568
|
variable "datacenter" {
|
|
@@ -2577,9 +2579,9 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2577
2579
|
|
|
2578
2580
|
resource "vsphere_compute_cluster" "compute_cluster" {
|
|
2579
2581
|
|
|
2580
|
-
name
|
|
2582
|
+
name = "cluster-01"
|
|
2581
2583
|
|
|
2582
|
-
datacenter_id
|
|
2584
|
+
datacenter_id = data.vsphere_datacenter.datacenter.id
|
|
2583
2585
|
|
|
2584
2586
|
}
|
|
2585
2587
|
|
|
@@ -2607,9 +2609,7 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2607
2609
|
|
|
2608
2610
|
ha_datastore_pdl_response = "restartAggressive"
|
|
2609
2611
|
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
console
|
|
2612
|
+
}
|
|
2613
2613
|
|
|
2614
2614
|
```sh
|
|
2615
2615
|
$ pulumi import vsphere:index/computeCluster:ComputeCluster compute_cluster /dc-01/host/cluster-01
|
|
@@ -2775,6 +2775,8 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2775
2775
|
|
|
2776
2776
|
path to the cluster, via the following command:
|
|
2777
2777
|
|
|
2778
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
2779
|
+
|
|
2778
2780
|
hcl
|
|
2779
2781
|
|
|
2780
2782
|
variable "datacenter" {
|
|
@@ -2791,9 +2793,9 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2791
2793
|
|
|
2792
2794
|
resource "vsphere_compute_cluster" "compute_cluster" {
|
|
2793
2795
|
|
|
2794
|
-
name
|
|
2796
|
+
name = "cluster-01"
|
|
2795
2797
|
|
|
2796
|
-
datacenter_id
|
|
2798
|
+
datacenter_id = data.vsphere_datacenter.datacenter.id
|
|
2797
2799
|
|
|
2798
2800
|
}
|
|
2799
2801
|
|
|
@@ -2821,9 +2823,7 @@ class ComputeCluster(pulumi.CustomResource):
|
|
|
2821
2823
|
|
|
2822
2824
|
ha_datastore_pdl_response = "restartAggressive"
|
|
2823
2825
|
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
console
|
|
2826
|
+
}
|
|
2827
2827
|
|
|
2828
2828
|
```sh
|
|
2829
2829
|
$ pulumi import vsphere:index/computeCluster:ComputeCluster compute_cluster /dc-01/host/cluster-01
|
|
@@ -188,6 +188,39 @@ class ComputeClusterHostGroup(pulumi.CustomResource):
|
|
|
188
188
|
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
189
189
|
connections.
|
|
190
190
|
|
|
191
|
+
## Example Usage
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
import pulumi
|
|
195
|
+
import pulumi_vsphere as vsphere
|
|
196
|
+
|
|
197
|
+
config = pulumi.Config()
|
|
198
|
+
datacenter = config.get("datacenter")
|
|
199
|
+
if datacenter is None:
|
|
200
|
+
datacenter = "dc-01"
|
|
201
|
+
hosts = config.get_object("hosts")
|
|
202
|
+
if hosts is None:
|
|
203
|
+
hosts = [
|
|
204
|
+
"esxi-01.example.com",
|
|
205
|
+
"esxi-02.example.com",
|
|
206
|
+
"esxi-03.example.com",
|
|
207
|
+
]
|
|
208
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
209
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
210
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
211
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
212
|
+
name="compute-cluster-test",
|
|
213
|
+
datacenter_id=dc["id"],
|
|
214
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
215
|
+
drs_enabled=True,
|
|
216
|
+
drs_automation_level="fullyAutomated",
|
|
217
|
+
ha_enabled=True)
|
|
218
|
+
cluster_host_group = vsphere.ComputeClusterHostGroup("cluster_host_group",
|
|
219
|
+
name="test-cluster-host-group",
|
|
220
|
+
compute_cluster_id=compute_cluster.id,
|
|
221
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]])
|
|
222
|
+
```
|
|
223
|
+
|
|
191
224
|
## Import
|
|
192
225
|
|
|
193
226
|
An existing group can be imported into this resource by
|
|
@@ -198,6 +231,8 @@ class ComputeClusterHostGroup(pulumi.CustomResource):
|
|
|
198
231
|
|
|
199
232
|
will be returned. An example is below:
|
|
200
233
|
|
|
234
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
235
|
+
|
|
201
236
|
```sh
|
|
202
237
|
$ pulumi import vsphere:index/computeClusterHostGroup:ComputeClusterHostGroup cluster_host_group \\
|
|
203
238
|
```
|
|
@@ -241,6 +276,39 @@ class ComputeClusterHostGroup(pulumi.CustomResource):
|
|
|
241
276
|
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
242
277
|
connections.
|
|
243
278
|
|
|
279
|
+
## Example Usage
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
import pulumi
|
|
283
|
+
import pulumi_vsphere as vsphere
|
|
284
|
+
|
|
285
|
+
config = pulumi.Config()
|
|
286
|
+
datacenter = config.get("datacenter")
|
|
287
|
+
if datacenter is None:
|
|
288
|
+
datacenter = "dc-01"
|
|
289
|
+
hosts = config.get_object("hosts")
|
|
290
|
+
if hosts is None:
|
|
291
|
+
hosts = [
|
|
292
|
+
"esxi-01.example.com",
|
|
293
|
+
"esxi-02.example.com",
|
|
294
|
+
"esxi-03.example.com",
|
|
295
|
+
]
|
|
296
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
297
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
298
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
299
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
300
|
+
name="compute-cluster-test",
|
|
301
|
+
datacenter_id=dc["id"],
|
|
302
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
303
|
+
drs_enabled=True,
|
|
304
|
+
drs_automation_level="fullyAutomated",
|
|
305
|
+
ha_enabled=True)
|
|
306
|
+
cluster_host_group = vsphere.ComputeClusterHostGroup("cluster_host_group",
|
|
307
|
+
name="test-cluster-host-group",
|
|
308
|
+
compute_cluster_id=compute_cluster.id,
|
|
309
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]])
|
|
310
|
+
```
|
|
311
|
+
|
|
244
312
|
## Import
|
|
245
313
|
|
|
246
314
|
An existing group can be imported into this resource by
|
|
@@ -251,6 +319,8 @@ class ComputeClusterHostGroup(pulumi.CustomResource):
|
|
|
251
319
|
|
|
252
320
|
will be returned. An example is below:
|
|
253
321
|
|
|
322
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
323
|
+
|
|
254
324
|
```sh
|
|
255
325
|
$ pulumi import vsphere:index/computeClusterHostGroup:ComputeClusterHostGroup cluster_host_group \\
|
|
256
326
|
```
|
|
@@ -246,6 +246,8 @@ class ComputeClusterVmAntiAffinityRule(pulumi.CustomResource):
|
|
|
246
246
|
|
|
247
247
|
example is below:
|
|
248
248
|
|
|
249
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
250
|
+
|
|
249
251
|
```sh
|
|
250
252
|
$ pulumi import vsphere:index/computeClusterVmAntiAffinityRule:ComputeClusterVmAntiAffinityRule vm_anti_affinity_rule \\
|
|
251
253
|
```
|
|
@@ -287,6 +289,8 @@ class ComputeClusterVmAntiAffinityRule(pulumi.CustomResource):
|
|
|
287
289
|
|
|
288
290
|
example is below:
|
|
289
291
|
|
|
292
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
293
|
+
|
|
290
294
|
```sh
|
|
291
295
|
$ pulumi import vsphere:index/computeClusterVmAntiAffinityRule:ComputeClusterVmAntiAffinityRule vm_anti_affinity_rule \\
|
|
292
296
|
```
|
|
@@ -384,6 +384,8 @@ class ComputeClusterVmDependencyRule(pulumi.CustomResource):
|
|
|
384
384
|
|
|
385
385
|
example is below:
|
|
386
386
|
|
|
387
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
388
|
+
|
|
387
389
|
```sh
|
|
388
390
|
$ pulumi import vsphere:index/computeClusterVmDependencyRule:ComputeClusterVmDependencyRule cluster_vm_dependency_rule \\
|
|
389
391
|
```
|
|
@@ -514,6 +516,8 @@ class ComputeClusterVmDependencyRule(pulumi.CustomResource):
|
|
|
514
516
|
|
|
515
517
|
example is below:
|
|
516
518
|
|
|
519
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
520
|
+
|
|
517
521
|
```sh
|
|
518
522
|
$ pulumi import vsphere:index/computeClusterVmDependencyRule:ComputeClusterVmDependencyRule cluster_vm_dependency_rule \\
|
|
519
523
|
```
|
|
@@ -266,6 +266,8 @@ class ComputeClusterVmGroup(pulumi.CustomResource):
|
|
|
266
266
|
|
|
267
267
|
will be returned. An example is below:
|
|
268
268
|
|
|
269
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
270
|
+
|
|
269
271
|
```sh
|
|
270
272
|
$ pulumi import vsphere:index/computeClusterVmGroup:ComputeClusterVmGroup cluster_vm_group \\
|
|
271
273
|
```
|
|
@@ -372,6 +374,8 @@ class ComputeClusterVmGroup(pulumi.CustomResource):
|
|
|
372
374
|
|
|
373
375
|
will be returned. An example is below:
|
|
374
376
|
|
|
377
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
378
|
+
|
|
375
379
|
```sh
|
|
376
380
|
$ pulumi import vsphere:index/computeClusterVmGroup:ComputeClusterVmGroup cluster_vm_group \\
|
|
377
381
|
```
|
|
@@ -426,6 +426,8 @@ class ComputeClusterVmHostRule(pulumi.CustomResource):
|
|
|
426
426
|
|
|
427
427
|
example is below:
|
|
428
428
|
|
|
429
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
430
|
+
|
|
429
431
|
```sh
|
|
430
432
|
$ pulumi import vsphere:index/computeClusterVmHostRule:ComputeClusterVmHostRule cluster_vm_host_rule \\
|
|
431
433
|
```
|
|
@@ -556,6 +558,8 @@ class ComputeClusterVmHostRule(pulumi.CustomResource):
|
|
|
556
558
|
|
|
557
559
|
example is below:
|
|
558
560
|
|
|
561
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
562
|
+
|
|
559
563
|
```sh
|
|
560
564
|
$ pulumi import vsphere:index/computeClusterVmHostRule:ComputeClusterVmHostRule cluster_vm_host_rule \\
|
|
561
565
|
```
|
|
@@ -252,6 +252,8 @@ class ContentLibrary(pulumi.CustomResource):
|
|
|
252
252
|
|
|
253
253
|
An existing content library can be imported into this resource by supplying the content library ID. For example:
|
|
254
254
|
|
|
255
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
256
|
+
|
|
255
257
|
```sh
|
|
256
258
|
$ pulumi import vsphere:index/contentLibrary:ContentLibrary vsphere_content_library publisher_content_library f42a4b25-844a-44ec-9063-a3a5e9cc88c7
|
|
257
259
|
```
|
|
@@ -316,6 +318,8 @@ class ContentLibrary(pulumi.CustomResource):
|
|
|
316
318
|
|
|
317
319
|
An existing content library can be imported into this resource by supplying the content library ID. For example:
|
|
318
320
|
|
|
321
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
322
|
+
|
|
319
323
|
```sh
|
|
320
324
|
$ pulumi import vsphere:index/contentLibrary:ContentLibrary vsphere_content_library publisher_content_library f42a4b25-844a-44ec-9063-a3a5e9cc88c7
|
|
321
325
|
```
|
|
@@ -307,6 +307,8 @@ class ContentLibraryItem(pulumi.CustomResource):
|
|
|
307
307
|
|
|
308
308
|
supplying the content library ID. An example is below:
|
|
309
309
|
|
|
310
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
311
|
+
|
|
310
312
|
```sh
|
|
311
313
|
$ pulumi import vsphere:index/contentLibraryItem:ContentLibraryItem vsphere_content_library_item iso-linux-ubuntu-server-lts xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
312
314
|
```
|
|
@@ -393,6 +395,8 @@ class ContentLibraryItem(pulumi.CustomResource):
|
|
|
393
395
|
|
|
394
396
|
supplying the content library ID. An example is below:
|
|
395
397
|
|
|
398
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
399
|
+
|
|
396
400
|
```sh
|
|
397
401
|
$ pulumi import vsphere:index/contentLibraryItem:ContentLibraryItem vsphere_content_library_item iso-linux-ubuntu-server-lts xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
398
402
|
```
|
|
@@ -147,6 +147,8 @@ class CustomAttribute(pulumi.CustomResource):
|
|
|
147
147
|
|
|
148
148
|
via its name, using the following command:
|
|
149
149
|
|
|
150
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
151
|
+
|
|
150
152
|
```sh
|
|
151
153
|
$ pulumi import vsphere:index/customAttribute:CustomAttribute attribute terraform-test-attribute
|
|
152
154
|
```
|
|
@@ -197,6 +199,8 @@ class CustomAttribute(pulumi.CustomResource):
|
|
|
197
199
|
|
|
198
200
|
via its name, using the following command:
|
|
199
201
|
|
|
202
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
203
|
+
|
|
200
204
|
```sh
|
|
201
205
|
$ pulumi import vsphere:index/customAttribute:CustomAttribute attribute terraform-test-attribute
|
|
202
206
|
```
|
|
@@ -968,12 +968,56 @@ class DatastoreCluster(pulumi.CustomResource):
|
|
|
968
968
|
|
|
969
969
|
> **NOTE:** Storage DRS requires a vSphere Enterprise Plus license.
|
|
970
970
|
|
|
971
|
+
## Example Usage
|
|
972
|
+
|
|
973
|
+
The following example sets up a datastore cluster and enables Storage DRS with
|
|
974
|
+
the default settings. It then creates two NAS datastores using the
|
|
975
|
+
`NasDatastore` resource and assigns them to
|
|
976
|
+
the datastore cluster.
|
|
977
|
+
|
|
978
|
+
```python
|
|
979
|
+
import pulumi
|
|
980
|
+
import pulumi_vsphere as vsphere
|
|
981
|
+
|
|
982
|
+
config = pulumi.Config()
|
|
983
|
+
hosts = config.get_object("hosts")
|
|
984
|
+
if hosts is None:
|
|
985
|
+
hosts = [
|
|
986
|
+
"esxi-01.example.com",
|
|
987
|
+
"esxi-02.example.com",
|
|
988
|
+
"esxi-03.example.com",
|
|
989
|
+
]
|
|
990
|
+
datacenter = vsphere.get_datacenter()
|
|
991
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
992
|
+
datacenter_id=datacenter.id) for __index in range(len(hosts))]
|
|
993
|
+
datastore_cluster = vsphere.DatastoreCluster("datastore_cluster",
|
|
994
|
+
name="datastore-cluster-test",
|
|
995
|
+
datacenter_id=datacenter.id,
|
|
996
|
+
sdrs_enabled=True)
|
|
997
|
+
datastore1 = vsphere.NasDatastore("datastore1",
|
|
998
|
+
name="datastore-test1",
|
|
999
|
+
host_system_ids=[[__item["id"] for __item in esxi_hosts]],
|
|
1000
|
+
datastore_cluster_id=datastore_cluster.id,
|
|
1001
|
+
type="NFS",
|
|
1002
|
+
remote_hosts=["nfs"],
|
|
1003
|
+
remote_path="/export/test1")
|
|
1004
|
+
datastore2 = vsphere.NasDatastore("datastore2",
|
|
1005
|
+
name="datastore-test2",
|
|
1006
|
+
host_system_ids=[[__item["id"] for __item in esxi_hosts]],
|
|
1007
|
+
datastore_cluster_id=datastore_cluster.id,
|
|
1008
|
+
type="NFS",
|
|
1009
|
+
remote_hosts=["nfs"],
|
|
1010
|
+
remote_path="/export/test2")
|
|
1011
|
+
```
|
|
1012
|
+
|
|
971
1013
|
## Import
|
|
972
1014
|
|
|
973
1015
|
An existing datastore cluster can be imported into this resource
|
|
974
1016
|
|
|
975
1017
|
via the path to the cluster, via the following command:
|
|
976
1018
|
|
|
1019
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
1020
|
+
|
|
977
1021
|
```sh
|
|
978
1022
|
$ pulumi import vsphere:index/datastoreCluster:DatastoreCluster datastore_cluster /dc1/datastore/ds-cluster
|
|
979
1023
|
```
|
|
@@ -1054,12 +1098,56 @@ class DatastoreCluster(pulumi.CustomResource):
|
|
|
1054
1098
|
|
|
1055
1099
|
> **NOTE:** Storage DRS requires a vSphere Enterprise Plus license.
|
|
1056
1100
|
|
|
1101
|
+
## Example Usage
|
|
1102
|
+
|
|
1103
|
+
The following example sets up a datastore cluster and enables Storage DRS with
|
|
1104
|
+
the default settings. It then creates two NAS datastores using the
|
|
1105
|
+
`NasDatastore` resource and assigns them to
|
|
1106
|
+
the datastore cluster.
|
|
1107
|
+
|
|
1108
|
+
```python
|
|
1109
|
+
import pulumi
|
|
1110
|
+
import pulumi_vsphere as vsphere
|
|
1111
|
+
|
|
1112
|
+
config = pulumi.Config()
|
|
1113
|
+
hosts = config.get_object("hosts")
|
|
1114
|
+
if hosts is None:
|
|
1115
|
+
hosts = [
|
|
1116
|
+
"esxi-01.example.com",
|
|
1117
|
+
"esxi-02.example.com",
|
|
1118
|
+
"esxi-03.example.com",
|
|
1119
|
+
]
|
|
1120
|
+
datacenter = vsphere.get_datacenter()
|
|
1121
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
1122
|
+
datacenter_id=datacenter.id) for __index in range(len(hosts))]
|
|
1123
|
+
datastore_cluster = vsphere.DatastoreCluster("datastore_cluster",
|
|
1124
|
+
name="datastore-cluster-test",
|
|
1125
|
+
datacenter_id=datacenter.id,
|
|
1126
|
+
sdrs_enabled=True)
|
|
1127
|
+
datastore1 = vsphere.NasDatastore("datastore1",
|
|
1128
|
+
name="datastore-test1",
|
|
1129
|
+
host_system_ids=[[__item["id"] for __item in esxi_hosts]],
|
|
1130
|
+
datastore_cluster_id=datastore_cluster.id,
|
|
1131
|
+
type="NFS",
|
|
1132
|
+
remote_hosts=["nfs"],
|
|
1133
|
+
remote_path="/export/test1")
|
|
1134
|
+
datastore2 = vsphere.NasDatastore("datastore2",
|
|
1135
|
+
name="datastore-test2",
|
|
1136
|
+
host_system_ids=[[__item["id"] for __item in esxi_hosts]],
|
|
1137
|
+
datastore_cluster_id=datastore_cluster.id,
|
|
1138
|
+
type="NFS",
|
|
1139
|
+
remote_hosts=["nfs"],
|
|
1140
|
+
remote_path="/export/test2")
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1057
1143
|
## Import
|
|
1058
1144
|
|
|
1059
1145
|
An existing datastore cluster can be imported into this resource
|
|
1060
1146
|
|
|
1061
1147
|
via the path to the cluster, via the following command:
|
|
1062
1148
|
|
|
1149
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
1150
|
+
|
|
1063
1151
|
```sh
|
|
1064
1152
|
$ pulumi import vsphere:index/datastoreCluster:DatastoreCluster datastore_cluster /dc1/datastore/ds-cluster
|
|
1065
1153
|
```
|
|
@@ -297,6 +297,8 @@ class DatastoreClusterVmAntiAffinityRule(pulumi.CustomResource):
|
|
|
297
297
|
|
|
298
298
|
example is below:
|
|
299
299
|
|
|
300
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
301
|
+
|
|
300
302
|
```sh
|
|
301
303
|
$ pulumi import vsphere:index/datastoreClusterVmAntiAffinityRule:DatastoreClusterVmAntiAffinityRule cluster_vm_anti_affinity_rule \\
|
|
302
304
|
```
|
|
@@ -395,6 +397,8 @@ class DatastoreClusterVmAntiAffinityRule(pulumi.CustomResource):
|
|
|
395
397
|
|
|
396
398
|
example is below:
|
|
397
399
|
|
|
400
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
401
|
+
|
|
398
402
|
```sh
|
|
399
403
|
$ pulumi import vsphere:index/datastoreClusterVmAntiAffinityRule:DatastoreClusterVmAntiAffinityRule cluster_vm_anti_affinity_rule \\
|
|
400
404
|
```
|
|
@@ -1810,6 +1810,8 @@ class DistributedPortGroup(pulumi.CustomResource):
|
|
|
1810
1810
|
|
|
1811
1811
|
the managed object id of the port group, via the following command:
|
|
1812
1812
|
|
|
1813
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
1814
|
+
|
|
1813
1815
|
```sh
|
|
1814
1816
|
$ pulumi import vsphere:index/distributedPortGroup:DistributedPortGroup pg /dc-01/network/pg-01
|
|
1815
1817
|
```
|
|
@@ -2027,6 +2029,8 @@ class DistributedPortGroup(pulumi.CustomResource):
|
|
|
2027
2029
|
|
|
2028
2030
|
the managed object id of the port group, via the following command:
|
|
2029
2031
|
|
|
2032
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
2033
|
+
|
|
2030
2034
|
```sh
|
|
2031
2035
|
$ pulumi import vsphere:index/distributedPortGroup:DistributedPortGroup pg /dc-01/network/pg-01
|
|
2032
2036
|
```
|
|
@@ -3366,6 +3366,8 @@ class DistributedVirtualSwitch(pulumi.CustomResource):
|
|
|
3366
3366
|
|
|
3367
3367
|
to the VDS, via the following command:
|
|
3368
3368
|
|
|
3369
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
3370
|
+
|
|
3369
3371
|
```sh
|
|
3370
3372
|
$ pulumi import vsphere:index/distributedVirtualSwitch:DistributedVirtualSwitch vds /dc-01/network/vds-01
|
|
3371
3373
|
```
|
|
@@ -3619,6 +3621,8 @@ class DistributedVirtualSwitch(pulumi.CustomResource):
|
|
|
3619
3621
|
|
|
3620
3622
|
to the VDS, via the following command:
|
|
3621
3623
|
|
|
3624
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
3625
|
+
|
|
3622
3626
|
```sh
|
|
3623
3627
|
$ pulumi import vsphere:index/distributedVirtualSwitch:DistributedVirtualSwitch vds /dc-01/network/vds-01
|
|
3624
3628
|
```
|
|
@@ -220,6 +220,48 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
220
220
|
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
221
221
|
connections.
|
|
222
222
|
|
|
223
|
+
## Example Usage
|
|
224
|
+
|
|
225
|
+
The following example creates a compute cluster comprised of three hosts,
|
|
226
|
+
making use of the
|
|
227
|
+
`ComputeCluster` resource. DPM
|
|
228
|
+
will be disabled in the cluster as it is the default setting, but we override
|
|
229
|
+
the setting of the first host referenced by the
|
|
230
|
+
`Host` data source (`esxi1`) by using
|
|
231
|
+
the `DpmHostOverride` resource so it will be powered off when the
|
|
232
|
+
cluster does not need it to service virtual machines.
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
import pulumi
|
|
236
|
+
import pulumi_vsphere as vsphere
|
|
237
|
+
|
|
238
|
+
config = pulumi.Config()
|
|
239
|
+
datacenter = config.get("datacenter")
|
|
240
|
+
if datacenter is None:
|
|
241
|
+
datacenter = "dc-01"
|
|
242
|
+
hosts = config.get_object("hosts")
|
|
243
|
+
if hosts is None:
|
|
244
|
+
hosts = [
|
|
245
|
+
"esxi-01.example.com",
|
|
246
|
+
"esxi-02.example.com",
|
|
247
|
+
"esxi-03.example.com",
|
|
248
|
+
]
|
|
249
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
250
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
251
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
252
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
253
|
+
name="compute-cluster-test",
|
|
254
|
+
datacenter_id=dc["id"],
|
|
255
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
256
|
+
drs_enabled=True,
|
|
257
|
+
drs_automation_level="fullyAutomated")
|
|
258
|
+
dpm_host_override = vsphere.DpmHostOverride("dpm_host_override",
|
|
259
|
+
compute_cluster_id=compute_cluster.id,
|
|
260
|
+
host_system_id=hosts_get_host[0].id,
|
|
261
|
+
dpm_enabled=True,
|
|
262
|
+
dpm_automation_level="automated")
|
|
263
|
+
```
|
|
264
|
+
|
|
223
265
|
## Import
|
|
224
266
|
|
|
225
267
|
An existing override can be imported into this resource by
|
|
@@ -228,6 +270,8 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
228
270
|
|
|
229
271
|
import`. If no override exists, an error will be given. An example is below:
|
|
230
272
|
|
|
273
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
274
|
+
|
|
231
275
|
```sh
|
|
232
276
|
$ pulumi import vsphere:index/dpmHostOverride:DpmHostOverride dpm_host_override \\
|
|
233
277
|
```
|
|
@@ -272,6 +316,48 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
272
316
|
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
273
317
|
connections.
|
|
274
318
|
|
|
319
|
+
## Example Usage
|
|
320
|
+
|
|
321
|
+
The following example creates a compute cluster comprised of three hosts,
|
|
322
|
+
making use of the
|
|
323
|
+
`ComputeCluster` resource. DPM
|
|
324
|
+
will be disabled in the cluster as it is the default setting, but we override
|
|
325
|
+
the setting of the first host referenced by the
|
|
326
|
+
`Host` data source (`esxi1`) by using
|
|
327
|
+
the `DpmHostOverride` resource so it will be powered off when the
|
|
328
|
+
cluster does not need it to service virtual machines.
|
|
329
|
+
|
|
330
|
+
```python
|
|
331
|
+
import pulumi
|
|
332
|
+
import pulumi_vsphere as vsphere
|
|
333
|
+
|
|
334
|
+
config = pulumi.Config()
|
|
335
|
+
datacenter = config.get("datacenter")
|
|
336
|
+
if datacenter is None:
|
|
337
|
+
datacenter = "dc-01"
|
|
338
|
+
hosts = config.get_object("hosts")
|
|
339
|
+
if hosts is None:
|
|
340
|
+
hosts = [
|
|
341
|
+
"esxi-01.example.com",
|
|
342
|
+
"esxi-02.example.com",
|
|
343
|
+
"esxi-03.example.com",
|
|
344
|
+
]
|
|
345
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
346
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
347
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
348
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
349
|
+
name="compute-cluster-test",
|
|
350
|
+
datacenter_id=dc["id"],
|
|
351
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
352
|
+
drs_enabled=True,
|
|
353
|
+
drs_automation_level="fullyAutomated")
|
|
354
|
+
dpm_host_override = vsphere.DpmHostOverride("dpm_host_override",
|
|
355
|
+
compute_cluster_id=compute_cluster.id,
|
|
356
|
+
host_system_id=hosts_get_host[0].id,
|
|
357
|
+
dpm_enabled=True,
|
|
358
|
+
dpm_automation_level="automated")
|
|
359
|
+
```
|
|
360
|
+
|
|
275
361
|
## Import
|
|
276
362
|
|
|
277
363
|
An existing override can be imported into this resource by
|
|
@@ -280,6 +366,8 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
280
366
|
|
|
281
367
|
import`. If no override exists, an error will be given. An example is below:
|
|
282
368
|
|
|
369
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
370
|
+
|
|
283
371
|
```sh
|
|
284
372
|
$ pulumi import vsphere:index/dpmHostOverride:DpmHostOverride dpm_host_override \\
|
|
285
373
|
```
|
|
@@ -281,6 +281,8 @@ class DrsVmOverride(pulumi.CustomResource):
|
|
|
281
281
|
|
|
282
282
|
is below:
|
|
283
283
|
|
|
284
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
285
|
+
|
|
284
286
|
```sh
|
|
285
287
|
$ pulumi import vsphere:index/drsVmOverride:DrsVmOverride drs_vm_override \\
|
|
286
288
|
```
|
|
@@ -383,6 +385,8 @@ class DrsVmOverride(pulumi.CustomResource):
|
|
|
383
385
|
|
|
384
386
|
is below:
|
|
385
387
|
|
|
388
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
389
|
+
|
|
386
390
|
```sh
|
|
387
391
|
$ pulumi import vsphere:index/drsVmOverride:DrsVmOverride drs_vm_override \\
|
|
388
392
|
```
|