pulumi-vsphere 4.10.0a1709017641__py3-none-any.whl → 4.17.0a1763710194__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 +51 -1
- pulumi_vsphere/_inputs.py +2568 -1025
- pulumi_vsphere/_utilities.py +50 -10
- pulumi_vsphere/compute_cluster.py +1564 -2373
- pulumi_vsphere/compute_cluster_host_group.py +191 -55
- pulumi_vsphere/compute_cluster_vm_affinity_rule.py +157 -113
- pulumi_vsphere/compute_cluster_vm_anti_affinity_rule.py +133 -89
- pulumi_vsphere/compute_cluster_vm_dependency_rule.py +314 -106
- pulumi_vsphere/compute_cluster_vm_group.py +256 -55
- pulumi_vsphere/compute_cluster_vm_host_rule.py +323 -123
- pulumi_vsphere/config/__init__.py +2 -1
- pulumi_vsphere/config/__init__.pyi +7 -2
- pulumi_vsphere/config/vars.py +20 -15
- pulumi_vsphere/configuration_profile.py +286 -0
- pulumi_vsphere/content_library.py +177 -71
- pulumi_vsphere/content_library_item.py +252 -106
- pulumi_vsphere/custom_attribute.py +118 -38
- pulumi_vsphere/datacenter.py +128 -107
- pulumi_vsphere/datastore_cluster.py +636 -731
- pulumi_vsphere/datastore_cluster_vm_anti_affinity_rule.py +251 -89
- pulumi_vsphere/distributed_port_group.py +1129 -967
- pulumi_vsphere/distributed_virtual_switch.py +1971 -2239
- pulumi_vsphere/distributed_virtual_switch_pvlan_mapping.py +294 -0
- pulumi_vsphere/dpm_host_override.py +222 -72
- pulumi_vsphere/drs_vm_override.py +236 -72
- pulumi_vsphere/entity_permissions.py +96 -69
- pulumi_vsphere/file.py +173 -178
- pulumi_vsphere/folder.py +236 -113
- pulumi_vsphere/get_compute_cluster.py +34 -23
- pulumi_vsphere/get_compute_cluster_host_group.py +52 -41
- pulumi_vsphere/get_configuration_profile.py +145 -0
- pulumi_vsphere/get_content_library.py +33 -21
- pulumi_vsphere/get_content_library_item.py +47 -31
- pulumi_vsphere/get_custom_attribute.py +26 -17
- pulumi_vsphere/get_datacenter.py +40 -18
- pulumi_vsphere/get_datastore.py +60 -24
- pulumi_vsphere/get_datastore_cluster.py +47 -22
- pulumi_vsphere/get_datastore_stats.py +204 -0
- pulumi_vsphere/get_distributed_virtual_switch.py +36 -23
- pulumi_vsphere/get_dynamic.py +55 -45
- pulumi_vsphere/get_folder.py +163 -25
- pulumi_vsphere/get_guest_os_customization.py +68 -37
- pulumi_vsphere/get_host.py +34 -23
- pulumi_vsphere/get_host_base_images.py +104 -0
- pulumi_vsphere/get_host_pci_device.py +78 -35
- pulumi_vsphere/get_host_thumbprint.py +58 -38
- pulumi_vsphere/get_host_vgpu_profile.py +195 -0
- pulumi_vsphere/get_license.py +44 -28
- pulumi_vsphere/get_network.py +157 -46
- pulumi_vsphere/get_ovf_vm_template.py +184 -301
- pulumi_vsphere/get_policy.py +23 -15
- pulumi_vsphere/get_resource_pool.py +107 -40
- pulumi_vsphere/get_role.py +49 -35
- pulumi_vsphere/get_tag.py +34 -23
- pulumi_vsphere/get_tag_category.py +32 -21
- pulumi_vsphere/get_vapp_container.py +31 -21
- pulumi_vsphere/get_virtual_machine.py +499 -287
- pulumi_vsphere/get_vmfs_disks.py +42 -29
- pulumi_vsphere/guest_os_customization.py +135 -79
- pulumi_vsphere/ha_vm_override.py +470 -577
- pulumi_vsphere/host.py +515 -262
- pulumi_vsphere/host_port_group.py +352 -355
- pulumi_vsphere/host_virtual_switch.py +580 -580
- pulumi_vsphere/license.py +110 -92
- pulumi_vsphere/nas_datastore.py +398 -270
- pulumi_vsphere/offline_software_depot.py +190 -0
- pulumi_vsphere/outputs.py +1582 -1027
- pulumi_vsphere/provider.py +172 -152
- pulumi_vsphere/pulumi-plugin.json +2 -1
- pulumi_vsphere/resource_pool.py +357 -273
- pulumi_vsphere/role.py +79 -47
- pulumi_vsphere/storage_drs_vm_override.py +225 -89
- pulumi_vsphere/supervisor.py +1064 -0
- pulumi_vsphere/tag.py +217 -55
- pulumi_vsphere/tag_category.py +158 -72
- pulumi_vsphere/vapp_container.py +425 -259
- pulumi_vsphere/vapp_entity.py +324 -174
- pulumi_vsphere/virtual_disk.py +245 -153
- pulumi_vsphere/virtual_machine.py +1696 -1836
- pulumi_vsphere/virtual_machine_class.py +448 -0
- pulumi_vsphere/virtual_machine_snapshot.py +137 -131
- pulumi_vsphere/vm_storage_policy.py +160 -154
- pulumi_vsphere/vmfs_datastore.py +460 -186
- pulumi_vsphere/vnic.py +249 -231
- {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/METADATA +7 -6
- pulumi_vsphere-4.17.0a1763710194.dist-info/RECORD +89 -0
- {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/WHEEL +1 -1
- pulumi_vsphere-4.10.0a1709017641.dist-info/RECORD +0 -80
- {pulumi_vsphere-4.10.0a1709017641.dist-info → pulumi_vsphere-4.17.0a1763710194.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
|
-
# *** WARNING: this file was generated by
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
3
|
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import builtins as _builtins
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
from . import outputs
|
|
12
17
|
from ._inputs import *
|
|
@@ -17,13 +22,13 @@ __all__ = ['VmStoragePolicyArgs', 'VmStoragePolicy']
|
|
|
17
22
|
class VmStoragePolicyArgs:
|
|
18
23
|
def __init__(__self__, *,
|
|
19
24
|
tag_rules: pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]],
|
|
20
|
-
description: Optional[pulumi.Input[str]] = None,
|
|
21
|
-
name: Optional[pulumi.Input[str]] = None):
|
|
25
|
+
description: Optional[pulumi.Input[_builtins.str]] = None,
|
|
26
|
+
name: Optional[pulumi.Input[_builtins.str]] = None):
|
|
22
27
|
"""
|
|
23
28
|
The set of arguments for constructing a VmStoragePolicy resource.
|
|
24
29
|
:param pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]] tag_rules: List of tag rules. The tag category and tags to be associated to this storage policy.
|
|
25
|
-
:param pulumi.Input[str] description: Description of the storage policy.
|
|
26
|
-
:param pulumi.Input[str] name: The name of the storage policy.
|
|
30
|
+
:param pulumi.Input[_builtins.str] description: Description of the storage policy.
|
|
31
|
+
:param pulumi.Input[_builtins.str] name: The name of the storage policy.
|
|
27
32
|
"""
|
|
28
33
|
pulumi.set(__self__, "tag_rules", tag_rules)
|
|
29
34
|
if description is not None:
|
|
@@ -31,7 +36,7 @@ class VmStoragePolicyArgs:
|
|
|
31
36
|
if name is not None:
|
|
32
37
|
pulumi.set(__self__, "name", name)
|
|
33
38
|
|
|
34
|
-
@property
|
|
39
|
+
@_builtins.property
|
|
35
40
|
@pulumi.getter(name="tagRules")
|
|
36
41
|
def tag_rules(self) -> pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]]:
|
|
37
42
|
"""
|
|
@@ -43,41 +48,41 @@ class VmStoragePolicyArgs:
|
|
|
43
48
|
def tag_rules(self, value: pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]]):
|
|
44
49
|
pulumi.set(self, "tag_rules", value)
|
|
45
50
|
|
|
46
|
-
@property
|
|
51
|
+
@_builtins.property
|
|
47
52
|
@pulumi.getter
|
|
48
|
-
def description(self) -> Optional[pulumi.Input[str]]:
|
|
53
|
+
def description(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
49
54
|
"""
|
|
50
55
|
Description of the storage policy.
|
|
51
56
|
"""
|
|
52
57
|
return pulumi.get(self, "description")
|
|
53
58
|
|
|
54
59
|
@description.setter
|
|
55
|
-
def description(self, value: Optional[pulumi.Input[str]]):
|
|
60
|
+
def description(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
56
61
|
pulumi.set(self, "description", value)
|
|
57
62
|
|
|
58
|
-
@property
|
|
63
|
+
@_builtins.property
|
|
59
64
|
@pulumi.getter
|
|
60
|
-
def name(self) -> Optional[pulumi.Input[str]]:
|
|
65
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
61
66
|
"""
|
|
62
67
|
The name of the storage policy.
|
|
63
68
|
"""
|
|
64
69
|
return pulumi.get(self, "name")
|
|
65
70
|
|
|
66
71
|
@name.setter
|
|
67
|
-
def name(self, value: Optional[pulumi.Input[str]]):
|
|
72
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
68
73
|
pulumi.set(self, "name", value)
|
|
69
74
|
|
|
70
75
|
|
|
71
76
|
@pulumi.input_type
|
|
72
77
|
class _VmStoragePolicyState:
|
|
73
78
|
def __init__(__self__, *,
|
|
74
|
-
description: Optional[pulumi.Input[str]] = None,
|
|
75
|
-
name: Optional[pulumi.Input[str]] = None,
|
|
79
|
+
description: Optional[pulumi.Input[_builtins.str]] = None,
|
|
80
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
76
81
|
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]]] = None):
|
|
77
82
|
"""
|
|
78
83
|
Input properties used for looking up and filtering VmStoragePolicy resources.
|
|
79
|
-
:param pulumi.Input[str] description: Description of the storage policy.
|
|
80
|
-
:param pulumi.Input[str] name: The name of the storage policy.
|
|
84
|
+
:param pulumi.Input[_builtins.str] description: Description of the storage policy.
|
|
85
|
+
:param pulumi.Input[_builtins.str] name: The name of the storage policy.
|
|
81
86
|
:param pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]] tag_rules: List of tag rules. The tag category and tags to be associated to this storage policy.
|
|
82
87
|
"""
|
|
83
88
|
if description is not None:
|
|
@@ -87,31 +92,31 @@ class _VmStoragePolicyState:
|
|
|
87
92
|
if tag_rules is not None:
|
|
88
93
|
pulumi.set(__self__, "tag_rules", tag_rules)
|
|
89
94
|
|
|
90
|
-
@property
|
|
95
|
+
@_builtins.property
|
|
91
96
|
@pulumi.getter
|
|
92
|
-
def description(self) -> Optional[pulumi.Input[str]]:
|
|
97
|
+
def description(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
93
98
|
"""
|
|
94
99
|
Description of the storage policy.
|
|
95
100
|
"""
|
|
96
101
|
return pulumi.get(self, "description")
|
|
97
102
|
|
|
98
103
|
@description.setter
|
|
99
|
-
def description(self, value: Optional[pulumi.Input[str]]):
|
|
104
|
+
def description(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
100
105
|
pulumi.set(self, "description", value)
|
|
101
106
|
|
|
102
|
-
@property
|
|
107
|
+
@_builtins.property
|
|
103
108
|
@pulumi.getter
|
|
104
|
-
def name(self) -> Optional[pulumi.Input[str]]:
|
|
109
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
105
110
|
"""
|
|
106
111
|
The name of the storage policy.
|
|
107
112
|
"""
|
|
108
113
|
return pulumi.get(self, "name")
|
|
109
114
|
|
|
110
115
|
@name.setter
|
|
111
|
-
def name(self, value: Optional[pulumi.Input[str]]):
|
|
116
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
112
117
|
pulumi.set(self, "name", value)
|
|
113
118
|
|
|
114
|
-
@property
|
|
119
|
+
@_builtins.property
|
|
115
120
|
@pulumi.getter(name="tagRules")
|
|
116
121
|
def tag_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VmStoragePolicyTagRuleArgs']]]]:
|
|
117
122
|
"""
|
|
@@ -124,14 +129,15 @@ class _VmStoragePolicyState:
|
|
|
124
129
|
pulumi.set(self, "tag_rules", value)
|
|
125
130
|
|
|
126
131
|
|
|
132
|
+
@pulumi.type_token("vsphere:index/vmStoragePolicy:VmStoragePolicy")
|
|
127
133
|
class VmStoragePolicy(pulumi.CustomResource):
|
|
128
134
|
@overload
|
|
129
135
|
def __init__(__self__,
|
|
130
136
|
resource_name: str,
|
|
131
137
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
132
|
-
description: Optional[pulumi.Input[str]] = None,
|
|
133
|
-
name: Optional[pulumi.Input[str]] = None,
|
|
134
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
138
|
+
description: Optional[pulumi.Input[_builtins.str]] = None,
|
|
139
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
140
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['VmStoragePolicyTagRuleArgs', 'VmStoragePolicyTagRuleArgsDict']]]]] = None,
|
|
135
141
|
__props__=None):
|
|
136
142
|
"""
|
|
137
143
|
The `VmStoragePolicy` resource can be used to create and manage storage
|
|
@@ -151,28 +157,28 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
151
157
|
environment = vsphere.get_tag_category(name="environment")
|
|
152
158
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
153
159
|
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("
|
|
160
|
+
production = vsphere.get_tag(name="production",
|
|
161
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
162
|
+
development = vsphere.get_tag(name="development",
|
|
163
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
164
|
+
platinum = vsphere.get_tag(name="platinum",
|
|
165
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
166
|
+
gold = vsphere.get_tag(name="platinum",
|
|
167
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
168
|
+
silver = vsphere.get_tag(name="silver",
|
|
169
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
170
|
+
bronze = vsphere.get_tag(name="bronze",
|
|
171
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
172
|
+
replicated = vsphere.get_tag(name="replicated",
|
|
173
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
174
|
+
non_replicated = vsphere.get_tag(name="non_replicated",
|
|
175
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
176
|
+
prod_datastore = vsphere.VmfsDatastore("prod_datastore", tags=[
|
|
171
177
|
"data.vsphere_tag.production.id",
|
|
172
178
|
"data.vsphere_tag.platinum.id",
|
|
173
179
|
"data.vsphere_tag.replicated.id",
|
|
174
180
|
])
|
|
175
|
-
dev_datastore = vsphere.NasDatastore("
|
|
181
|
+
dev_datastore = vsphere.NasDatastore("dev_datastore", tags=[
|
|
176
182
|
"data.vsphere_tag.development.id",
|
|
177
183
|
"data.vsphere_tag.silver.id",
|
|
178
184
|
"data.vsphere_tag.non_replicated.id",
|
|
@@ -185,47 +191,49 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
185
191
|
import pulumi
|
|
186
192
|
import pulumi_vsphere as vsphere
|
|
187
193
|
|
|
188
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
194
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prod_platinum_replicated",
|
|
195
|
+
name="prod_platinum_replicated",
|
|
189
196
|
description="prod_platinum_replicated",
|
|
190
197
|
tag_rules=[
|
|
191
|
-
|
|
192
|
-
tag_category
|
|
193
|
-
tags
|
|
194
|
-
include_datastores_with_tags
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
tag_category
|
|
198
|
-
tags
|
|
199
|
-
include_datastores_with_tags
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
tag_category
|
|
203
|
-
tags
|
|
204
|
-
include_datastores_with_tags
|
|
205
|
-
|
|
198
|
+
{
|
|
199
|
+
"tag_category": environment["name"],
|
|
200
|
+
"tags": [production["name"]],
|
|
201
|
+
"include_datastores_with_tags": True,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"tag_category": service_level["name"],
|
|
205
|
+
"tags": [platinum["name"]],
|
|
206
|
+
"include_datastores_with_tags": True,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"tag_category": replication["name"],
|
|
210
|
+
"tags": [replicated["name"]],
|
|
211
|
+
"include_datastores_with_tags": True,
|
|
212
|
+
},
|
|
206
213
|
])
|
|
207
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
214
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("dev_silver_nonreplicated",
|
|
215
|
+
name="dev_silver_nonreplicated",
|
|
208
216
|
description="dev_silver_nonreplicated",
|
|
209
217
|
tag_rules=[
|
|
210
|
-
|
|
211
|
-
tag_category
|
|
212
|
-
tags
|
|
213
|
-
include_datastores_with_tags
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
tag_category
|
|
217
|
-
tags
|
|
218
|
-
include_datastores_with_tags
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
tag_category
|
|
222
|
-
tags
|
|
223
|
-
include_datastores_with_tags
|
|
224
|
-
|
|
218
|
+
{
|
|
219
|
+
"tag_category": environment["name"],
|
|
220
|
+
"tags": [development["name"]],
|
|
221
|
+
"include_datastores_with_tags": True,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"tag_category": service_level["name"],
|
|
225
|
+
"tags": [silver["name"]],
|
|
226
|
+
"include_datastores_with_tags": True,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"tag_category": replication["name"],
|
|
230
|
+
"tags": [non_replicated["name"]],
|
|
231
|
+
"include_datastores_with_tags": True,
|
|
232
|
+
},
|
|
225
233
|
])
|
|
226
234
|
```
|
|
227
235
|
|
|
228
|
-
|
|
236
|
+
Lastly, when creating a virtual machine resource, a storage policy can be specified to direct virtual machine placement to a datastore which matches the policy's `tags_rules`.
|
|
229
237
|
|
|
230
238
|
```python
|
|
231
239
|
import pulumi
|
|
@@ -233,17 +241,15 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
233
241
|
|
|
234
242
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
235
243
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
236
|
-
prod_vm = vsphere.VirtualMachine("
|
|
237
|
-
|
|
238
|
-
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
239
|
-
# ... other configuration ...
|
|
244
|
+
prod_vm = vsphere.VirtualMachine("prod_vm", storage_policy_id=storage_policy["prodPlatinumReplicated"]["id"])
|
|
245
|
+
dev_vm = vsphere.VirtualMachine("dev_vm", storage_policy_id=storage_policy["devSilverNonreplicated"]["id"])
|
|
240
246
|
```
|
|
241
247
|
|
|
242
248
|
:param str resource_name: The name of the resource.
|
|
243
249
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
244
|
-
:param pulumi.Input[str] description: Description of the storage policy.
|
|
245
|
-
:param pulumi.Input[str] name: The name of the storage policy.
|
|
246
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
250
|
+
:param pulumi.Input[_builtins.str] description: Description of the storage policy.
|
|
251
|
+
:param pulumi.Input[_builtins.str] name: The name of the storage policy.
|
|
252
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['VmStoragePolicyTagRuleArgs', 'VmStoragePolicyTagRuleArgsDict']]]] 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
|
|
@@ -269,28 +275,28 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
269
275
|
environment = vsphere.get_tag_category(name="environment")
|
|
270
276
|
service_level = vsphere.get_tag_category(name="service_level")
|
|
271
277
|
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("
|
|
278
|
+
production = vsphere.get_tag(name="production",
|
|
279
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
280
|
+
development = vsphere.get_tag(name="development",
|
|
281
|
+
category_id="data.vsphere_tag_category.environment.id")
|
|
282
|
+
platinum = vsphere.get_tag(name="platinum",
|
|
283
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
284
|
+
gold = vsphere.get_tag(name="platinum",
|
|
285
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
286
|
+
silver = vsphere.get_tag(name="silver",
|
|
287
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
288
|
+
bronze = vsphere.get_tag(name="bronze",
|
|
289
|
+
category_id="data.vsphere_tag_category.service_level.id")
|
|
290
|
+
replicated = vsphere.get_tag(name="replicated",
|
|
291
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
292
|
+
non_replicated = vsphere.get_tag(name="non_replicated",
|
|
293
|
+
category_id="data.vsphere_tag_category.replication.id")
|
|
294
|
+
prod_datastore = vsphere.VmfsDatastore("prod_datastore", tags=[
|
|
289
295
|
"data.vsphere_tag.production.id",
|
|
290
296
|
"data.vsphere_tag.platinum.id",
|
|
291
297
|
"data.vsphere_tag.replicated.id",
|
|
292
298
|
])
|
|
293
|
-
dev_datastore = vsphere.NasDatastore("
|
|
299
|
+
dev_datastore = vsphere.NasDatastore("dev_datastore", tags=[
|
|
294
300
|
"data.vsphere_tag.development.id",
|
|
295
301
|
"data.vsphere_tag.silver.id",
|
|
296
302
|
"data.vsphere_tag.non_replicated.id",
|
|
@@ -303,47 +309,49 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
303
309
|
import pulumi
|
|
304
310
|
import pulumi_vsphere as vsphere
|
|
305
311
|
|
|
306
|
-
prod_platinum_replicated = vsphere.VmStoragePolicy("
|
|
312
|
+
prod_platinum_replicated = vsphere.VmStoragePolicy("prod_platinum_replicated",
|
|
313
|
+
name="prod_platinum_replicated",
|
|
307
314
|
description="prod_platinum_replicated",
|
|
308
315
|
tag_rules=[
|
|
309
|
-
|
|
310
|
-
tag_category
|
|
311
|
-
tags
|
|
312
|
-
include_datastores_with_tags
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
tag_category
|
|
316
|
-
tags
|
|
317
|
-
include_datastores_with_tags
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
tag_category
|
|
321
|
-
tags
|
|
322
|
-
include_datastores_with_tags
|
|
323
|
-
|
|
316
|
+
{
|
|
317
|
+
"tag_category": environment["name"],
|
|
318
|
+
"tags": [production["name"]],
|
|
319
|
+
"include_datastores_with_tags": True,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"tag_category": service_level["name"],
|
|
323
|
+
"tags": [platinum["name"]],
|
|
324
|
+
"include_datastores_with_tags": True,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"tag_category": replication["name"],
|
|
328
|
+
"tags": [replicated["name"]],
|
|
329
|
+
"include_datastores_with_tags": True,
|
|
330
|
+
},
|
|
324
331
|
])
|
|
325
|
-
dev_silver_nonreplicated = vsphere.VmStoragePolicy("
|
|
332
|
+
dev_silver_nonreplicated = vsphere.VmStoragePolicy("dev_silver_nonreplicated",
|
|
333
|
+
name="dev_silver_nonreplicated",
|
|
326
334
|
description="dev_silver_nonreplicated",
|
|
327
335
|
tag_rules=[
|
|
328
|
-
|
|
329
|
-
tag_category
|
|
330
|
-
tags
|
|
331
|
-
include_datastores_with_tags
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
tag_category
|
|
335
|
-
tags
|
|
336
|
-
include_datastores_with_tags
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
tag_category
|
|
340
|
-
tags
|
|
341
|
-
include_datastores_with_tags
|
|
342
|
-
|
|
336
|
+
{
|
|
337
|
+
"tag_category": environment["name"],
|
|
338
|
+
"tags": [development["name"]],
|
|
339
|
+
"include_datastores_with_tags": True,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"tag_category": service_level["name"],
|
|
343
|
+
"tags": [silver["name"]],
|
|
344
|
+
"include_datastores_with_tags": True,
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"tag_category": replication["name"],
|
|
348
|
+
"tags": [non_replicated["name"]],
|
|
349
|
+
"include_datastores_with_tags": True,
|
|
350
|
+
},
|
|
343
351
|
])
|
|
344
352
|
```
|
|
345
353
|
|
|
346
|
-
|
|
354
|
+
Lastly, when creating a virtual machine resource, a storage policy can be specified to direct virtual machine placement to a datastore which matches the policy's `tags_rules`.
|
|
347
355
|
|
|
348
356
|
```python
|
|
349
357
|
import pulumi
|
|
@@ -351,10 +359,8 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
351
359
|
|
|
352
360
|
prod_platinum_replicated = vsphere.get_policy(name="prod_platinum_replicated")
|
|
353
361
|
dev_silver_nonreplicated = vsphere.get_policy(name="dev_silver_nonreplicated")
|
|
354
|
-
prod_vm = vsphere.VirtualMachine("
|
|
355
|
-
|
|
356
|
-
dev_vm = vsphere.VirtualMachine("devVm", storage_policy_id=data["vsphere_storage_policy"]["storage_policy"]["dev_silver_nonreplicated"]["id"])
|
|
357
|
-
# ... other configuration ...
|
|
362
|
+
prod_vm = vsphere.VirtualMachine("prod_vm", storage_policy_id=storage_policy["prodPlatinumReplicated"]["id"])
|
|
363
|
+
dev_vm = vsphere.VirtualMachine("dev_vm", storage_policy_id=storage_policy["devSilverNonreplicated"]["id"])
|
|
358
364
|
```
|
|
359
365
|
|
|
360
366
|
:param str resource_name: The name of the resource.
|
|
@@ -372,9 +378,9 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
372
378
|
def _internal_init(__self__,
|
|
373
379
|
resource_name: str,
|
|
374
380
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
375
|
-
description: Optional[pulumi.Input[str]] = None,
|
|
376
|
-
name: Optional[pulumi.Input[str]] = None,
|
|
377
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
381
|
+
description: Optional[pulumi.Input[_builtins.str]] = None,
|
|
382
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
383
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['VmStoragePolicyTagRuleArgs', 'VmStoragePolicyTagRuleArgsDict']]]]] = None,
|
|
378
384
|
__props__=None):
|
|
379
385
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
380
386
|
if not isinstance(opts, pulumi.ResourceOptions):
|
|
@@ -399,9 +405,9 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
399
405
|
def get(resource_name: str,
|
|
400
406
|
id: pulumi.Input[str],
|
|
401
407
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
402
|
-
description: Optional[pulumi.Input[str]] = None,
|
|
403
|
-
name: Optional[pulumi.Input[str]] = None,
|
|
404
|
-
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
408
|
+
description: Optional[pulumi.Input[_builtins.str]] = None,
|
|
409
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
410
|
+
tag_rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['VmStoragePolicyTagRuleArgs', 'VmStoragePolicyTagRuleArgsDict']]]]] = None) -> 'VmStoragePolicy':
|
|
405
411
|
"""
|
|
406
412
|
Get an existing VmStoragePolicy resource's state with the given name, id, and optional extra
|
|
407
413
|
properties used to qualify the lookup.
|
|
@@ -409,9 +415,9 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
409
415
|
:param str resource_name: The unique name of the resulting resource.
|
|
410
416
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
|
411
417
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
412
|
-
:param pulumi.Input[str] description: Description of the storage policy.
|
|
413
|
-
:param pulumi.Input[str] name: The name of the storage policy.
|
|
414
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
418
|
+
:param pulumi.Input[_builtins.str] description: Description of the storage policy.
|
|
419
|
+
:param pulumi.Input[_builtins.str] name: The name of the storage policy.
|
|
420
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['VmStoragePolicyTagRuleArgs', 'VmStoragePolicyTagRuleArgsDict']]]] tag_rules: List of tag rules. The tag category and tags to be associated to this storage policy.
|
|
415
421
|
"""
|
|
416
422
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
417
423
|
|
|
@@ -422,23 +428,23 @@ class VmStoragePolicy(pulumi.CustomResource):
|
|
|
422
428
|
__props__.__dict__["tag_rules"] = tag_rules
|
|
423
429
|
return VmStoragePolicy(resource_name, opts=opts, __props__=__props__)
|
|
424
430
|
|
|
425
|
-
@property
|
|
431
|
+
@_builtins.property
|
|
426
432
|
@pulumi.getter
|
|
427
|
-
def description(self) -> pulumi.Output[Optional[str]]:
|
|
433
|
+
def description(self) -> pulumi.Output[Optional[_builtins.str]]:
|
|
428
434
|
"""
|
|
429
435
|
Description of the storage policy.
|
|
430
436
|
"""
|
|
431
437
|
return pulumi.get(self, "description")
|
|
432
438
|
|
|
433
|
-
@property
|
|
439
|
+
@_builtins.property
|
|
434
440
|
@pulumi.getter
|
|
435
|
-
def name(self) -> pulumi.Output[str]:
|
|
441
|
+
def name(self) -> pulumi.Output[_builtins.str]:
|
|
436
442
|
"""
|
|
437
443
|
The name of the storage policy.
|
|
438
444
|
"""
|
|
439
445
|
return pulumi.get(self, "name")
|
|
440
446
|
|
|
441
|
-
@property
|
|
447
|
+
@_builtins.property
|
|
442
448
|
@pulumi.getter(name="tagRules")
|
|
443
449
|
def tag_rules(self) -> pulumi.Output[Sequence['outputs.VmStoragePolicyTagRule']]:
|
|
444
450
|
"""
|