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
|
|
|
12
17
|
__all__ = ['DpmHostOverrideArgs', 'DpmHostOverride']
|
|
@@ -14,24 +19,24 @@ __all__ = ['DpmHostOverrideArgs', 'DpmHostOverride']
|
|
|
14
19
|
@pulumi.input_type
|
|
15
20
|
class DpmHostOverrideArgs:
|
|
16
21
|
def __init__(__self__, *,
|
|
17
|
-
compute_cluster_id: pulumi.Input[str],
|
|
18
|
-
host_system_id: pulumi.Input[str],
|
|
19
|
-
dpm_automation_level: Optional[pulumi.Input[str]] = None,
|
|
20
|
-
dpm_enabled: Optional[pulumi.Input[bool]] = None):
|
|
22
|
+
compute_cluster_id: pulumi.Input[_builtins.str],
|
|
23
|
+
host_system_id: pulumi.Input[_builtins.str],
|
|
24
|
+
dpm_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
|
|
25
|
+
dpm_enabled: Optional[pulumi.Input[_builtins.bool]] = None):
|
|
21
26
|
"""
|
|
22
27
|
The set of arguments for constructing a DpmHostOverride resource.
|
|
23
|
-
:param pulumi.Input[str] compute_cluster_id: The managed object reference
|
|
28
|
+
:param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
|
|
24
29
|
ID of the cluster to put the override in. Forces a new
|
|
25
30
|
resource if changed.
|
|
26
|
-
:param pulumi.Input[str] host_system_id: The managed object ID of the host.
|
|
27
|
-
:param pulumi.Input[str] dpm_automation_level: The automation level for host power
|
|
31
|
+
:param pulumi.Input[_builtins.str] host_system_id: The managed object ID of the host.
|
|
32
|
+
:param pulumi.Input[_builtins.str] dpm_automation_level: The automation level for host power
|
|
28
33
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
29
34
|
`manual`.
|
|
30
35
|
|
|
31
36
|
> **NOTE:** Using this resource _always_ implies an override, even if one of
|
|
32
37
|
`dpm_enabled` or `dpm_automation_level` is omitted. Take note of the defaults
|
|
33
38
|
for both options.
|
|
34
|
-
:param pulumi.Input[bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
39
|
+
:param pulumi.Input[_builtins.bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
35
40
|
`false`.
|
|
36
41
|
"""
|
|
37
42
|
pulumi.set(__self__, "compute_cluster_id", compute_cluster_id)
|
|
@@ -41,9 +46,9 @@ class DpmHostOverrideArgs:
|
|
|
41
46
|
if dpm_enabled is not None:
|
|
42
47
|
pulumi.set(__self__, "dpm_enabled", dpm_enabled)
|
|
43
48
|
|
|
44
|
-
@property
|
|
49
|
+
@_builtins.property
|
|
45
50
|
@pulumi.getter(name="computeClusterId")
|
|
46
|
-
def compute_cluster_id(self) -> pulumi.Input[str]:
|
|
51
|
+
def compute_cluster_id(self) -> pulumi.Input[_builtins.str]:
|
|
47
52
|
"""
|
|
48
53
|
The managed object reference
|
|
49
54
|
ID of the cluster to put the override in. Forces a new
|
|
@@ -52,24 +57,24 @@ class DpmHostOverrideArgs:
|
|
|
52
57
|
return pulumi.get(self, "compute_cluster_id")
|
|
53
58
|
|
|
54
59
|
@compute_cluster_id.setter
|
|
55
|
-
def compute_cluster_id(self, value: pulumi.Input[str]):
|
|
60
|
+
def compute_cluster_id(self, value: pulumi.Input[_builtins.str]):
|
|
56
61
|
pulumi.set(self, "compute_cluster_id", value)
|
|
57
62
|
|
|
58
|
-
@property
|
|
63
|
+
@_builtins.property
|
|
59
64
|
@pulumi.getter(name="hostSystemId")
|
|
60
|
-
def host_system_id(self) -> pulumi.Input[str]:
|
|
65
|
+
def host_system_id(self) -> pulumi.Input[_builtins.str]:
|
|
61
66
|
"""
|
|
62
67
|
The managed object ID of the host.
|
|
63
68
|
"""
|
|
64
69
|
return pulumi.get(self, "host_system_id")
|
|
65
70
|
|
|
66
71
|
@host_system_id.setter
|
|
67
|
-
def host_system_id(self, value: pulumi.Input[str]):
|
|
72
|
+
def host_system_id(self, value: pulumi.Input[_builtins.str]):
|
|
68
73
|
pulumi.set(self, "host_system_id", value)
|
|
69
74
|
|
|
70
|
-
@property
|
|
75
|
+
@_builtins.property
|
|
71
76
|
@pulumi.getter(name="dpmAutomationLevel")
|
|
72
|
-
def dpm_automation_level(self) -> Optional[pulumi.Input[str]]:
|
|
77
|
+
def dpm_automation_level(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
73
78
|
"""
|
|
74
79
|
The automation level for host power
|
|
75
80
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
@@ -82,12 +87,12 @@ class DpmHostOverrideArgs:
|
|
|
82
87
|
return pulumi.get(self, "dpm_automation_level")
|
|
83
88
|
|
|
84
89
|
@dpm_automation_level.setter
|
|
85
|
-
def dpm_automation_level(self, value: Optional[pulumi.Input[str]]):
|
|
90
|
+
def dpm_automation_level(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
86
91
|
pulumi.set(self, "dpm_automation_level", value)
|
|
87
92
|
|
|
88
|
-
@property
|
|
93
|
+
@_builtins.property
|
|
89
94
|
@pulumi.getter(name="dpmEnabled")
|
|
90
|
-
def dpm_enabled(self) -> Optional[pulumi.Input[bool]]:
|
|
95
|
+
def dpm_enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
|
|
91
96
|
"""
|
|
92
97
|
Enable DPM support for this host. Default:
|
|
93
98
|
`false`.
|
|
@@ -95,32 +100,32 @@ class DpmHostOverrideArgs:
|
|
|
95
100
|
return pulumi.get(self, "dpm_enabled")
|
|
96
101
|
|
|
97
102
|
@dpm_enabled.setter
|
|
98
|
-
def dpm_enabled(self, value: Optional[pulumi.Input[bool]]):
|
|
103
|
+
def dpm_enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
|
|
99
104
|
pulumi.set(self, "dpm_enabled", value)
|
|
100
105
|
|
|
101
106
|
|
|
102
107
|
@pulumi.input_type
|
|
103
108
|
class _DpmHostOverrideState:
|
|
104
109
|
def __init__(__self__, *,
|
|
105
|
-
compute_cluster_id: Optional[pulumi.Input[str]] = None,
|
|
106
|
-
dpm_automation_level: Optional[pulumi.Input[str]] = None,
|
|
107
|
-
dpm_enabled: Optional[pulumi.Input[bool]] = None,
|
|
108
|
-
host_system_id: Optional[pulumi.Input[str]] = None):
|
|
110
|
+
compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
111
|
+
dpm_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
|
|
112
|
+
dpm_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
|
|
113
|
+
host_system_id: Optional[pulumi.Input[_builtins.str]] = None):
|
|
109
114
|
"""
|
|
110
115
|
Input properties used for looking up and filtering DpmHostOverride resources.
|
|
111
|
-
:param pulumi.Input[str] compute_cluster_id: The managed object reference
|
|
116
|
+
:param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
|
|
112
117
|
ID of the cluster to put the override in. Forces a new
|
|
113
118
|
resource if changed.
|
|
114
|
-
:param pulumi.Input[str] dpm_automation_level: The automation level for host power
|
|
119
|
+
:param pulumi.Input[_builtins.str] dpm_automation_level: The automation level for host power
|
|
115
120
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
116
121
|
`manual`.
|
|
117
122
|
|
|
118
123
|
> **NOTE:** Using this resource _always_ implies an override, even if one of
|
|
119
124
|
`dpm_enabled` or `dpm_automation_level` is omitted. Take note of the defaults
|
|
120
125
|
for both options.
|
|
121
|
-
:param pulumi.Input[bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
126
|
+
:param pulumi.Input[_builtins.bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
122
127
|
`false`.
|
|
123
|
-
:param pulumi.Input[str] host_system_id: The managed object ID of the host.
|
|
128
|
+
:param pulumi.Input[_builtins.str] host_system_id: The managed object ID of the host.
|
|
124
129
|
"""
|
|
125
130
|
if compute_cluster_id is not None:
|
|
126
131
|
pulumi.set(__self__, "compute_cluster_id", compute_cluster_id)
|
|
@@ -131,9 +136,9 @@ class _DpmHostOverrideState:
|
|
|
131
136
|
if host_system_id is not None:
|
|
132
137
|
pulumi.set(__self__, "host_system_id", host_system_id)
|
|
133
138
|
|
|
134
|
-
@property
|
|
139
|
+
@_builtins.property
|
|
135
140
|
@pulumi.getter(name="computeClusterId")
|
|
136
|
-
def compute_cluster_id(self) -> Optional[pulumi.Input[str]]:
|
|
141
|
+
def compute_cluster_id(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
137
142
|
"""
|
|
138
143
|
The managed object reference
|
|
139
144
|
ID of the cluster to put the override in. Forces a new
|
|
@@ -142,12 +147,12 @@ class _DpmHostOverrideState:
|
|
|
142
147
|
return pulumi.get(self, "compute_cluster_id")
|
|
143
148
|
|
|
144
149
|
@compute_cluster_id.setter
|
|
145
|
-
def compute_cluster_id(self, value: Optional[pulumi.Input[str]]):
|
|
150
|
+
def compute_cluster_id(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
146
151
|
pulumi.set(self, "compute_cluster_id", value)
|
|
147
152
|
|
|
148
|
-
@property
|
|
153
|
+
@_builtins.property
|
|
149
154
|
@pulumi.getter(name="dpmAutomationLevel")
|
|
150
|
-
def dpm_automation_level(self) -> Optional[pulumi.Input[str]]:
|
|
155
|
+
def dpm_automation_level(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
151
156
|
"""
|
|
152
157
|
The automation level for host power
|
|
153
158
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
@@ -160,12 +165,12 @@ class _DpmHostOverrideState:
|
|
|
160
165
|
return pulumi.get(self, "dpm_automation_level")
|
|
161
166
|
|
|
162
167
|
@dpm_automation_level.setter
|
|
163
|
-
def dpm_automation_level(self, value: Optional[pulumi.Input[str]]):
|
|
168
|
+
def dpm_automation_level(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
164
169
|
pulumi.set(self, "dpm_automation_level", value)
|
|
165
170
|
|
|
166
|
-
@property
|
|
171
|
+
@_builtins.property
|
|
167
172
|
@pulumi.getter(name="dpmEnabled")
|
|
168
|
-
def dpm_enabled(self) -> Optional[pulumi.Input[bool]]:
|
|
173
|
+
def dpm_enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
|
|
169
174
|
"""
|
|
170
175
|
Enable DPM support for this host. Default:
|
|
171
176
|
`false`.
|
|
@@ -173,49 +178,122 @@ class _DpmHostOverrideState:
|
|
|
173
178
|
return pulumi.get(self, "dpm_enabled")
|
|
174
179
|
|
|
175
180
|
@dpm_enabled.setter
|
|
176
|
-
def dpm_enabled(self, value: Optional[pulumi.Input[bool]]):
|
|
181
|
+
def dpm_enabled(self, value: Optional[pulumi.Input[_builtins.bool]]):
|
|
177
182
|
pulumi.set(self, "dpm_enabled", value)
|
|
178
183
|
|
|
179
|
-
@property
|
|
184
|
+
@_builtins.property
|
|
180
185
|
@pulumi.getter(name="hostSystemId")
|
|
181
|
-
def host_system_id(self) -> Optional[pulumi.Input[str]]:
|
|
186
|
+
def host_system_id(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
182
187
|
"""
|
|
183
188
|
The managed object ID of the host.
|
|
184
189
|
"""
|
|
185
190
|
return pulumi.get(self, "host_system_id")
|
|
186
191
|
|
|
187
192
|
@host_system_id.setter
|
|
188
|
-
def host_system_id(self, value: Optional[pulumi.Input[str]]):
|
|
193
|
+
def host_system_id(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
189
194
|
pulumi.set(self, "host_system_id", value)
|
|
190
195
|
|
|
191
196
|
|
|
197
|
+
@pulumi.type_token("vsphere:index/dpmHostOverride:DpmHostOverride")
|
|
192
198
|
class DpmHostOverride(pulumi.CustomResource):
|
|
193
199
|
@overload
|
|
194
200
|
def __init__(__self__,
|
|
195
201
|
resource_name: str,
|
|
196
202
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
197
|
-
compute_cluster_id: Optional[pulumi.Input[str]] = None,
|
|
198
|
-
dpm_automation_level: Optional[pulumi.Input[str]] = None,
|
|
199
|
-
dpm_enabled: Optional[pulumi.Input[bool]] = None,
|
|
200
|
-
host_system_id: Optional[pulumi.Input[str]] = None,
|
|
203
|
+
compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
204
|
+
dpm_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
|
|
205
|
+
dpm_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
|
|
206
|
+
host_system_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
201
207
|
__props__=None):
|
|
202
208
|
"""
|
|
203
|
-
|
|
209
|
+
The `DpmHostOverride` resource can be used to add a DPM override to a
|
|
210
|
+
cluster for a particular host. This allows you to control the power management
|
|
211
|
+
settings for individual hosts in the cluster while leaving any unspecified ones
|
|
212
|
+
at the default power management settings.
|
|
213
|
+
|
|
214
|
+
For more information on DPM within vSphere clusters, see [this
|
|
215
|
+
page][ref-vsphere-cluster-dpm].
|
|
216
|
+
|
|
217
|
+
[ref-vsphere-cluster-dpm]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/using-drs-clusters-to-manage-resources/managing-power-resources.html
|
|
218
|
+
|
|
219
|
+
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
220
|
+
connections.
|
|
221
|
+
|
|
222
|
+
## Example Usage
|
|
223
|
+
|
|
224
|
+
The following example creates a compute cluster comprised of three hosts,
|
|
225
|
+
making use of the
|
|
226
|
+
`ComputeCluster` resource. DPM
|
|
227
|
+
will be disabled in the cluster as it is the default setting, but we override
|
|
228
|
+
the setting of the first host referenced by the
|
|
229
|
+
`Host` data source (`esxi1`) by using
|
|
230
|
+
the `DpmHostOverride` resource so it will be powered off when the
|
|
231
|
+
cluster does not need it to service virtual machines.
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
import pulumi
|
|
235
|
+
import pulumi_vsphere as vsphere
|
|
236
|
+
|
|
237
|
+
config = pulumi.Config()
|
|
238
|
+
datacenter = config.get("datacenter")
|
|
239
|
+
if datacenter is None:
|
|
240
|
+
datacenter = "dc-01"
|
|
241
|
+
hosts = config.get_object("hosts")
|
|
242
|
+
if hosts is None:
|
|
243
|
+
hosts = [
|
|
244
|
+
"esxi-01.example.com",
|
|
245
|
+
"esxi-02.example.com",
|
|
246
|
+
"esxi-03.example.com",
|
|
247
|
+
]
|
|
248
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
249
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
250
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
251
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
252
|
+
name="compute-cluster-test",
|
|
253
|
+
datacenter_id=dc["id"],
|
|
254
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
255
|
+
drs_enabled=True,
|
|
256
|
+
drs_automation_level="fullyAutomated")
|
|
257
|
+
dpm_host_override = vsphere.DpmHostOverride("dpm_host_override",
|
|
258
|
+
compute_cluster_id=compute_cluster.id,
|
|
259
|
+
host_system_id=hosts_get_host[0].id,
|
|
260
|
+
dpm_enabled=True,
|
|
261
|
+
dpm_automation_level="automated")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Import
|
|
265
|
+
|
|
266
|
+
An existing override can be imported into this resource by
|
|
267
|
+
|
|
268
|
+
supplying both the path to the cluster, and the path to the host, to `terraform
|
|
269
|
+
|
|
270
|
+
import`. If no override exists, an error will be given. An example is below:
|
|
271
|
+
|
|
272
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
273
|
+
|
|
274
|
+
```sh
|
|
275
|
+
$ pulumi import vsphere:index/dpmHostOverride:DpmHostOverride dpm_host_override \\
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
'{"compute_cluster_path": "/dc1/host/cluster1", \\
|
|
279
|
+
|
|
280
|
+
"host_path": "/dc1/host/esxi1"}'
|
|
281
|
+
|
|
204
282
|
:param str resource_name: The name of the resource.
|
|
205
283
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
206
|
-
:param pulumi.Input[str] compute_cluster_id: The managed object reference
|
|
284
|
+
:param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
|
|
207
285
|
ID of the cluster to put the override in. Forces a new
|
|
208
286
|
resource if changed.
|
|
209
|
-
:param pulumi.Input[str] dpm_automation_level: The automation level for host power
|
|
287
|
+
:param pulumi.Input[_builtins.str] dpm_automation_level: The automation level for host power
|
|
210
288
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
211
289
|
`manual`.
|
|
212
290
|
|
|
213
291
|
> **NOTE:** Using this resource _always_ implies an override, even if one of
|
|
214
292
|
`dpm_enabled` or `dpm_automation_level` is omitted. Take note of the defaults
|
|
215
293
|
for both options.
|
|
216
|
-
:param pulumi.Input[bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
294
|
+
:param pulumi.Input[_builtins.bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
217
295
|
`false`.
|
|
218
|
-
:param pulumi.Input[str] host_system_id: The managed object ID of the host.
|
|
296
|
+
:param pulumi.Input[_builtins.str] host_system_id: The managed object ID of the host.
|
|
219
297
|
"""
|
|
220
298
|
...
|
|
221
299
|
@overload
|
|
@@ -224,7 +302,79 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
224
302
|
args: DpmHostOverrideArgs,
|
|
225
303
|
opts: Optional[pulumi.ResourceOptions] = None):
|
|
226
304
|
"""
|
|
227
|
-
|
|
305
|
+
The `DpmHostOverride` resource can be used to add a DPM override to a
|
|
306
|
+
cluster for a particular host. This allows you to control the power management
|
|
307
|
+
settings for individual hosts in the cluster while leaving any unspecified ones
|
|
308
|
+
at the default power management settings.
|
|
309
|
+
|
|
310
|
+
For more information on DPM within vSphere clusters, see [this
|
|
311
|
+
page][ref-vsphere-cluster-dpm].
|
|
312
|
+
|
|
313
|
+
[ref-vsphere-cluster-dpm]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/using-drs-clusters-to-manage-resources/managing-power-resources.html
|
|
314
|
+
|
|
315
|
+
> **NOTE:** This resource requires vCenter and is not available on direct ESXi
|
|
316
|
+
connections.
|
|
317
|
+
|
|
318
|
+
## Example Usage
|
|
319
|
+
|
|
320
|
+
The following example creates a compute cluster comprised of three hosts,
|
|
321
|
+
making use of the
|
|
322
|
+
`ComputeCluster` resource. DPM
|
|
323
|
+
will be disabled in the cluster as it is the default setting, but we override
|
|
324
|
+
the setting of the first host referenced by the
|
|
325
|
+
`Host` data source (`esxi1`) by using
|
|
326
|
+
the `DpmHostOverride` resource so it will be powered off when the
|
|
327
|
+
cluster does not need it to service virtual machines.
|
|
328
|
+
|
|
329
|
+
```python
|
|
330
|
+
import pulumi
|
|
331
|
+
import pulumi_vsphere as vsphere
|
|
332
|
+
|
|
333
|
+
config = pulumi.Config()
|
|
334
|
+
datacenter = config.get("datacenter")
|
|
335
|
+
if datacenter is None:
|
|
336
|
+
datacenter = "dc-01"
|
|
337
|
+
hosts = config.get_object("hosts")
|
|
338
|
+
if hosts is None:
|
|
339
|
+
hosts = [
|
|
340
|
+
"esxi-01.example.com",
|
|
341
|
+
"esxi-02.example.com",
|
|
342
|
+
"esxi-03.example.com",
|
|
343
|
+
]
|
|
344
|
+
datacenter_get_datacenter = vsphere.get_datacenter(name=datacenter)
|
|
345
|
+
hosts_get_host = [vsphere.get_host(name=hosts[__index],
|
|
346
|
+
datacenter_id=datacenter_get_datacenter.id) for __index in range(len(hosts))]
|
|
347
|
+
compute_cluster = vsphere.ComputeCluster("compute_cluster",
|
|
348
|
+
name="compute-cluster-test",
|
|
349
|
+
datacenter_id=dc["id"],
|
|
350
|
+
host_system_ids=[[__item.id for __item in hosts_get_host]],
|
|
351
|
+
drs_enabled=True,
|
|
352
|
+
drs_automation_level="fullyAutomated")
|
|
353
|
+
dpm_host_override = vsphere.DpmHostOverride("dpm_host_override",
|
|
354
|
+
compute_cluster_id=compute_cluster.id,
|
|
355
|
+
host_system_id=hosts_get_host[0].id,
|
|
356
|
+
dpm_enabled=True,
|
|
357
|
+
dpm_automation_level="automated")
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Import
|
|
361
|
+
|
|
362
|
+
An existing override can be imported into this resource by
|
|
363
|
+
|
|
364
|
+
supplying both the path to the cluster, and the path to the host, to `terraform
|
|
365
|
+
|
|
366
|
+
import`. If no override exists, an error will be given. An example is below:
|
|
367
|
+
|
|
368
|
+
[docs-import]: https://developer.hashicorp.com/terraform/cli/import
|
|
369
|
+
|
|
370
|
+
```sh
|
|
371
|
+
$ pulumi import vsphere:index/dpmHostOverride:DpmHostOverride dpm_host_override \\
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
'{"compute_cluster_path": "/dc1/host/cluster1", \\
|
|
375
|
+
|
|
376
|
+
"host_path": "/dc1/host/esxi1"}'
|
|
377
|
+
|
|
228
378
|
:param str resource_name: The name of the resource.
|
|
229
379
|
:param DpmHostOverrideArgs args: The arguments to use to populate this resource's properties.
|
|
230
380
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
@@ -240,10 +390,10 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
240
390
|
def _internal_init(__self__,
|
|
241
391
|
resource_name: str,
|
|
242
392
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
243
|
-
compute_cluster_id: Optional[pulumi.Input[str]] = None,
|
|
244
|
-
dpm_automation_level: Optional[pulumi.Input[str]] = None,
|
|
245
|
-
dpm_enabled: Optional[pulumi.Input[bool]] = None,
|
|
246
|
-
host_system_id: Optional[pulumi.Input[str]] = None,
|
|
393
|
+
compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
394
|
+
dpm_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
|
|
395
|
+
dpm_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
|
|
396
|
+
host_system_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
247
397
|
__props__=None):
|
|
248
398
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
249
399
|
if not isinstance(opts, pulumi.ResourceOptions):
|
|
@@ -271,10 +421,10 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
271
421
|
def get(resource_name: str,
|
|
272
422
|
id: pulumi.Input[str],
|
|
273
423
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
274
|
-
compute_cluster_id: Optional[pulumi.Input[str]] = None,
|
|
275
|
-
dpm_automation_level: Optional[pulumi.Input[str]] = None,
|
|
276
|
-
dpm_enabled: Optional[pulumi.Input[bool]] = None,
|
|
277
|
-
host_system_id: Optional[pulumi.Input[str]] = None) -> 'DpmHostOverride':
|
|
424
|
+
compute_cluster_id: Optional[pulumi.Input[_builtins.str]] = None,
|
|
425
|
+
dpm_automation_level: Optional[pulumi.Input[_builtins.str]] = None,
|
|
426
|
+
dpm_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
|
|
427
|
+
host_system_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'DpmHostOverride':
|
|
278
428
|
"""
|
|
279
429
|
Get an existing DpmHostOverride resource's state with the given name, id, and optional extra
|
|
280
430
|
properties used to qualify the lookup.
|
|
@@ -282,19 +432,19 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
282
432
|
:param str resource_name: The unique name of the resulting resource.
|
|
283
433
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
|
284
434
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
285
|
-
:param pulumi.Input[str] compute_cluster_id: The managed object reference
|
|
435
|
+
:param pulumi.Input[_builtins.str] compute_cluster_id: The managed object reference
|
|
286
436
|
ID of the cluster to put the override in. Forces a new
|
|
287
437
|
resource if changed.
|
|
288
|
-
:param pulumi.Input[str] dpm_automation_level: The automation level for host power
|
|
438
|
+
:param pulumi.Input[_builtins.str] dpm_automation_level: The automation level for host power
|
|
289
439
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
290
440
|
`manual`.
|
|
291
441
|
|
|
292
442
|
> **NOTE:** Using this resource _always_ implies an override, even if one of
|
|
293
443
|
`dpm_enabled` or `dpm_automation_level` is omitted. Take note of the defaults
|
|
294
444
|
for both options.
|
|
295
|
-
:param pulumi.Input[bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
445
|
+
:param pulumi.Input[_builtins.bool] dpm_enabled: Enable DPM support for this host. Default:
|
|
296
446
|
`false`.
|
|
297
|
-
:param pulumi.Input[str] host_system_id: The managed object ID of the host.
|
|
447
|
+
:param pulumi.Input[_builtins.str] host_system_id: The managed object ID of the host.
|
|
298
448
|
"""
|
|
299
449
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
300
450
|
|
|
@@ -306,9 +456,9 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
306
456
|
__props__.__dict__["host_system_id"] = host_system_id
|
|
307
457
|
return DpmHostOverride(resource_name, opts=opts, __props__=__props__)
|
|
308
458
|
|
|
309
|
-
@property
|
|
459
|
+
@_builtins.property
|
|
310
460
|
@pulumi.getter(name="computeClusterId")
|
|
311
|
-
def compute_cluster_id(self) -> pulumi.Output[str]:
|
|
461
|
+
def compute_cluster_id(self) -> pulumi.Output[_builtins.str]:
|
|
312
462
|
"""
|
|
313
463
|
The managed object reference
|
|
314
464
|
ID of the cluster to put the override in. Forces a new
|
|
@@ -316,9 +466,9 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
316
466
|
"""
|
|
317
467
|
return pulumi.get(self, "compute_cluster_id")
|
|
318
468
|
|
|
319
|
-
@property
|
|
469
|
+
@_builtins.property
|
|
320
470
|
@pulumi.getter(name="dpmAutomationLevel")
|
|
321
|
-
def dpm_automation_level(self) -> pulumi.Output[Optional[str]]:
|
|
471
|
+
def dpm_automation_level(self) -> pulumi.Output[Optional[_builtins.str]]:
|
|
322
472
|
"""
|
|
323
473
|
The automation level for host power
|
|
324
474
|
operations on this host. Can be one of `manual` or `automated`. Default:
|
|
@@ -330,18 +480,18 @@ class DpmHostOverride(pulumi.CustomResource):
|
|
|
330
480
|
"""
|
|
331
481
|
return pulumi.get(self, "dpm_automation_level")
|
|
332
482
|
|
|
333
|
-
@property
|
|
483
|
+
@_builtins.property
|
|
334
484
|
@pulumi.getter(name="dpmEnabled")
|
|
335
|
-
def dpm_enabled(self) -> pulumi.Output[Optional[bool]]:
|
|
485
|
+
def dpm_enabled(self) -> pulumi.Output[Optional[_builtins.bool]]:
|
|
336
486
|
"""
|
|
337
487
|
Enable DPM support for this host. Default:
|
|
338
488
|
`false`.
|
|
339
489
|
"""
|
|
340
490
|
return pulumi.get(self, "dpm_enabled")
|
|
341
491
|
|
|
342
|
-
@property
|
|
492
|
+
@_builtins.property
|
|
343
493
|
@pulumi.getter(name="hostSystemId")
|
|
344
|
-
def host_system_id(self) -> pulumi.Output[str]:
|
|
494
|
+
def host_system_id(self) -> pulumi.Output[_builtins.str]:
|
|
345
495
|
"""
|
|
346
496
|
The managed object ID of the host.
|
|
347
497
|
"""
|