pulumi-vsphere 4.11.0__py3-none-any.whl → 4.11.0a1710920591__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/__init__.py +0 -28
- pulumi_vsphere/_inputs.py +236 -646
- pulumi_vsphere/_utilities.py +4 -40
- pulumi_vsphere/compute_cluster.py +1486 -756
- pulumi_vsphere/compute_cluster_vm_affinity_rule.py +34 -42
- pulumi_vsphere/content_library.py +10 -10
- pulumi_vsphere/datacenter.py +40 -33
- pulumi_vsphere/datastore_cluster.py +364 -154
- pulumi_vsphere/distributed_port_group.py +187 -131
- pulumi_vsphere/distributed_virtual_switch.py +828 -310
- pulumi_vsphere/entity_permissions.py +38 -59
- pulumi_vsphere/file.py +24 -16
- pulumi_vsphere/folder.py +28 -7
- pulumi_vsphere/get_compute_cluster.py +4 -0
- pulumi_vsphere/get_compute_cluster_host_group.py +20 -20
- pulumi_vsphere/get_content_library.py +10 -10
- pulumi_vsphere/get_content_library_item.py +8 -12
- pulumi_vsphere/get_custom_attribute.py +4 -0
- pulumi_vsphere/get_datacenter.py +4 -0
- pulumi_vsphere/get_datastore.py +16 -12
- pulumi_vsphere/get_datastore_cluster.py +4 -0
- pulumi_vsphere/get_datastore_stats.py +52 -46
- pulumi_vsphere/get_distributed_virtual_switch.py +4 -2
- pulumi_vsphere/get_dynamic.py +20 -18
- pulumi_vsphere/get_folder.py +6 -10
- pulumi_vsphere/get_guest_os_customization.py +47 -8
- pulumi_vsphere/get_host.py +4 -0
- pulumi_vsphere/get_host_pci_device.py +14 -8
- pulumi_vsphere/get_host_thumbprint.py +16 -12
- pulumi_vsphere/get_host_vgpu_profile.py +10 -4
- pulumi_vsphere/get_license.py +5 -2
- pulumi_vsphere/get_network.py +18 -14
- pulumi_vsphere/get_policy.py +4 -0
- pulumi_vsphere/get_resource_pool.py +18 -14
- pulumi_vsphere/get_role.py +8 -4
- pulumi_vsphere/get_tag.py +4 -0
- pulumi_vsphere/get_tag_category.py +4 -0
- pulumi_vsphere/get_vapp_container.py +4 -0
- pulumi_vsphere/get_virtual_machine.py +43 -60
- pulumi_vsphere/get_vmfs_disks.py +4 -0
- pulumi_vsphere/guest_os_customization.py +5 -55
- pulumi_vsphere/ha_vm_override.py +378 -189
- pulumi_vsphere/host.py +60 -49
- pulumi_vsphere/host_port_group.py +26 -14
- pulumi_vsphere/host_virtual_switch.py +287 -140
- pulumi_vsphere/license.py +32 -0
- pulumi_vsphere/nas_datastore.py +7 -7
- pulumi_vsphere/outputs.py +270 -672
- pulumi_vsphere/provider.py +6 -2
- pulumi_vsphere/pulumi-plugin.json +1 -2
- pulumi_vsphere/resource_pool.py +24 -50
- pulumi_vsphere/virtual_disk.py +34 -42
- pulumi_vsphere/virtual_machine.py +827 -598
- pulumi_vsphere/virtual_machine_snapshot.py +12 -8
- pulumi_vsphere/vm_storage_policy.py +127 -115
- pulumi_vsphere/vnic.py +105 -89
- {pulumi_vsphere-4.11.0.dist-info → pulumi_vsphere-4.11.0a1710920591.dist-info}/METADATA +1 -1
- pulumi_vsphere-4.11.0a1710920591.dist-info/RECORD +82 -0
- {pulumi_vsphere-4.11.0.dist-info → pulumi_vsphere-4.11.0a1710920591.dist-info}/WHEEL +1 -1
- pulumi_vsphere/get_host_base_images.py +0 -97
- pulumi_vsphere/offline_software_depot.py +0 -180
- pulumi_vsphere/supervisor.py +0 -962
- pulumi_vsphere/virtual_machine_class.py +0 -442
- pulumi_vsphere-4.11.0.dist-info/RECORD +0 -86
- {pulumi_vsphere-4.11.0.dist-info → pulumi_vsphere-4.11.0a1710920591.dist-info}/top_level.txt +0 -0
|
@@ -290,7 +290,7 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
290
290
|
For more information on managing snapshots and how they work in VMware, see
|
|
291
291
|
[here][ext-vm-snapshot-management].
|
|
292
292
|
|
|
293
|
-
[ext-vm-snapshot-management]: https://docs.vmware.com/en/VMware-vSphere/
|
|
293
|
+
[ext-vm-snapshot-management]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-CA948C69-7F58-4519-AEB1-739545EA94E5.html
|
|
294
294
|
|
|
295
295
|
> **NOTE:** A snapshot in VMware differs from traditional disk snapshots, and
|
|
296
296
|
can contain the actual running state of the virtual machine, data for all disks
|
|
@@ -308,19 +308,21 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
308
308
|
|
|
309
309
|
## Example Usage
|
|
310
310
|
|
|
311
|
+
<!--Start PulumiCodeChooser -->
|
|
311
312
|
```python
|
|
312
313
|
import pulumi
|
|
313
314
|
import pulumi_vsphere as vsphere
|
|
314
315
|
|
|
315
316
|
demo1 = vsphere.VirtualMachineSnapshot("demo1",
|
|
316
|
-
|
|
317
|
-
snapshot_name="Snapshot Name",
|
|
317
|
+
consolidate=True,
|
|
318
318
|
description="This is Demo Snapshot",
|
|
319
319
|
memory=True,
|
|
320
320
|
quiesce=True,
|
|
321
321
|
remove_children=False,
|
|
322
|
-
|
|
322
|
+
snapshot_name="Snapshot Name",
|
|
323
|
+
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9")
|
|
323
324
|
```
|
|
325
|
+
<!--End PulumiCodeChooser -->
|
|
324
326
|
|
|
325
327
|
:param str resource_name: The name of the resource.
|
|
326
328
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
@@ -351,7 +353,7 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
351
353
|
For more information on managing snapshots and how they work in VMware, see
|
|
352
354
|
[here][ext-vm-snapshot-management].
|
|
353
355
|
|
|
354
|
-
[ext-vm-snapshot-management]: https://docs.vmware.com/en/VMware-vSphere/
|
|
356
|
+
[ext-vm-snapshot-management]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-CA948C69-7F58-4519-AEB1-739545EA94E5.html
|
|
355
357
|
|
|
356
358
|
> **NOTE:** A snapshot in VMware differs from traditional disk snapshots, and
|
|
357
359
|
can contain the actual running state of the virtual machine, data for all disks
|
|
@@ -369,19 +371,21 @@ class VirtualMachineSnapshot(pulumi.CustomResource):
|
|
|
369
371
|
|
|
370
372
|
## Example Usage
|
|
371
373
|
|
|
374
|
+
<!--Start PulumiCodeChooser -->
|
|
372
375
|
```python
|
|
373
376
|
import pulumi
|
|
374
377
|
import pulumi_vsphere as vsphere
|
|
375
378
|
|
|
376
379
|
demo1 = vsphere.VirtualMachineSnapshot("demo1",
|
|
377
|
-
|
|
378
|
-
snapshot_name="Snapshot Name",
|
|
380
|
+
consolidate=True,
|
|
379
381
|
description="This is Demo Snapshot",
|
|
380
382
|
memory=True,
|
|
381
383
|
quiesce=True,
|
|
382
384
|
remove_children=False,
|
|
383
|
-
|
|
385
|
+
snapshot_name="Snapshot Name",
|
|
386
|
+
virtual_machine_uuid="9aac5551-a351-4158-8c5c-15a71e8ec5c9")
|
|
384
387
|
```
|
|
388
|
+
<!--End PulumiCodeChooser -->
|
|
385
389
|
|
|
386
390
|
:param str resource_name: The name of the resource.
|
|
387
391
|
:param VirtualMachineSnapshotArgs args: The arguments to use to populate this resource's properties.
|
|
@@ -131,7 +131,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
131
131
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
132
132
|
description: Optional[pulumi.Input[str]] = None,
|
|
133
133
|
name: Optional[pulumi.Input[str]] = None,
|
|
134
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
134
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VmStoragePolicyTagRuleArgs']]]]] = None,
|
|
135
135
|
__props__=None):
|
|
136
136
|
"""
|
|
137
137
|
The `VmStoragePolicy` resource can be used to create and manage storage
|
|
@@ -144,6 +144,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
144
144
|
|
|
145
145
|
In this example, tags are first applied to datastores.
|
|
146
146
|
|
|
147
|
+
<!--Start PulumiCodeChooser -->
|
|
147
148
|
```python
|
|
148
149
|
import pulumi
|
|
149
150
|
import pulumi_vsphere as vsphere
|
|
@@ -151,99 +152,104 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
151
152
|
environment = vsphere.get_tag_category(name="environment")
|
|
152
153
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
153
154
|
replication = vsphere.get_tag_category(name="replication")
|
|
154
|
-
production = vsphere.get_tag(
|
|
155
|
-
|
|
156
|
-
development = vsphere.get_tag(
|
|
157
|
-
|
|
158
|
-
platinum = vsphere.get_tag(
|
|
159
|
-
|
|
160
|
-
gold = vsphere.get_tag(
|
|
161
|
-
|
|
162
|
-
silver = vsphere.get_tag(
|
|
163
|
-
|
|
164
|
-
bronze = vsphere.get_tag(
|
|
165
|
-
|
|
166
|
-
replicated = vsphere.get_tag(
|
|
167
|
-
|
|
168
|
-
non_replicated = vsphere.get_tag(
|
|
169
|
-
|
|
170
|
-
prod_datastore = vsphere.VmfsDatastore("
|
|
155
|
+
production = vsphere.get_tag(category_id="data.vsphere_tag_category.environment.id",
|
|
156
|
+
name="production")
|
|
157
|
+
development = vsphere.get_tag(category_id="data.vsphere_tag_category.environment.id",
|
|
158
|
+
name="development")
|
|
159
|
+
platinum = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
160
|
+
name="platinum")
|
|
161
|
+
gold = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
162
|
+
name="platinum")
|
|
163
|
+
silver = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
164
|
+
name="silver")
|
|
165
|
+
bronze = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
166
|
+
name="bronze")
|
|
167
|
+
replicated = vsphere.get_tag(category_id="data.vsphere_tag_category.replication.id",
|
|
168
|
+
name="replicated")
|
|
169
|
+
non_replicated = vsphere.get_tag(category_id="data.vsphere_tag_category.replication.id",
|
|
170
|
+
name="non_replicated")
|
|
171
|
+
prod_datastore = vsphere.VmfsDatastore("prodDatastore", tags=[
|
|
171
172
|
"data.vsphere_tag.production.id",
|
|
172
173
|
"data.vsphere_tag.platinum.id",
|
|
173
174
|
"data.vsphere_tag.replicated.id",
|
|
174
175
|
])
|
|
175
|
-
dev_datastore = vsphere.NasDatastore("
|
|
176
|
+
dev_datastore = vsphere.NasDatastore("devDatastore", tags=[
|
|
176
177
|
"data.vsphere_tag.development.id",
|
|
177
178
|
"data.vsphere_tag.silver.id",
|
|
178
179
|
"data.vsphere_tag.non_replicated.id",
|
|
179
180
|
])
|
|
180
181
|
```
|
|
182
|
+
<!--End PulumiCodeChooser -->
|
|
181
183
|
|
|
182
184
|
Next, storage policies are created and `tag_rules` are applied.
|
|
183
185
|
|
|
186
|
+
<!--Start PulumiCodeChooser -->
|
|
184
187
|
```python
|
|
185
188
|
import pulumi
|
|
186
189
|
import pulumi_vsphere as vsphere
|
|
187
190
|
|
|
188
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
189
|
-
name="prod_platinum_replicated",
|
|
191
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prodPlatinumReplicated",
|
|
190
192
|
description="prod_platinum_replicated",
|
|
191
193
|
tag_rules=[
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
194
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
195
|
+
tag_category=data["vsphere_tag_category"]["environment"]["name"],
|
|
196
|
+
tags=[data["vsphere_tag"]["production"]["name"]],
|
|
197
|
+
include_datastores_with_tags=True,
|
|
198
|
+
),
|
|
199
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
200
|
+
tag_category=data["vsphere_tag_category"]["service_level"]["name"],
|
|
201
|
+
tags=[data["vsphere_tag"]["platinum"]["name"]],
|
|
202
|
+
include_datastores_with_tags=True,
|
|
203
|
+
),
|
|
204
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
205
|
+
tag_category=data["vsphere_tag_category"]["replication"]["name"],
|
|
206
|
+
tags=[data["vsphere_tag"]["replicated"]["name"]],
|
|
207
|
+
include_datastores_with_tags=True,
|
|
208
|
+
),
|
|
207
209
|
])
|
|
208
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
209
|
-
name="dev_silver_nonreplicated",
|
|
210
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("devSilverNonreplicated",
|
|
210
211
|
description="dev_silver_nonreplicated",
|
|
211
212
|
tag_rules=[
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
213
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
214
|
+
tag_category=data["vsphere_tag_category"]["environment"]["name"],
|
|
215
|
+
tags=[data["vsphere_tag"]["development"]["name"]],
|
|
216
|
+
include_datastores_with_tags=True,
|
|
217
|
+
),
|
|
218
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
219
|
+
tag_category=data["vsphere_tag_category"]["service_level"]["name"],
|
|
220
|
+
tags=[data["vsphere_tag"]["silver"]["name"]],
|
|
221
|
+
include_datastores_with_tags=True,
|
|
222
|
+
),
|
|
223
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
224
|
+
tag_category=data["vsphere_tag_category"]["replication"]["name"],
|
|
225
|
+
tags=[data["vsphere_tag"]["non_replicated"]["name"]],
|
|
226
|
+
include_datastores_with_tags=True,
|
|
227
|
+
),
|
|
227
228
|
])
|
|
228
229
|
```
|
|
230
|
+
<!--End PulumiCodeChooser -->
|
|
229
231
|
|
|
230
|
-
|
|
232
|
+
Lasttly, when creating a virtual machine resource, a storage policy can be specificed to direct virtual machine placement to a datastore which matches the policy's `tags_rules`.
|
|
231
233
|
|
|
234
|
+
<!--Start PulumiCodeChooser -->
|
|
232
235
|
```python
|
|
233
236
|
import pulumi
|
|
234
237
|
import pulumi_vsphere as vsphere
|
|
235
238
|
|
|
236
239
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
237
240
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
238
|
-
prod_vm = vsphere.VirtualMachine("
|
|
239
|
-
|
|
241
|
+
prod_vm = vsphere.VirtualMachine("prodVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["prod_platinum_replicated"]["id"])
|
|
242
|
+
# ... other configuration ...
|
|
243
|
+
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
244
|
+
# ... other configuration ...
|
|
240
245
|
```
|
|
246
|
+
<!--End PulumiCodeChooser -->
|
|
241
247
|
|
|
242
248
|
:param str resource_name: The name of the resource.
|
|
243
249
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
244
250
|
:param pulumi.Input[str] description: Description of the storage policy.
|
|
245
251
|
:param pulumi.Input[str] name: The name of the storage policy.
|
|
246
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
252
|
+
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VmStoragePolicyTagRuleArgs']]]] tag_rules: List of tag rules. The tag category and tags to be associated to this storage policy.
|
|
247
253
|
"""
|
|
248
254
|
...
|
|
249
255
|
@overload
|
|
@@ -262,6 +268,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
262
268
|
|
|
263
269
|
In this example, tags are first applied to datastores.
|
|
264
270
|
|
|
271
|
+
<!--Start PulumiCodeChooser -->
|
|
265
272
|
```python
|
|
266
273
|
import pulumi
|
|
267
274
|
import pulumi_vsphere as vsphere
|
|
@@ -269,93 +276,98 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
269
276
|
environment = vsphere.get_tag_category(name="environment")
|
|
270
277
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
271
278
|
replication = vsphere.get_tag_category(name="replication")
|
|
272
|
-
production = vsphere.get_tag(
|
|
273
|
-
|
|
274
|
-
development = vsphere.get_tag(
|
|
275
|
-
|
|
276
|
-
platinum = vsphere.get_tag(
|
|
277
|
-
|
|
278
|
-
gold = vsphere.get_tag(
|
|
279
|
-
|
|
280
|
-
silver = vsphere.get_tag(
|
|
281
|
-
|
|
282
|
-
bronze = vsphere.get_tag(
|
|
283
|
-
|
|
284
|
-
replicated = vsphere.get_tag(
|
|
285
|
-
|
|
286
|
-
non_replicated = vsphere.get_tag(
|
|
287
|
-
|
|
288
|
-
prod_datastore = vsphere.VmfsDatastore("
|
|
279
|
+
production = vsphere.get_tag(category_id="data.vsphere_tag_category.environment.id",
|
|
280
|
+
name="production")
|
|
281
|
+
development = vsphere.get_tag(category_id="data.vsphere_tag_category.environment.id",
|
|
282
|
+
name="development")
|
|
283
|
+
platinum = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
284
|
+
name="platinum")
|
|
285
|
+
gold = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
286
|
+
name="platinum")
|
|
287
|
+
silver = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
288
|
+
name="silver")
|
|
289
|
+
bronze = vsphere.get_tag(category_id="data.vsphere_tag_category.service_level.id",
|
|
290
|
+
name="bronze")
|
|
291
|
+
replicated = vsphere.get_tag(category_id="data.vsphere_tag_category.replication.id",
|
|
292
|
+
name="replicated")
|
|
293
|
+
non_replicated = vsphere.get_tag(category_id="data.vsphere_tag_category.replication.id",
|
|
294
|
+
name="non_replicated")
|
|
295
|
+
prod_datastore = vsphere.VmfsDatastore("prodDatastore", tags=[
|
|
289
296
|
"data.vsphere_tag.production.id",
|
|
290
297
|
"data.vsphere_tag.platinum.id",
|
|
291
298
|
"data.vsphere_tag.replicated.id",
|
|
292
299
|
])
|
|
293
|
-
dev_datastore = vsphere.NasDatastore("
|
|
300
|
+
dev_datastore = vsphere.NasDatastore("devDatastore", tags=[
|
|
294
301
|
"data.vsphere_tag.development.id",
|
|
295
302
|
"data.vsphere_tag.silver.id",
|
|
296
303
|
"data.vsphere_tag.non_replicated.id",
|
|
297
304
|
])
|
|
298
305
|
```
|
|
306
|
+
<!--End PulumiCodeChooser -->
|
|
299
307
|
|
|
300
308
|
Next, storage policies are created and `tag_rules` are applied.
|
|
301
309
|
|
|
310
|
+
<!--Start PulumiCodeChooser -->
|
|
302
311
|
```python
|
|
303
312
|
import pulumi
|
|
304
313
|
import pulumi_vsphere as vsphere
|
|
305
314
|
|
|
306
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
307
|
-
name="prod_platinum_replicated",
|
|
315
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prodPlatinumReplicated",
|
|
308
316
|
description="prod_platinum_replicated",
|
|
309
317
|
tag_rules=[
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
318
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
319
|
+
tag_category=data["vsphere_tag_category"]["environment"]["name"],
|
|
320
|
+
tags=[data["vsphere_tag"]["production"]["name"]],
|
|
321
|
+
include_datastores_with_tags=True,
|
|
322
|
+
),
|
|
323
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
324
|
+
tag_category=data["vsphere_tag_category"]["service_level"]["name"],
|
|
325
|
+
tags=[data["vsphere_tag"]["platinum"]["name"]],
|
|
326
|
+
include_datastores_with_tags=True,
|
|
327
|
+
),
|
|
328
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
329
|
+
tag_category=data["vsphere_tag_category"]["replication"]["name"],
|
|
330
|
+
tags=[data["vsphere_tag"]["replicated"]["name"]],
|
|
331
|
+
include_datastores_with_tags=True,
|
|
332
|
+
),
|
|
325
333
|
])
|
|
326
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
327
|
-
name="dev_silver_nonreplicated",
|
|
334
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("devSilverNonreplicated",
|
|
328
335
|
description="dev_silver_nonreplicated",
|
|
329
336
|
tag_rules=[
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
337
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
338
|
+
tag_category=data["vsphere_tag_category"]["environment"]["name"],
|
|
339
|
+
tags=[data["vsphere_tag"]["development"]["name"]],
|
|
340
|
+
include_datastores_with_tags=True,
|
|
341
|
+
),
|
|
342
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
343
|
+
tag_category=data["vsphere_tag_category"]["service_level"]["name"],
|
|
344
|
+
tags=[data["vsphere_tag"]["silver"]["name"]],
|
|
345
|
+
include_datastores_with_tags=True,
|
|
346
|
+
),
|
|
347
|
+
vsphere.VmStoragePolicyTagRuleArgs(
|
|
348
|
+
tag_category=data["vsphere_tag_category"]["replication"]["name"],
|
|
349
|
+
tags=[data["vsphere_tag"]["non_replicated"]["name"]],
|
|
350
|
+
include_datastores_with_tags=True,
|
|
351
|
+
),
|
|
345
352
|
])
|
|
346
353
|
```
|
|
354
|
+
<!--End PulumiCodeChooser -->
|
|
347
355
|
|
|
348
|
-
|
|
356
|
+
Lasttly, when creating a virtual machine resource, a storage policy can be specificed to direct virtual machine placement to a datastore which matches the policy's `tags_rules`.
|
|
349
357
|
|
|
358
|
+
<!--Start PulumiCodeChooser -->
|
|
350
359
|
```python
|
|
351
360
|
import pulumi
|
|
352
361
|
import pulumi_vsphere as vsphere
|
|
353
362
|
|
|
354
363
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
355
364
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
356
|
-
prod_vm = vsphere.VirtualMachine("
|
|
357
|
-
|
|
365
|
+
prod_vm = vsphere.VirtualMachine("prodVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["prod_platinum_replicated"]["id"])
|
|
366
|
+
# ... other configuration ...
|
|
367
|
+
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
368
|
+
# ... other configuration ...
|
|
358
369
|
```
|
|
370
|
+
<!--End PulumiCodeChooser -->
|
|
359
371
|
|
|
360
372
|
:param str resource_name: The name of the resource.
|
|
361
373
|
:param VmStoragePolicyArgs args: The arguments to use to populate this resource's properties.
|
|
@@ -374,7 +386,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
374
386
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
375
387
|
description: Optional[pulumi.Input[str]] = None,
|
|
376
388
|
name: Optional[pulumi.Input[str]] = None,
|
|
377
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
389
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VmStoragePolicyTagRuleArgs']]]]] = None,
|
|
378
390
|
__props__=None):
|
|
379
391
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
380
392
|
if not isinstance(opts, pulumi.ResourceOptions):
|
|
@@ -401,7 +413,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
401
413
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
402
414
|
description: Optional[pulumi.Input[str]] = None,
|
|
403
415
|
name: Optional[pulumi.Input[str]] = None,
|
|
404
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
416
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VmStoragePolicyTagRuleArgs']]]]] = None) -> 'VmStoragePolicy':
|
|
405
417
|
"""
|
|
406
418
|
Get an existing VmStoragePolicy resource's state with the given name, id, and optional extra
|
|
407
419
|
properties used to qualify the lookup.
|
|
@@ -411,7 +423,7 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
411
423
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
412
424
|
:param pulumi.Input[str] description: Description of the storage policy.
|
|
413
425
|
:param pulumi.Input[str] name: The name of the storage policy.
|
|
414
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
426
|
+
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VmStoragePolicyTagRuleArgs']]]] tag_rules: List of tag rules. The tag category and tags to be associated to this storage policy.
|
|
415
427
|
"""
|
|
416
428
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
417
429
|
|