pulumi-vsphere 4.11.0a1713340048__py3-none-any.whl → 4.11.0a1713561492__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/_inputs.py +22 -20
- pulumi_vsphere/compute_cluster_vm_affinity_rule.py +14 -8
- pulumi_vsphere/datacenter.py +8 -4
- pulumi_vsphere/distributed_virtual_switch.py +14 -14
- pulumi_vsphere/file.py +16 -16
- pulumi_vsphere/get_compute_cluster_host_group.py +8 -6
- pulumi_vsphere/get_datastore_stats.py +4 -4
- pulumi_vsphere/get_distributed_virtual_switch.py +2 -0
- pulumi_vsphere/get_dynamic.py +4 -4
- pulumi_vsphere/get_resource_pool.py +2 -2
- pulumi_vsphere/guest_os_customization.py +54 -0
- pulumi_vsphere/host_port_group.py +12 -4
- pulumi_vsphere/license.py +0 -32
- pulumi_vsphere/outputs.py +22 -20
- pulumi_vsphere/resource_pool.py +20 -10
- pulumi_vsphere/virtual_machine_snapshot.py +6 -6
- pulumi_vsphere/vm_storage_policy.py +72 -72
- pulumi_vsphere/vnic.py +8 -0
- {pulumi_vsphere-4.11.0a1713340048.dist-info → pulumi_vsphere-4.11.0a1713561492.dist-info}/METADATA +1 -1
- {pulumi_vsphere-4.11.0a1713340048.dist-info → pulumi_vsphere-4.11.0a1713561492.dist-info}/RECORD +22 -22
- {pulumi_vsphere-4.11.0a1713340048.dist-info → pulumi_vsphere-4.11.0a1713561492.dist-info}/WHEEL +0 -0
- {pulumi_vsphere-4.11.0a1713340048.dist-info → pulumi_vsphere-4.11.0a1713561492.dist-info}/top_level.txt +0 -0
pulumi_vsphere/_inputs.py
CHANGED
|
@@ -165,9 +165,10 @@ class ComputeClusterVsanStretchedClusterArgs:
|
|
|
165
165
|
import pulumi
|
|
166
166
|
import pulumi_vsphere as vsphere
|
|
167
167
|
|
|
168
|
-
compute_cluster = vsphere.ComputeCluster("
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
169
|
+
name="terraform-compute-cluster-test",
|
|
170
|
+
datacenter_id=datacenter["id"],
|
|
171
|
+
host_system_ids=[[__item["id"] for __item in host]],
|
|
171
172
|
drs_enabled=True,
|
|
172
173
|
drs_automation_level="fullyAutomated",
|
|
173
174
|
ha_enabled=False,
|
|
@@ -182,25 +183,25 @@ class ComputeClusterVsanStretchedClusterArgs:
|
|
|
182
183
|
vsan_dit_encryption_enabled=True,
|
|
183
184
|
vsan_dit_rekey_interval=1800,
|
|
184
185
|
vsan_disk_groups=[vsphere.ComputeClusterVsanDiskGroupArgs(
|
|
185
|
-
cache=
|
|
186
|
-
storages=
|
|
186
|
+
cache=cache_disks[0],
|
|
187
|
+
storages=storage_disks,
|
|
187
188
|
)],
|
|
188
189
|
vsan_fault_domains=[vsphere.ComputeClusterVsanFaultDomainArgs(
|
|
189
190
|
fault_domains=[
|
|
190
191
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
191
192
|
name="fd1",
|
|
192
|
-
host_ids=[[__item["id"] for __item in
|
|
193
|
+
host_ids=[[__item["id"] for __item in faultdomain1_hosts]],
|
|
193
194
|
),
|
|
194
195
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
195
196
|
name="fd2",
|
|
196
|
-
host_ids=[[__item["id"] for __item in
|
|
197
|
+
host_ids=[[__item["id"] for __item in faultdomain2_hosts]],
|
|
197
198
|
),
|
|
198
199
|
],
|
|
199
200
|
)],
|
|
200
201
|
vsan_stretched_cluster=vsphere.ComputeClusterVsanStretchedClusterArgs(
|
|
201
|
-
preferred_fault_domain_host_ids=[[__item["id"] for __item in
|
|
202
|
-
secondary_fault_domain_host_ids=[[__item["id"] for __item in
|
|
203
|
-
witness_node=
|
|
202
|
+
preferred_fault_domain_host_ids=[[__item["id"] for __item in preferred_fault_domain_host]],
|
|
203
|
+
secondary_fault_domain_host_ids=[[__item["id"] for __item in secondary_fault_domain_host]],
|
|
204
|
+
witness_node=witness_host["id"],
|
|
204
205
|
))
|
|
205
206
|
```
|
|
206
207
|
<!--End PulumiCodeChooser -->
|
|
@@ -275,9 +276,10 @@ class ComputeClusterVsanStretchedClusterArgs:
|
|
|
275
276
|
import pulumi
|
|
276
277
|
import pulumi_vsphere as vsphere
|
|
277
278
|
|
|
278
|
-
compute_cluster = vsphere.ComputeCluster("
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
280
|
+
name="terraform-compute-cluster-test",
|
|
281
|
+
datacenter_id=datacenter["id"],
|
|
282
|
+
host_system_ids=[[__item["id"] for __item in host]],
|
|
281
283
|
drs_enabled=True,
|
|
282
284
|
drs_automation_level="fullyAutomated",
|
|
283
285
|
ha_enabled=False,
|
|
@@ -292,25 +294,25 @@ class ComputeClusterVsanStretchedClusterArgs:
|
|
|
292
294
|
vsan_dit_encryption_enabled=True,
|
|
293
295
|
vsan_dit_rekey_interval=1800,
|
|
294
296
|
vsan_disk_groups=[vsphere.ComputeClusterVsanDiskGroupArgs(
|
|
295
|
-
cache=
|
|
296
|
-
storages=
|
|
297
|
+
cache=cache_disks[0],
|
|
298
|
+
storages=storage_disks,
|
|
297
299
|
)],
|
|
298
300
|
vsan_fault_domains=[vsphere.ComputeClusterVsanFaultDomainArgs(
|
|
299
301
|
fault_domains=[
|
|
300
302
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
301
303
|
name="fd1",
|
|
302
|
-
host_ids=[[__item["id"] for __item in
|
|
304
|
+
host_ids=[[__item["id"] for __item in faultdomain1_hosts]],
|
|
303
305
|
),
|
|
304
306
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
305
307
|
name="fd2",
|
|
306
|
-
host_ids=[[__item["id"] for __item in
|
|
308
|
+
host_ids=[[__item["id"] for __item in faultdomain2_hosts]],
|
|
307
309
|
),
|
|
308
310
|
],
|
|
309
311
|
)],
|
|
310
312
|
vsan_stretched_cluster=vsphere.ComputeClusterVsanStretchedClusterArgs(
|
|
311
|
-
preferred_fault_domain_host_ids=[[__item["id"] for __item in
|
|
312
|
-
secondary_fault_domain_host_ids=[[__item["id"] for __item in
|
|
313
|
-
witness_node=
|
|
313
|
+
preferred_fault_domain_host_ids=[[__item["id"] for __item in preferred_fault_domain_host]],
|
|
314
|
+
secondary_fault_domain_host_ids=[[__item["id"] for __item in secondary_fault_domain_host]],
|
|
315
|
+
witness_node=witness_host["id"],
|
|
314
316
|
))
|
|
315
317
|
```
|
|
316
318
|
<!--End PulumiCodeChooser -->
|
|
@@ -275,6 +275,7 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
275
275
|
vm = []
|
|
276
276
|
for range in [{"value": i} for i in range(0, 2)]:
|
|
277
277
|
vm.append(vsphere.VirtualMachine(f"vm-{range['value']}",
|
|
278
|
+
name=f"foo-{range['value']}",
|
|
278
279
|
resource_pool_id=cluster.resource_pool_id,
|
|
279
280
|
datastore_id=datastore.id,
|
|
280
281
|
num_cpus=1,
|
|
@@ -287,7 +288,8 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
287
288
|
label="disk0",
|
|
288
289
|
size=20,
|
|
289
290
|
)]))
|
|
290
|
-
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("
|
|
291
|
+
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
|
|
292
|
+
name="vm-affinity-rule",
|
|
291
293
|
compute_cluster_id=cluster.id,
|
|
292
294
|
virtual_machine_ids=[v.id for k, v in vm])
|
|
293
295
|
```
|
|
@@ -309,12 +311,13 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
309
311
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
310
312
|
cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
311
313
|
datacenter_id=datacenter.id)
|
|
312
|
-
|
|
314
|
+
vms_get_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
|
|
313
315
|
datacenter_id=datacenter.id) for __index in range(len(vms))]
|
|
314
|
-
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("
|
|
316
|
+
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
|
|
317
|
+
name="vm-affinity-rule",
|
|
315
318
|
enabled=True,
|
|
316
319
|
compute_cluster_id=cluster.id,
|
|
317
|
-
virtual_machine_ids=[__item.id for __item in
|
|
320
|
+
virtual_machine_ids=[__item.id for __item in vms_get_virtual_machine])
|
|
318
321
|
```
|
|
319
322
|
<!--End PulumiCodeChooser -->
|
|
320
323
|
|
|
@@ -394,6 +397,7 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
394
397
|
vm = []
|
|
395
398
|
for range in [{"value": i} for i in range(0, 2)]:
|
|
396
399
|
vm.append(vsphere.VirtualMachine(f"vm-{range['value']}",
|
|
400
|
+
name=f"foo-{range['value']}",
|
|
397
401
|
resource_pool_id=cluster.resource_pool_id,
|
|
398
402
|
datastore_id=datastore.id,
|
|
399
403
|
num_cpus=1,
|
|
@@ -406,7 +410,8 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
406
410
|
label="disk0",
|
|
407
411
|
size=20,
|
|
408
412
|
)]))
|
|
409
|
-
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("
|
|
413
|
+
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
|
|
414
|
+
name="vm-affinity-rule",
|
|
410
415
|
compute_cluster_id=cluster.id,
|
|
411
416
|
virtual_machine_ids=[v.id for k, v in vm])
|
|
412
417
|
```
|
|
@@ -428,12 +433,13 @@ class ComputeClusterVmAffinityRule(pulumi.CustomResource):
|
|
|
428
433
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
429
434
|
cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
430
435
|
datacenter_id=datacenter.id)
|
|
431
|
-
|
|
436
|
+
vms_get_virtual_machine = [vsphere.get_virtual_machine(name=vms[__index],
|
|
432
437
|
datacenter_id=datacenter.id) for __index in range(len(vms))]
|
|
433
|
-
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("
|
|
438
|
+
vm_affinity_rule = vsphere.ComputeClusterVmAffinityRule("vm_affinity_rule",
|
|
439
|
+
name="vm-affinity-rule",
|
|
434
440
|
enabled=True,
|
|
435
441
|
compute_cluster_id=cluster.id,
|
|
436
|
-
virtual_machine_ids=[__item.id for __item in
|
|
442
|
+
virtual_machine_ids=[__item.id for __item in vms_get_virtual_machine])
|
|
437
443
|
```
|
|
438
444
|
<!--End PulumiCodeChooser -->
|
|
439
445
|
|
pulumi_vsphere/datacenter.py
CHANGED
|
@@ -246,7 +246,7 @@ class Datacenter(pulumi.CustomResource):
|
|
|
246
246
|
import pulumi
|
|
247
247
|
import pulumi_vsphere as vsphere
|
|
248
248
|
|
|
249
|
-
prod_datacenter = vsphere.Datacenter("
|
|
249
|
+
prod_datacenter = vsphere.Datacenter("prod_datacenter", name="my_prod_datacenter")
|
|
250
250
|
```
|
|
251
251
|
<!--End PulumiCodeChooser -->
|
|
252
252
|
|
|
@@ -257,7 +257,9 @@ class Datacenter(pulumi.CustomResource):
|
|
|
257
257
|
import pulumi
|
|
258
258
|
import pulumi_vsphere as vsphere
|
|
259
259
|
|
|
260
|
-
research_datacenter = vsphere.Datacenter("
|
|
260
|
+
research_datacenter = vsphere.Datacenter("research_datacenter",
|
|
261
|
+
name="my_research_datacenter",
|
|
262
|
+
folder="/research/")
|
|
261
263
|
```
|
|
262
264
|
<!--End PulumiCodeChooser -->
|
|
263
265
|
|
|
@@ -309,7 +311,7 @@ class Datacenter(pulumi.CustomResource):
|
|
|
309
311
|
import pulumi
|
|
310
312
|
import pulumi_vsphere as vsphere
|
|
311
313
|
|
|
312
|
-
prod_datacenter = vsphere.Datacenter("
|
|
314
|
+
prod_datacenter = vsphere.Datacenter("prod_datacenter", name="my_prod_datacenter")
|
|
313
315
|
```
|
|
314
316
|
<!--End PulumiCodeChooser -->
|
|
315
317
|
|
|
@@ -320,7 +322,9 @@ class Datacenter(pulumi.CustomResource):
|
|
|
320
322
|
import pulumi
|
|
321
323
|
import pulumi_vsphere as vsphere
|
|
322
324
|
|
|
323
|
-
research_datacenter = vsphere.Datacenter("
|
|
325
|
+
research_datacenter = vsphere.Datacenter("research_datacenter",
|
|
326
|
+
name="my_research_datacenter",
|
|
327
|
+
folder="/research/")
|
|
324
328
|
```
|
|
325
329
|
<!--End PulumiCodeChooser -->
|
|
326
330
|
|
|
@@ -282,12 +282,12 @@ class DistributedVirtualSwitchArgs:
|
|
|
282
282
|
|
|
283
283
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
284
284
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
285
|
-
max_vlan=199,
|
|
286
285
|
min_vlan=100,
|
|
286
|
+
max_vlan=199,
|
|
287
287
|
),
|
|
288
288
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
289
|
-
max_vlan=399,
|
|
290
289
|
min_vlan=300,
|
|
290
|
+
max_vlan=399,
|
|
291
291
|
),
|
|
292
292
|
])
|
|
293
293
|
```
|
|
@@ -1598,12 +1598,12 @@ class DistributedVirtualSwitchArgs:
|
|
|
1598
1598
|
|
|
1599
1599
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
1600
1600
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
1601
|
-
max_vlan=199,
|
|
1602
1601
|
min_vlan=100,
|
|
1602
|
+
max_vlan=199,
|
|
1603
1603
|
),
|
|
1604
1604
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
1605
|
-
max_vlan=399,
|
|
1606
1605
|
min_vlan=300,
|
|
1606
|
+
max_vlan=399,
|
|
1607
1607
|
),
|
|
1608
1608
|
])
|
|
1609
1609
|
```
|
|
@@ -1984,12 +1984,12 @@ class _DistributedVirtualSwitchState:
|
|
|
1984
1984
|
|
|
1985
1985
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
1986
1986
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
1987
|
-
max_vlan=199,
|
|
1988
1987
|
min_vlan=100,
|
|
1988
|
+
max_vlan=199,
|
|
1989
1989
|
),
|
|
1990
1990
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
1991
|
-
max_vlan=399,
|
|
1992
1991
|
min_vlan=300,
|
|
1992
|
+
max_vlan=399,
|
|
1993
1993
|
),
|
|
1994
1994
|
])
|
|
1995
1995
|
```
|
|
@@ -3316,12 +3316,12 @@ class _DistributedVirtualSwitchState:
|
|
|
3316
3316
|
|
|
3317
3317
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
3318
3318
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
3319
|
-
max_vlan=199,
|
|
3320
3319
|
min_vlan=100,
|
|
3320
|
+
max_vlan=199,
|
|
3321
3321
|
),
|
|
3322
3322
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
3323
|
-
max_vlan=399,
|
|
3324
3323
|
min_vlan=300,
|
|
3324
|
+
max_vlan=399,
|
|
3325
3325
|
),
|
|
3326
3326
|
])
|
|
3327
3327
|
```
|
|
@@ -3704,12 +3704,12 @@ class DistributedVirtualSwitch(pulumi.CustomResource):
|
|
|
3704
3704
|
|
|
3705
3705
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
3706
3706
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
3707
|
-
max_vlan=199,
|
|
3708
3707
|
min_vlan=100,
|
|
3708
|
+
max_vlan=199,
|
|
3709
3709
|
),
|
|
3710
3710
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
3711
|
-
max_vlan=399,
|
|
3712
3711
|
min_vlan=300,
|
|
3712
|
+
max_vlan=399,
|
|
3713
3713
|
),
|
|
3714
3714
|
])
|
|
3715
3715
|
```
|
|
@@ -4230,12 +4230,12 @@ class DistributedVirtualSwitch(pulumi.CustomResource):
|
|
|
4230
4230
|
|
|
4231
4231
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
4232
4232
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
4233
|
-
max_vlan=199,
|
|
4234
4233
|
min_vlan=100,
|
|
4234
|
+
max_vlan=199,
|
|
4235
4235
|
),
|
|
4236
4236
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
4237
|
-
max_vlan=399,
|
|
4238
4237
|
min_vlan=300,
|
|
4238
|
+
max_vlan=399,
|
|
4239
4239
|
),
|
|
4240
4240
|
])
|
|
4241
4241
|
```
|
|
@@ -5128,12 +5128,12 @@ class DistributedVirtualSwitch(pulumi.CustomResource):
|
|
|
5128
5128
|
|
|
5129
5129
|
vds = vsphere.DistributedVirtualSwitch("vds", vlan_ranges=[
|
|
5130
5130
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
5131
|
-
max_vlan=199,
|
|
5132
5131
|
min_vlan=100,
|
|
5132
|
+
max_vlan=199,
|
|
5133
5133
|
),
|
|
5134
5134
|
vsphere.DistributedVirtualSwitchVlanRangeArgs(
|
|
5135
|
-
max_vlan=399,
|
|
5136
5135
|
min_vlan=300,
|
|
5136
|
+
max_vlan=399,
|
|
5137
5137
|
),
|
|
5138
5138
|
])
|
|
5139
5139
|
```
|
pulumi_vsphere/file.py
CHANGED
|
@@ -303,12 +303,12 @@ class File(pulumi.CustomResource):
|
|
|
303
303
|
import pulumi
|
|
304
304
|
import pulumi_vsphere as vsphere
|
|
305
305
|
|
|
306
|
-
ubuntu_vmdk_upload = vsphere.File("
|
|
307
|
-
create_directories=True,
|
|
306
|
+
ubuntu_vmdk_upload = vsphere.File("ubuntu_vmdk_upload",
|
|
308
307
|
datacenter="dc-01",
|
|
309
308
|
datastore="datastore-01",
|
|
309
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
310
310
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
311
|
-
|
|
311
|
+
create_directories=True)
|
|
312
312
|
```
|
|
313
313
|
<!--End PulumiCodeChooser -->
|
|
314
314
|
|
|
@@ -319,14 +319,14 @@ class File(pulumi.CustomResource):
|
|
|
319
319
|
import pulumi
|
|
320
320
|
import pulumi_vsphere as vsphere
|
|
321
321
|
|
|
322
|
-
ubuntu_copy = vsphere.File("
|
|
323
|
-
|
|
322
|
+
ubuntu_copy = vsphere.File("ubuntu_copy",
|
|
323
|
+
source_datacenter="dc-01",
|
|
324
324
|
datacenter="dc-01",
|
|
325
|
+
source_datastore="datastore-01",
|
|
325
326
|
datastore="datastore-01",
|
|
327
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
326
328
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
327
|
-
|
|
328
|
-
source_datastore="datastore-01",
|
|
329
|
-
source_file="/my/src/path/custom_ubuntu.vmdk")
|
|
329
|
+
create_directories=True)
|
|
330
330
|
```
|
|
331
331
|
<!--End PulumiCodeChooser -->
|
|
332
332
|
|
|
@@ -365,12 +365,12 @@ class File(pulumi.CustomResource):
|
|
|
365
365
|
import pulumi
|
|
366
366
|
import pulumi_vsphere as vsphere
|
|
367
367
|
|
|
368
|
-
ubuntu_vmdk_upload = vsphere.File("
|
|
369
|
-
create_directories=True,
|
|
368
|
+
ubuntu_vmdk_upload = vsphere.File("ubuntu_vmdk_upload",
|
|
370
369
|
datacenter="dc-01",
|
|
371
370
|
datastore="datastore-01",
|
|
371
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
372
372
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
373
|
-
|
|
373
|
+
create_directories=True)
|
|
374
374
|
```
|
|
375
375
|
<!--End PulumiCodeChooser -->
|
|
376
376
|
|
|
@@ -381,14 +381,14 @@ class File(pulumi.CustomResource):
|
|
|
381
381
|
import pulumi
|
|
382
382
|
import pulumi_vsphere as vsphere
|
|
383
383
|
|
|
384
|
-
ubuntu_copy = vsphere.File("
|
|
385
|
-
|
|
384
|
+
ubuntu_copy = vsphere.File("ubuntu_copy",
|
|
385
|
+
source_datacenter="dc-01",
|
|
386
386
|
datacenter="dc-01",
|
|
387
|
+
source_datastore="datastore-01",
|
|
387
388
|
datastore="datastore-01",
|
|
389
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
388
390
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
389
|
-
|
|
390
|
-
source_datastore="datastore-01",
|
|
391
|
-
source_file="/my/src/path/custom_ubuntu.vmdk")
|
|
391
|
+
create_directories=True)
|
|
392
392
|
```
|
|
393
393
|
<!--End PulumiCodeChooser -->
|
|
394
394
|
|
|
@@ -90,13 +90,14 @@ def get_compute_cluster_host_group(compute_cluster_id: Optional[str] = None,
|
|
|
90
90
|
import pulumi
|
|
91
91
|
import pulumi_vsphere as vsphere
|
|
92
92
|
|
|
93
|
-
datacenter = vsphere.get_datacenter(name=
|
|
94
|
-
cluster = vsphere.get_compute_cluster(name=
|
|
93
|
+
datacenter = vsphere.get_datacenter(name=vsphere_datacenter)
|
|
94
|
+
cluster = vsphere.get_compute_cluster(name=vsphere_cluster,
|
|
95
95
|
datacenter_id=datacenter.id)
|
|
96
96
|
host_group1 = vsphere.get_compute_cluster_host_group(name="host_group1",
|
|
97
97
|
compute_cluster_id=cluster.id)
|
|
98
|
-
host_rule1 = vsphere.ComputeClusterVmHostRule("
|
|
98
|
+
host_rule1 = vsphere.ComputeClusterVmHostRule("host_rule1",
|
|
99
99
|
compute_cluster_id=cluster.id,
|
|
100
|
+
name="terraform-host-rule1",
|
|
100
101
|
vm_group_name="vm_group1",
|
|
101
102
|
affinity_host_group_name=host_group1.name)
|
|
102
103
|
```
|
|
@@ -138,13 +139,14 @@ def get_compute_cluster_host_group_output(compute_cluster_id: Optional[pulumi.In
|
|
|
138
139
|
import pulumi
|
|
139
140
|
import pulumi_vsphere as vsphere
|
|
140
141
|
|
|
141
|
-
datacenter = vsphere.get_datacenter(name=
|
|
142
|
-
cluster = vsphere.get_compute_cluster(name=
|
|
142
|
+
datacenter = vsphere.get_datacenter(name=vsphere_datacenter)
|
|
143
|
+
cluster = vsphere.get_compute_cluster(name=vsphere_cluster,
|
|
143
144
|
datacenter_id=datacenter.id)
|
|
144
145
|
host_group1 = vsphere.get_compute_cluster_host_group(name="host_group1",
|
|
145
146
|
compute_cluster_id=cluster.id)
|
|
146
|
-
host_rule1 = vsphere.ComputeClusterVmHostRule("
|
|
147
|
+
host_rule1 = vsphere.ComputeClusterVmHostRule("host_rule1",
|
|
147
148
|
compute_cluster_id=cluster.id,
|
|
149
|
+
name="terraform-host-rule1",
|
|
148
150
|
vm_group_name="vm_group1",
|
|
149
151
|
affinity_host_group_name=host_group1.name)
|
|
150
152
|
```
|
|
@@ -115,8 +115,8 @@ def get_datastore_stats(capacity: Optional[Mapping[str, Any]] = None,
|
|
|
115
115
|
```python
|
|
116
116
|
import pulumi
|
|
117
117
|
|
|
118
|
-
pulumi.export("maxFreeSpaceName",
|
|
119
|
-
pulumi.export("maxFreeSpace",
|
|
118
|
+
pulumi.export("maxFreeSpaceName", their_max_free_space_name)
|
|
119
|
+
pulumi.export("maxFreeSpace", their_max_free_space)
|
|
120
120
|
```
|
|
121
121
|
<!--End PulumiCodeChooser -->
|
|
122
122
|
|
|
@@ -180,8 +180,8 @@ def get_datastore_stats_output(capacity: Optional[pulumi.Input[Optional[Mapping[
|
|
|
180
180
|
```python
|
|
181
181
|
import pulumi
|
|
182
182
|
|
|
183
|
-
pulumi.export("maxFreeSpaceName",
|
|
184
|
-
pulumi.export("maxFreeSpace",
|
|
183
|
+
pulumi.export("maxFreeSpaceName", their_max_free_space_name)
|
|
184
|
+
pulumi.export("maxFreeSpace", their_max_free_space)
|
|
185
185
|
```
|
|
186
186
|
<!--End PulumiCodeChooser -->
|
|
187
187
|
|
|
@@ -106,6 +106,7 @@ def get_distributed_virtual_switch(datacenter_id: Optional[str] = None,
|
|
|
106
106
|
vds = vsphere.get_distributed_virtual_switch(name="vds-01",
|
|
107
107
|
datacenter_id=datacenter.id)
|
|
108
108
|
dvpg = vsphere.DistributedPortGroup("dvpg",
|
|
109
|
+
name="dvpg-01",
|
|
109
110
|
distributed_virtual_switch_uuid=vds.id,
|
|
110
111
|
active_uplinks=[vds.uplinks[0]],
|
|
111
112
|
standby_uplinks=[vds.uplinks[1]])
|
|
@@ -162,6 +163,7 @@ def get_distributed_virtual_switch_output(datacenter_id: Optional[pulumi.Input[O
|
|
|
162
163
|
vds = vsphere.get_distributed_virtual_switch(name="vds-01",
|
|
163
164
|
datacenter_id=datacenter.id)
|
|
164
165
|
dvpg = vsphere.DistributedPortGroup("dvpg",
|
|
166
|
+
name="dvpg-01",
|
|
165
167
|
distributed_virtual_switch_uuid=vds.id,
|
|
166
168
|
active_uplinks=[vds.uplinks[0]],
|
|
167
169
|
standby_uplinks=[vds.uplinks[1]])
|
pulumi_vsphere/get_dynamic.py
CHANGED
|
@@ -91,9 +91,9 @@ def get_dynamic(filters: Optional[Sequence[str]] = None,
|
|
|
91
91
|
|
|
92
92
|
category = vsphere.get_tag_category(name="SomeCategory")
|
|
93
93
|
tag1 = vsphere.get_tag(name="FirstTag",
|
|
94
|
-
category_id=
|
|
94
|
+
category_id=cat["id"])
|
|
95
95
|
tag2 = vsphere.get_tag(name="SecondTag",
|
|
96
|
-
category_id=
|
|
96
|
+
category_id=cat["id"])
|
|
97
97
|
dyn = vsphere.get_dynamic(filters=[
|
|
98
98
|
tag1.id,
|
|
99
99
|
tag1.id,
|
|
@@ -147,9 +147,9 @@ def get_dynamic_output(filters: Optional[pulumi.Input[Sequence[str]]] = None,
|
|
|
147
147
|
|
|
148
148
|
category = vsphere.get_tag_category(name="SomeCategory")
|
|
149
149
|
tag1 = vsphere.get_tag(name="FirstTag",
|
|
150
|
-
category_id=
|
|
150
|
+
category_id=cat["id"])
|
|
151
151
|
tag2 = vsphere.get_tag(name="SecondTag",
|
|
152
|
-
category_id=
|
|
152
|
+
category_id=cat["id"])
|
|
153
153
|
dyn = vsphere.get_dynamic(filters=[
|
|
154
154
|
tag1.id,
|
|
155
155
|
tag1.id,
|
|
@@ -100,7 +100,7 @@ def get_resource_pool(datacenter_id: Optional[str] = None,
|
|
|
100
100
|
import pulumi_vsphere as vsphere
|
|
101
101
|
|
|
102
102
|
pool = vsphere.get_resource_pool(name="esxi-01.example.com/Resources",
|
|
103
|
-
datacenter_id=
|
|
103
|
+
datacenter_id=datacenter["id"])
|
|
104
104
|
```
|
|
105
105
|
<!--End PulumiCodeChooser -->
|
|
106
106
|
|
|
@@ -172,7 +172,7 @@ def get_resource_pool_output(datacenter_id: Optional[pulumi.Input[Optional[str]]
|
|
|
172
172
|
import pulumi_vsphere as vsphere
|
|
173
173
|
|
|
174
174
|
pool = vsphere.get_resource_pool(name="esxi-01.example.com/Resources",
|
|
175
|
-
datacenter_id=
|
|
175
|
+
datacenter_id=datacenter["id"])
|
|
176
176
|
```
|
|
177
177
|
<!--End PulumiCodeChooser -->
|
|
178
178
|
|
|
@@ -202,6 +202,33 @@ class GuestOsCustomization(pulumi.CustomResource):
|
|
|
202
202
|
|
|
203
203
|
> **NOTE:** The name attribute is unique identifier for the guest OS spec per VC.
|
|
204
204
|
|
|
205
|
+
## Example Usage
|
|
206
|
+
|
|
207
|
+
<!--Start PulumiCodeChooser -->
|
|
208
|
+
```python
|
|
209
|
+
import pulumi
|
|
210
|
+
import pulumi_vsphere as vsphere
|
|
211
|
+
|
|
212
|
+
windows_customization = vsphere.GuestOsCustomization("windows_customization",
|
|
213
|
+
name="windows-spec",
|
|
214
|
+
type="Windows",
|
|
215
|
+
spec=vsphere.GuestOsCustomizationSpecArgs(
|
|
216
|
+
windows_options=vsphere.GuestOsCustomizationSpecWindowsOptionsArgs(
|
|
217
|
+
run_once_command_lists=[
|
|
218
|
+
"command-1",
|
|
219
|
+
"command-2",
|
|
220
|
+
],
|
|
221
|
+
computer_name="windows",
|
|
222
|
+
auto_logon=False,
|
|
223
|
+
auto_logon_count=0,
|
|
224
|
+
admin_password="VMware1!",
|
|
225
|
+
time_zone=4,
|
|
226
|
+
workgroup="workgroup",
|
|
227
|
+
),
|
|
228
|
+
))
|
|
229
|
+
```
|
|
230
|
+
<!--End PulumiCodeChooser -->
|
|
231
|
+
|
|
205
232
|
:param str resource_name: The name of the resource.
|
|
206
233
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
207
234
|
:param pulumi.Input[str] description: The description for the customization specification.
|
|
@@ -220,6 +247,33 @@ class GuestOsCustomization(pulumi.CustomResource):
|
|
|
220
247
|
|
|
221
248
|
> **NOTE:** The name attribute is unique identifier for the guest OS spec per VC.
|
|
222
249
|
|
|
250
|
+
## Example Usage
|
|
251
|
+
|
|
252
|
+
<!--Start PulumiCodeChooser -->
|
|
253
|
+
```python
|
|
254
|
+
import pulumi
|
|
255
|
+
import pulumi_vsphere as vsphere
|
|
256
|
+
|
|
257
|
+
windows_customization = vsphere.GuestOsCustomization("windows_customization",
|
|
258
|
+
name="windows-spec",
|
|
259
|
+
type="Windows",
|
|
260
|
+
spec=vsphere.GuestOsCustomizationSpecArgs(
|
|
261
|
+
windows_options=vsphere.GuestOsCustomizationSpecWindowsOptionsArgs(
|
|
262
|
+
run_once_command_lists=[
|
|
263
|
+
"command-1",
|
|
264
|
+
"command-2",
|
|
265
|
+
],
|
|
266
|
+
computer_name="windows",
|
|
267
|
+
auto_logon=False,
|
|
268
|
+
auto_logon_count=0,
|
|
269
|
+
admin_password="VMware1!",
|
|
270
|
+
time_zone=4,
|
|
271
|
+
workgroup="workgroup",
|
|
272
|
+
),
|
|
273
|
+
))
|
|
274
|
+
```
|
|
275
|
+
<!--End PulumiCodeChooser -->
|
|
276
|
+
|
|
223
277
|
:param str resource_name: The name of the resource.
|
|
224
278
|
:param GuestOsCustomizationArgs args: The arguments to use to populate this resource's properties.
|
|
225
279
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
@@ -704,7 +704,8 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
704
704
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
705
705
|
host = vsphere.get_host(name="esxi-01.example.com",
|
|
706
706
|
datacenter_id=datacenter.id)
|
|
707
|
-
host_virtual_switch = vsphere.HostVirtualSwitch("
|
|
707
|
+
host_virtual_switch = vsphere.HostVirtualSwitch("host_virtual_switch",
|
|
708
|
+
name="switch-01",
|
|
708
709
|
host_system_id=host.id,
|
|
709
710
|
network_adapters=[
|
|
710
711
|
"vmnic0",
|
|
@@ -713,6 +714,7 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
713
714
|
active_nics=["vmnic0"],
|
|
714
715
|
standby_nics=["vmnic1"])
|
|
715
716
|
pg = vsphere.HostPortGroup("pg",
|
|
717
|
+
name="portgroup-01",
|
|
716
718
|
host_system_id=host.id,
|
|
717
719
|
virtual_switch_name=host_virtual_switch.name)
|
|
718
720
|
```
|
|
@@ -734,7 +736,8 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
734
736
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
735
737
|
host = vsphere.get_host(name="esxi-01.example.com",
|
|
736
738
|
datacenter_id=datacenter.id)
|
|
737
|
-
host_virtual_switch = vsphere.HostVirtualSwitch("
|
|
739
|
+
host_virtual_switch = vsphere.HostVirtualSwitch("host_virtual_switch",
|
|
740
|
+
name="switch-01",
|
|
738
741
|
host_system_id=host.id,
|
|
739
742
|
network_adapters=[
|
|
740
743
|
"vmnic0",
|
|
@@ -743,6 +746,7 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
743
746
|
active_nics=["vmnic0"],
|
|
744
747
|
standby_nics=["vmnic1"])
|
|
745
748
|
pg = vsphere.HostPortGroup("pg",
|
|
749
|
+
name="portgroup-01",
|
|
746
750
|
host_system_id=host.id,
|
|
747
751
|
virtual_switch_name=host_virtual_switch.name,
|
|
748
752
|
vlan_id=4095,
|
|
@@ -814,7 +818,8 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
814
818
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
815
819
|
host = vsphere.get_host(name="esxi-01.example.com",
|
|
816
820
|
datacenter_id=datacenter.id)
|
|
817
|
-
host_virtual_switch = vsphere.HostVirtualSwitch("
|
|
821
|
+
host_virtual_switch = vsphere.HostVirtualSwitch("host_virtual_switch",
|
|
822
|
+
name="switch-01",
|
|
818
823
|
host_system_id=host.id,
|
|
819
824
|
network_adapters=[
|
|
820
825
|
"vmnic0",
|
|
@@ -823,6 +828,7 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
823
828
|
active_nics=["vmnic0"],
|
|
824
829
|
standby_nics=["vmnic1"])
|
|
825
830
|
pg = vsphere.HostPortGroup("pg",
|
|
831
|
+
name="portgroup-01",
|
|
826
832
|
host_system_id=host.id,
|
|
827
833
|
virtual_switch_name=host_virtual_switch.name)
|
|
828
834
|
```
|
|
@@ -844,7 +850,8 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
844
850
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
845
851
|
host = vsphere.get_host(name="esxi-01.example.com",
|
|
846
852
|
datacenter_id=datacenter.id)
|
|
847
|
-
host_virtual_switch = vsphere.HostVirtualSwitch("
|
|
853
|
+
host_virtual_switch = vsphere.HostVirtualSwitch("host_virtual_switch",
|
|
854
|
+
name="switch-01",
|
|
848
855
|
host_system_id=host.id,
|
|
849
856
|
network_adapters=[
|
|
850
857
|
"vmnic0",
|
|
@@ -853,6 +860,7 @@ class HostPortGroup(pulumi.CustomResource):
|
|
|
853
860
|
active_nics=["vmnic0"],
|
|
854
861
|
standby_nics=["vmnic1"])
|
|
855
862
|
pg = vsphere.HostPortGroup("pg",
|
|
863
|
+
name="portgroup-01",
|
|
856
864
|
host_system_id=host.id,
|
|
857
865
|
virtual_switch_name=host_virtual_switch.name,
|
|
858
866
|
vlan_id=4095,
|