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/license.py
CHANGED
|
@@ -165,22 +165,6 @@ class License(pulumi.CustomResource):
|
|
|
165
165
|
"""
|
|
166
166
|
Provides a VMware vSphere license resource. This can be used to add and remove license keys.
|
|
167
167
|
|
|
168
|
-
## Example Usage
|
|
169
|
-
|
|
170
|
-
<!--Start PulumiCodeChooser -->
|
|
171
|
-
```python
|
|
172
|
-
import pulumi
|
|
173
|
-
import pulumi_vsphere as vsphere
|
|
174
|
-
|
|
175
|
-
license_key = vsphere.License("licenseKey",
|
|
176
|
-
labels={
|
|
177
|
-
"VpxClientLicenseLabel": "Hello World",
|
|
178
|
-
"Workflow": "Hello World",
|
|
179
|
-
},
|
|
180
|
-
license_key="452CQ-2EK54-K8742-00000-00000")
|
|
181
|
-
```
|
|
182
|
-
<!--End PulumiCodeChooser -->
|
|
183
|
-
|
|
184
168
|
:param str resource_name: The name of the resource.
|
|
185
169
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
186
170
|
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: A map of key/value pairs to be attached as labels (tags) to the license key.
|
|
@@ -195,22 +179,6 @@ class License(pulumi.CustomResource):
|
|
|
195
179
|
"""
|
|
196
180
|
Provides a VMware vSphere license resource. This can be used to add and remove license keys.
|
|
197
181
|
|
|
198
|
-
## Example Usage
|
|
199
|
-
|
|
200
|
-
<!--Start PulumiCodeChooser -->
|
|
201
|
-
```python
|
|
202
|
-
import pulumi
|
|
203
|
-
import pulumi_vsphere as vsphere
|
|
204
|
-
|
|
205
|
-
license_key = vsphere.License("licenseKey",
|
|
206
|
-
labels={
|
|
207
|
-
"VpxClientLicenseLabel": "Hello World",
|
|
208
|
-
"Workflow": "Hello World",
|
|
209
|
-
},
|
|
210
|
-
license_key="452CQ-2EK54-K8742-00000-00000")
|
|
211
|
-
```
|
|
212
|
-
<!--End PulumiCodeChooser -->
|
|
213
|
-
|
|
214
182
|
:param str resource_name: The name of the resource.
|
|
215
183
|
:param LicenseArgs args: The arguments to use to populate this resource's properties.
|
|
216
184
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
pulumi_vsphere/outputs.py
CHANGED
|
@@ -212,9 +212,10 @@ class ComputeClusterVsanStretchedCluster(dict):
|
|
|
212
212
|
import pulumi
|
|
213
213
|
import pulumi_vsphere as vsphere
|
|
214
214
|
|
|
215
|
-
compute_cluster = vsphere.ComputeCluster("
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
216
|
+
name="terraform-compute-cluster-test",
|
|
217
|
+
datacenter_id=datacenter["id"],
|
|
218
|
+
host_system_ids=[[__item["id"] for __item in host]],
|
|
218
219
|
drs_enabled=True,
|
|
219
220
|
drs_automation_level="fullyAutomated",
|
|
220
221
|
ha_enabled=False,
|
|
@@ -229,25 +230,25 @@ class ComputeClusterVsanStretchedCluster(dict):
|
|
|
229
230
|
vsan_dit_encryption_enabled=True,
|
|
230
231
|
vsan_dit_rekey_interval=1800,
|
|
231
232
|
vsan_disk_groups=[vsphere.ComputeClusterVsanDiskGroupArgs(
|
|
232
|
-
cache=
|
|
233
|
-
storages=
|
|
233
|
+
cache=cache_disks[0],
|
|
234
|
+
storages=storage_disks,
|
|
234
235
|
)],
|
|
235
236
|
vsan_fault_domains=[vsphere.ComputeClusterVsanFaultDomainArgs(
|
|
236
237
|
fault_domains=[
|
|
237
238
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
238
239
|
name="fd1",
|
|
239
|
-
host_ids=[[__item["id"] for __item in
|
|
240
|
+
host_ids=[[__item["id"] for __item in faultdomain1_hosts]],
|
|
240
241
|
),
|
|
241
242
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
242
243
|
name="fd2",
|
|
243
|
-
host_ids=[[__item["id"] for __item in
|
|
244
|
+
host_ids=[[__item["id"] for __item in faultdomain2_hosts]],
|
|
244
245
|
),
|
|
245
246
|
],
|
|
246
247
|
)],
|
|
247
248
|
vsan_stretched_cluster=vsphere.ComputeClusterVsanStretchedClusterArgs(
|
|
248
|
-
preferred_fault_domain_host_ids=[[__item["id"] for __item in
|
|
249
|
-
secondary_fault_domain_host_ids=[[__item["id"] for __item in
|
|
250
|
-
witness_node=
|
|
249
|
+
preferred_fault_domain_host_ids=[[__item["id"] for __item in preferred_fault_domain_host]],
|
|
250
|
+
secondary_fault_domain_host_ids=[[__item["id"] for __item in secondary_fault_domain_host]],
|
|
251
|
+
witness_node=witness_host["id"],
|
|
251
252
|
))
|
|
252
253
|
```
|
|
253
254
|
<!--End PulumiCodeChooser -->
|
|
@@ -306,9 +307,10 @@ class ComputeClusterVsanStretchedCluster(dict):
|
|
|
306
307
|
import pulumi
|
|
307
308
|
import pulumi_vsphere as vsphere
|
|
308
309
|
|
|
309
|
-
compute_cluster = vsphere.ComputeCluster("
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
311
|
+
name="terraform-compute-cluster-test",
|
|
312
|
+
datacenter_id=datacenter["id"],
|
|
313
|
+
host_system_ids=[[__item["id"] for __item in host]],
|
|
312
314
|
drs_enabled=True,
|
|
313
315
|
drs_automation_level="fullyAutomated",
|
|
314
316
|
ha_enabled=False,
|
|
@@ -323,25 +325,25 @@ class ComputeClusterVsanStretchedCluster(dict):
|
|
|
323
325
|
vsan_dit_encryption_enabled=True,
|
|
324
326
|
vsan_dit_rekey_interval=1800,
|
|
325
327
|
vsan_disk_groups=[vsphere.ComputeClusterVsanDiskGroupArgs(
|
|
326
|
-
cache=
|
|
327
|
-
storages=
|
|
328
|
+
cache=cache_disks[0],
|
|
329
|
+
storages=storage_disks,
|
|
328
330
|
)],
|
|
329
331
|
vsan_fault_domains=[vsphere.ComputeClusterVsanFaultDomainArgs(
|
|
330
332
|
fault_domains=[
|
|
331
333
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
332
334
|
name="fd1",
|
|
333
|
-
host_ids=[[__item["id"] for __item in
|
|
335
|
+
host_ids=[[__item["id"] for __item in faultdomain1_hosts]],
|
|
334
336
|
),
|
|
335
337
|
vsphere.ComputeClusterVsanFaultDomainFaultDomainArgs(
|
|
336
338
|
name="fd2",
|
|
337
|
-
host_ids=[[__item["id"] for __item in
|
|
339
|
+
host_ids=[[__item["id"] for __item in faultdomain2_hosts]],
|
|
338
340
|
),
|
|
339
341
|
],
|
|
340
342
|
)],
|
|
341
343
|
vsan_stretched_cluster=vsphere.ComputeClusterVsanStretchedClusterArgs(
|
|
342
|
-
preferred_fault_domain_host_ids=[[__item["id"] for __item in
|
|
343
|
-
secondary_fault_domain_host_ids=[[__item["id"] for __item in
|
|
344
|
-
witness_node=
|
|
344
|
+
preferred_fault_domain_host_ids=[[__item["id"] for __item in preferred_fault_domain_host]],
|
|
345
|
+
secondary_fault_domain_host_ids=[[__item["id"] for __item in secondary_fault_domain_host]],
|
|
346
|
+
witness_node=witness_host["id"],
|
|
345
347
|
))
|
|
346
348
|
```
|
|
347
349
|
<!--End PulumiCodeChooser -->
|
pulumi_vsphere/resource_pool.py
CHANGED
|
@@ -665,7 +665,9 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
665
665
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
666
666
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
667
667
|
datacenter_id=datacenter.id)
|
|
668
|
-
resource_pool = vsphere.ResourcePool("
|
|
668
|
+
resource_pool = vsphere.ResourcePool("resource_pool",
|
|
669
|
+
name="resource-pool-01",
|
|
670
|
+
parent_resource_pool_id=compute_cluster.resource_pool_id)
|
|
669
671
|
```
|
|
670
672
|
<!--End PulumiCodeChooser -->
|
|
671
673
|
|
|
@@ -677,8 +679,7 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
677
679
|
import pulumi
|
|
678
680
|
import pulumi_vsphere as vsphere
|
|
679
681
|
|
|
680
|
-
vm = vsphere.VirtualMachine("vm", resource_pool_id=
|
|
681
|
-
# ... other configuration ...
|
|
682
|
+
vm = vsphere.VirtualMachine("vm", resource_pool_id=cluster["resourcePoolId"])
|
|
682
683
|
```
|
|
683
684
|
<!--End PulumiCodeChooser -->
|
|
684
685
|
|
|
@@ -694,8 +695,12 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
694
695
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
695
696
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
696
697
|
datacenter_id=datacenter.id)
|
|
697
|
-
resource_pool_parent = vsphere.ResourcePool("
|
|
698
|
-
|
|
698
|
+
resource_pool_parent = vsphere.ResourcePool("resource_pool_parent",
|
|
699
|
+
name="parent",
|
|
700
|
+
parent_resource_pool_id=compute_cluster.resource_pool_id)
|
|
701
|
+
resource_pool_child = vsphere.ResourcePool("resource_pool_child",
|
|
702
|
+
name="child",
|
|
703
|
+
parent_resource_pool_id=resource_pool_parent.id)
|
|
699
704
|
```
|
|
700
705
|
<!--End PulumiCodeChooser -->
|
|
701
706
|
|
|
@@ -788,7 +793,9 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
788
793
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
789
794
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
790
795
|
datacenter_id=datacenter.id)
|
|
791
|
-
resource_pool = vsphere.ResourcePool("
|
|
796
|
+
resource_pool = vsphere.ResourcePool("resource_pool",
|
|
797
|
+
name="resource-pool-01",
|
|
798
|
+
parent_resource_pool_id=compute_cluster.resource_pool_id)
|
|
792
799
|
```
|
|
793
800
|
<!--End PulumiCodeChooser -->
|
|
794
801
|
|
|
@@ -800,8 +807,7 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
800
807
|
import pulumi
|
|
801
808
|
import pulumi_vsphere as vsphere
|
|
802
809
|
|
|
803
|
-
vm = vsphere.VirtualMachine("vm", resource_pool_id=
|
|
804
|
-
# ... other configuration ...
|
|
810
|
+
vm = vsphere.VirtualMachine("vm", resource_pool_id=cluster["resourcePoolId"])
|
|
805
811
|
```
|
|
806
812
|
<!--End PulumiCodeChooser -->
|
|
807
813
|
|
|
@@ -817,8 +823,12 @@ class ResourcePool(pulumi.CustomResource):
|
|
|
817
823
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
818
824
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
819
825
|
datacenter_id=datacenter.id)
|
|
820
|
-
resource_pool_parent = vsphere.ResourcePool("
|
|
821
|
-
|
|
826
|
+
resource_pool_parent = vsphere.ResourcePool("resource_pool_parent",
|
|
827
|
+
name="parent",
|
|
828
|
+
parent_resource_pool_id=compute_cluster.resource_pool_id)
|
|
829
|
+
resource_pool_child = vsphere.ResourcePool("resource_pool_child",
|
|
830
|
+
name="child",
|
|
831
|
+
parent_resource_pool_id=resource_pool_parent.id)
|
|
822
832
|
```
|
|
823
833
|
<!--End PulumiCodeChooser -->
|
|
824
834
|
|
|
@@ -314,13 +314,13 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
314
314
|
import pulumi_vsphere as vsphere
|
|
315
315
|
|
|
316
316
|
demo1 = vsphere.VirtualMachineSnapshot("demo1",
|
|
317
|
-
|
|
317
|
+
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9",
|
|
318
|
+
snapshot_name="Snapshot Name",
|
|
318
319
|
description="This is Demo Snapshot",
|
|
319
320
|
memory=True,
|
|
320
321
|
quiesce=True,
|
|
321
322
|
remove_children=False,
|
|
322
|
-
|
|
323
|
-
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9")
|
|
323
|
+
consolidate=True)
|
|
324
324
|
```
|
|
325
325
|
<!--End PulumiCodeChooser -->
|
|
326
326
|
|
|
@@ -377,13 +377,13 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
377
377
|
import pulumi_vsphere as vsphere
|
|
378
378
|
|
|
379
379
|
demo1 = vsphere.VirtualMachineSnapshot("demo1",
|
|
380
|
-
|
|
380
|
+
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9",
|
|
381
|
+
snapshot_name="Snapshot Name",
|
|
381
382
|
description="This is Demo Snapshot",
|
|
382
383
|
memory=True,
|
|
383
384
|
quiesce=True,
|
|
384
385
|
remove_children=False,
|
|
385
|
-
|
|
386
|
-
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9")
|
|
386
|
+
consolidate=True)
|
|
387
387
|
```
|
|
388
388
|
<!--End PulumiCodeChooser -->
|
|
389
389
|
|
|
@@ -152,28 +152,28 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
152
152
|
environment = vsphere.get_tag_category(name="environment")
|
|
153
153
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
154
154
|
replication = vsphere.get_tag_category(name="replication")
|
|
155
|
-
production = vsphere.get_tag(
|
|
156
|
-
|
|
157
|
-
development = vsphere.get_tag(
|
|
158
|
-
|
|
159
|
-
platinum = vsphere.get_tag(
|
|
160
|
-
|
|
161
|
-
gold = vsphere.get_tag(
|
|
162
|
-
|
|
163
|
-
silver = vsphere.get_tag(
|
|
164
|
-
|
|
165
|
-
bronze = vsphere.get_tag(
|
|
166
|
-
|
|
167
|
-
replicated = vsphere.get_tag(
|
|
168
|
-
|
|
169
|
-
non_replicated = vsphere.get_tag(
|
|
170
|
-
|
|
171
|
-
prod_datastore = vsphere.VmfsDatastore("
|
|
155
|
+
production = vsphere.get_tag(name="production",
|
|
156
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
157
|
+
development = vsphere.get_tag(name="development",
|
|
158
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
159
|
+
platinum = vsphere.get_tag(name="platinum",
|
|
160
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
161
|
+
gold = vsphere.get_tag(name="platinum",
|
|
162
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
163
|
+
silver = vsphere.get_tag(name="silver",
|
|
164
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
165
|
+
bronze = vsphere.get_tag(name="bronze",
|
|
166
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
167
|
+
replicated = vsphere.get_tag(name="replicated",
|
|
168
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
169
|
+
non_replicated = vsphere.get_tag(name="non_replicated",
|
|
170
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
171
|
+
prod_datastore = vsphere.VmfsDatastore("prod_datastore", tags=[
|
|
172
172
|
"data.vsphere_tag.production.id",
|
|
173
173
|
"data.vsphere_tag.platinum.id",
|
|
174
174
|
"data.vsphere_tag.replicated.id",
|
|
175
175
|
])
|
|
176
|
-
dev_datastore = vsphere.NasDatastore("
|
|
176
|
+
dev_datastore = vsphere.NasDatastore("dev_datastore", tags=[
|
|
177
177
|
"data.vsphere_tag.development.id",
|
|
178
178
|
"data.vsphere_tag.silver.id",
|
|
179
179
|
"data.vsphere_tag.non_replicated.id",
|
|
@@ -188,41 +188,43 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
188
188
|
import pulumi
|
|
189
189
|
import pulumi_vsphere as vsphere
|
|
190
190
|
|
|
191
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
191
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prod_platinum_replicated",
|
|
192
|
+
name="prod_platinum_replicated",
|
|
192
193
|
description="prod_platinum_replicated",
|
|
193
194
|
tag_rules=[
|
|
194
195
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
195
|
-
tag_category=
|
|
196
|
-
tags=[
|
|
196
|
+
tag_category=environment["name"],
|
|
197
|
+
tags=[production["name"]],
|
|
197
198
|
include_datastores_with_tags=True,
|
|
198
199
|
),
|
|
199
200
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
200
|
-
tag_category=
|
|
201
|
-
tags=[
|
|
201
|
+
tag_category=service_level["name"],
|
|
202
|
+
tags=[platinum["name"]],
|
|
202
203
|
include_datastores_with_tags=True,
|
|
203
204
|
),
|
|
204
205
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
205
|
-
tag_category=
|
|
206
|
-
tags=[
|
|
206
|
+
tag_category=replication["name"],
|
|
207
|
+
tags=[replicated["name"]],
|
|
207
208
|
include_datastores_with_tags=True,
|
|
208
209
|
),
|
|
209
210
|
])
|
|
210
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
211
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("dev_silver_nonreplicated",
|
|
212
|
+
name="dev_silver_nonreplicated",
|
|
211
213
|
description="dev_silver_nonreplicated",
|
|
212
214
|
tag_rules=[
|
|
213
215
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
214
|
-
tag_category=
|
|
215
|
-
tags=[
|
|
216
|
+
tag_category=environment["name"],
|
|
217
|
+
tags=[development["name"]],
|
|
216
218
|
include_datastores_with_tags=True,
|
|
217
219
|
),
|
|
218
220
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
219
|
-
tag_category=
|
|
220
|
-
tags=[
|
|
221
|
+
tag_category=service_level["name"],
|
|
222
|
+
tags=[silver["name"]],
|
|
221
223
|
include_datastores_with_tags=True,
|
|
222
224
|
),
|
|
223
225
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
224
|
-
tag_category=
|
|
225
|
-
tags=[
|
|
226
|
+
tag_category=replication["name"],
|
|
227
|
+
tags=[non_replicated["name"]],
|
|
226
228
|
include_datastores_with_tags=True,
|
|
227
229
|
),
|
|
228
230
|
])
|
|
@@ -238,10 +240,8 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
238
240
|
|
|
239
241
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
240
242
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
241
|
-
prod_vm = vsphere.VirtualMachine("
|
|
242
|
-
|
|
243
|
-
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
244
|
-
# ... other configuration ...
|
|
243
|
+
prod_vm = vsphere.VirtualMachine("prod_vm", storage_policy_id=storage_policy["prodPlatinumReplicated"]["id"])
|
|
244
|
+
dev_vm = vsphere.VirtualMachine("dev_vm", storage_policy_id=storage_policy["devSilverNonreplicated"]["id"])
|
|
245
245
|
```
|
|
246
246
|
<!--End PulumiCodeChooser -->
|
|
247
247
|
|
|
@@ -276,28 +276,28 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
276
276
|
environment = vsphere.get_tag_category(name="environment")
|
|
277
277
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
278
278
|
replication = vsphere.get_tag_category(name="replication")
|
|
279
|
-
production = vsphere.get_tag(
|
|
280
|
-
|
|
281
|
-
development = vsphere.get_tag(
|
|
282
|
-
|
|
283
|
-
platinum = vsphere.get_tag(
|
|
284
|
-
|
|
285
|
-
gold = vsphere.get_tag(
|
|
286
|
-
|
|
287
|
-
silver = vsphere.get_tag(
|
|
288
|
-
|
|
289
|
-
bronze = vsphere.get_tag(
|
|
290
|
-
|
|
291
|
-
replicated = vsphere.get_tag(
|
|
292
|
-
|
|
293
|
-
non_replicated = vsphere.get_tag(
|
|
294
|
-
|
|
295
|
-
prod_datastore = vsphere.VmfsDatastore("
|
|
279
|
+
production = vsphere.get_tag(name="production",
|
|
280
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
281
|
+
development = vsphere.get_tag(name="development",
|
|
282
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
283
|
+
platinum = vsphere.get_tag(name="platinum",
|
|
284
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
285
|
+
gold = vsphere.get_tag(name="platinum",
|
|
286
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
287
|
+
silver = vsphere.get_tag(name="silver",
|
|
288
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
289
|
+
bronze = vsphere.get_tag(name="bronze",
|
|
290
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
291
|
+
replicated = vsphere.get_tag(name="replicated",
|
|
292
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
293
|
+
non_replicated = vsphere.get_tag(name="non_replicated",
|
|
294
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
295
|
+
prod_datastore = vsphere.VmfsDatastore("prod_datastore", tags=[
|
|
296
296
|
"data.vsphere_tag.production.id",
|
|
297
297
|
"data.vsphere_tag.platinum.id",
|
|
298
298
|
"data.vsphere_tag.replicated.id",
|
|
299
299
|
])
|
|
300
|
-
dev_datastore = vsphere.NasDatastore("
|
|
300
|
+
dev_datastore = vsphere.NasDatastore("dev_datastore", tags=[
|
|
301
301
|
"data.vsphere_tag.development.id",
|
|
302
302
|
"data.vsphere_tag.silver.id",
|
|
303
303
|
"data.vsphere_tag.non_replicated.id",
|
|
@@ -312,41 +312,43 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
312
312
|
import pulumi
|
|
313
313
|
import pulumi_vsphere as vsphere
|
|
314
314
|
|
|
315
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
315
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prod_platinum_replicated",
|
|
316
|
+
name="prod_platinum_replicated",
|
|
316
317
|
description="prod_platinum_replicated",
|
|
317
318
|
tag_rules=[
|
|
318
319
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
319
|
-
tag_category=
|
|
320
|
-
tags=[
|
|
320
|
+
tag_category=environment["name"],
|
|
321
|
+
tags=[production["name"]],
|
|
321
322
|
include_datastores_with_tags=True,
|
|
322
323
|
),
|
|
323
324
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
324
|
-
tag_category=
|
|
325
|
-
tags=[
|
|
325
|
+
tag_category=service_level["name"],
|
|
326
|
+
tags=[platinum["name"]],
|
|
326
327
|
include_datastores_with_tags=True,
|
|
327
328
|
),
|
|
328
329
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
329
|
-
tag_category=
|
|
330
|
-
tags=[
|
|
330
|
+
tag_category=replication["name"],
|
|
331
|
+
tags=[replicated["name"]],
|
|
331
332
|
include_datastores_with_tags=True,
|
|
332
333
|
),
|
|
333
334
|
])
|
|
334
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
335
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("dev_silver_nonreplicated",
|
|
336
|
+
name="dev_silver_nonreplicated",
|
|
335
337
|
description="dev_silver_nonreplicated",
|
|
336
338
|
tag_rules=[
|
|
337
339
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
338
|
-
tag_category=
|
|
339
|
-
tags=[
|
|
340
|
+
tag_category=environment["name"],
|
|
341
|
+
tags=[development["name"]],
|
|
340
342
|
include_datastores_with_tags=True,
|
|
341
343
|
),
|
|
342
344
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
343
|
-
tag_category=
|
|
344
|
-
tags=[
|
|
345
|
+
tag_category=service_level["name"],
|
|
346
|
+
tags=[silver["name"]],
|
|
345
347
|
include_datastores_with_tags=True,
|
|
346
348
|
),
|
|
347
349
|
vsphere.VmStoragePolicyTagRuleArgs(
|
|
348
|
-
tag_category=
|
|
349
|
-
tags=[
|
|
350
|
+
tag_category=replication["name"],
|
|
351
|
+
tags=[non_replicated["name"]],
|
|
350
352
|
include_datastores_with_tags=True,
|
|
351
353
|
),
|
|
352
354
|
])
|
|
@@ -362,10 +364,8 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
362
364
|
|
|
363
365
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
364
366
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
365
|
-
prod_vm = vsphere.VirtualMachine("
|
|
366
|
-
|
|
367
|
-
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
368
|
-
# ... other configuration ...
|
|
367
|
+
prod_vm = vsphere.VirtualMachine("prod_vm", storage_policy_id=storage_policy["prodPlatinumReplicated"]["id"])
|
|
368
|
+
dev_vm = vsphere.VirtualMachine("dev_vm", storage_policy_id=storage_policy["devSilverNonreplicated"]["id"])
|
|
369
369
|
```
|
|
370
370
|
<!--End PulumiCodeChooser -->
|
|
371
371
|
|
pulumi_vsphere/vnic.py
CHANGED
|
@@ -382,12 +382,14 @@ class Vnic(pulumi.CustomResource):
|
|
|
382
382
|
h1 = vsphere.get_host(name="esxi1.host.test",
|
|
383
383
|
datacenter_id=dc.id)
|
|
384
384
|
d1 = vsphere.DistributedVirtualSwitch("d1",
|
|
385
|
+
name="dc_DVPG0",
|
|
385
386
|
datacenter_id=dc.id,
|
|
386
387
|
hosts=[vsphere.DistributedVirtualSwitchHostArgs(
|
|
387
388
|
host_system_id=h1.id,
|
|
388
389
|
devices=["vnic3"],
|
|
389
390
|
)])
|
|
390
391
|
p1 = vsphere.DistributedPortGroup("p1",
|
|
392
|
+
name="test-pg",
|
|
391
393
|
vlan_id=1234,
|
|
392
394
|
distributed_virtual_switch_uuid=d1.id)
|
|
393
395
|
v1 = vsphere.Vnic("v1",
|
|
@@ -412,6 +414,7 @@ class Vnic(pulumi.CustomResource):
|
|
|
412
414
|
h1 = vsphere.get_host(name="esxi1.host.test",
|
|
413
415
|
datacenter_id=dc.id)
|
|
414
416
|
hvs1 = vsphere.HostVirtualSwitch("hvs1",
|
|
417
|
+
name="dc_HPG0",
|
|
415
418
|
host_system_id=h1.id,
|
|
416
419
|
network_adapters=[
|
|
417
420
|
"vmnic3",
|
|
@@ -420,6 +423,7 @@ class Vnic(pulumi.CustomResource):
|
|
|
420
423
|
active_nics=["vmnic3"],
|
|
421
424
|
standby_nics=["vmnic4"])
|
|
422
425
|
p1 = vsphere.HostPortGroup("p1",
|
|
426
|
+
name="my-pg",
|
|
423
427
|
virtual_switch_name=hvs1.name,
|
|
424
428
|
host_system_id=h1.id)
|
|
425
429
|
v1 = vsphere.Vnic("v1",
|
|
@@ -481,12 +485,14 @@ class Vnic(pulumi.CustomResource):
|
|
|
481
485
|
h1 = vsphere.get_host(name="esxi1.host.test",
|
|
482
486
|
datacenter_id=dc.id)
|
|
483
487
|
d1 = vsphere.DistributedVirtualSwitch("d1",
|
|
488
|
+
name="dc_DVPG0",
|
|
484
489
|
datacenter_id=dc.id,
|
|
485
490
|
hosts=[vsphere.DistributedVirtualSwitchHostArgs(
|
|
486
491
|
host_system_id=h1.id,
|
|
487
492
|
devices=["vnic3"],
|
|
488
493
|
)])
|
|
489
494
|
p1 = vsphere.DistributedPortGroup("p1",
|
|
495
|
+
name="test-pg",
|
|
490
496
|
vlan_id=1234,
|
|
491
497
|
distributed_virtual_switch_uuid=d1.id)
|
|
492
498
|
v1 = vsphere.Vnic("v1",
|
|
@@ -511,6 +517,7 @@ class Vnic(pulumi.CustomResource):
|
|
|
511
517
|
h1 = vsphere.get_host(name="esxi1.host.test",
|
|
512
518
|
datacenter_id=dc.id)
|
|
513
519
|
hvs1 = vsphere.HostVirtualSwitch("hvs1",
|
|
520
|
+
name="dc_HPG0",
|
|
514
521
|
host_system_id=h1.id,
|
|
515
522
|
network_adapters=[
|
|
516
523
|
"vmnic3",
|
|
@@ -519,6 +526,7 @@ class Vnic(pulumi.CustomResource):
|
|
|
519
526
|
active_nics=["vmnic3"],
|
|
520
527
|
standby_nics=["vmnic4"])
|
|
521
528
|
p1 = vsphere.HostPortGroup("p1",
|
|
529
|
+
name="my-pg",
|
|
522
530
|
virtual_switch_name=hvs1.name,
|
|
523
531
|
host_system_id=h1.id)
|
|
524
532
|
v1 = vsphere.Vnic("v1",
|