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
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import builtins as _builtins
|
|
6
|
+
import warnings
|
|
7
|
+
import sys
|
|
8
|
+
import pulumi
|
|
9
|
+
import pulumi.runtime
|
|
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
|
|
15
|
+
from . import _utilities
|
|
16
|
+
|
|
17
|
+
__all__ = ['VirtualMachineClassArgs', 'VirtualMachineClass']
|
|
18
|
+
|
|
19
|
+
@pulumi.input_type
|
|
20
|
+
class VirtualMachineClassArgs:
|
|
21
|
+
def __init__(__self__, *,
|
|
22
|
+
cpus: pulumi.Input[_builtins.int],
|
|
23
|
+
memory: pulumi.Input[_builtins.int],
|
|
24
|
+
cpu_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
25
|
+
memory_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
26
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
27
|
+
vgpu_devices: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None):
|
|
28
|
+
"""
|
|
29
|
+
The set of arguments for constructing a VirtualMachineClass resource.
|
|
30
|
+
:param pulumi.Input[_builtins.int] cpus: The number of CPUs.
|
|
31
|
+
:param pulumi.Input[_builtins.int] memory: The amount of memory in MB.
|
|
32
|
+
:param pulumi.Input[_builtins.int] cpu_reservation: The percentage of the available CPU capacity which will be reserved.
|
|
33
|
+
:param pulumi.Input[_builtins.int] memory_reservation: The percentage of memory reservation.
|
|
34
|
+
:param pulumi.Input[_builtins.str] name: The name for the class.
|
|
35
|
+
:param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] vgpu_devices: The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
36
|
+
"""
|
|
37
|
+
pulumi.set(__self__, "cpus", cpus)
|
|
38
|
+
pulumi.set(__self__, "memory", memory)
|
|
39
|
+
if cpu_reservation is not None:
|
|
40
|
+
pulumi.set(__self__, "cpu_reservation", cpu_reservation)
|
|
41
|
+
if memory_reservation is not None:
|
|
42
|
+
pulumi.set(__self__, "memory_reservation", memory_reservation)
|
|
43
|
+
if name is not None:
|
|
44
|
+
pulumi.set(__self__, "name", name)
|
|
45
|
+
if vgpu_devices is not None:
|
|
46
|
+
pulumi.set(__self__, "vgpu_devices", vgpu_devices)
|
|
47
|
+
|
|
48
|
+
@_builtins.property
|
|
49
|
+
@pulumi.getter
|
|
50
|
+
def cpus(self) -> pulumi.Input[_builtins.int]:
|
|
51
|
+
"""
|
|
52
|
+
The number of CPUs.
|
|
53
|
+
"""
|
|
54
|
+
return pulumi.get(self, "cpus")
|
|
55
|
+
|
|
56
|
+
@cpus.setter
|
|
57
|
+
def cpus(self, value: pulumi.Input[_builtins.int]):
|
|
58
|
+
pulumi.set(self, "cpus", value)
|
|
59
|
+
|
|
60
|
+
@_builtins.property
|
|
61
|
+
@pulumi.getter
|
|
62
|
+
def memory(self) -> pulumi.Input[_builtins.int]:
|
|
63
|
+
"""
|
|
64
|
+
The amount of memory in MB.
|
|
65
|
+
"""
|
|
66
|
+
return pulumi.get(self, "memory")
|
|
67
|
+
|
|
68
|
+
@memory.setter
|
|
69
|
+
def memory(self, value: pulumi.Input[_builtins.int]):
|
|
70
|
+
pulumi.set(self, "memory", value)
|
|
71
|
+
|
|
72
|
+
@_builtins.property
|
|
73
|
+
@pulumi.getter(name="cpuReservation")
|
|
74
|
+
def cpu_reservation(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
75
|
+
"""
|
|
76
|
+
The percentage of the available CPU capacity which will be reserved.
|
|
77
|
+
"""
|
|
78
|
+
return pulumi.get(self, "cpu_reservation")
|
|
79
|
+
|
|
80
|
+
@cpu_reservation.setter
|
|
81
|
+
def cpu_reservation(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
82
|
+
pulumi.set(self, "cpu_reservation", value)
|
|
83
|
+
|
|
84
|
+
@_builtins.property
|
|
85
|
+
@pulumi.getter(name="memoryReservation")
|
|
86
|
+
def memory_reservation(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
87
|
+
"""
|
|
88
|
+
The percentage of memory reservation.
|
|
89
|
+
"""
|
|
90
|
+
return pulumi.get(self, "memory_reservation")
|
|
91
|
+
|
|
92
|
+
@memory_reservation.setter
|
|
93
|
+
def memory_reservation(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
94
|
+
pulumi.set(self, "memory_reservation", value)
|
|
95
|
+
|
|
96
|
+
@_builtins.property
|
|
97
|
+
@pulumi.getter
|
|
98
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
99
|
+
"""
|
|
100
|
+
The name for the class.
|
|
101
|
+
"""
|
|
102
|
+
return pulumi.get(self, "name")
|
|
103
|
+
|
|
104
|
+
@name.setter
|
|
105
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
106
|
+
pulumi.set(self, "name", value)
|
|
107
|
+
|
|
108
|
+
@_builtins.property
|
|
109
|
+
@pulumi.getter(name="vgpuDevices")
|
|
110
|
+
def vgpu_devices(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
|
|
111
|
+
"""
|
|
112
|
+
The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
113
|
+
"""
|
|
114
|
+
return pulumi.get(self, "vgpu_devices")
|
|
115
|
+
|
|
116
|
+
@vgpu_devices.setter
|
|
117
|
+
def vgpu_devices(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
|
|
118
|
+
pulumi.set(self, "vgpu_devices", value)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@pulumi.input_type
|
|
122
|
+
class _VirtualMachineClassState:
|
|
123
|
+
def __init__(__self__, *,
|
|
124
|
+
cpu_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
125
|
+
cpus: Optional[pulumi.Input[_builtins.int]] = None,
|
|
126
|
+
memory: Optional[pulumi.Input[_builtins.int]] = None,
|
|
127
|
+
memory_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
128
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
129
|
+
vgpu_devices: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None):
|
|
130
|
+
"""
|
|
131
|
+
Input properties used for looking up and filtering VirtualMachineClass resources.
|
|
132
|
+
:param pulumi.Input[_builtins.int] cpu_reservation: The percentage of the available CPU capacity which will be reserved.
|
|
133
|
+
:param pulumi.Input[_builtins.int] cpus: The number of CPUs.
|
|
134
|
+
:param pulumi.Input[_builtins.int] memory: The amount of memory in MB.
|
|
135
|
+
:param pulumi.Input[_builtins.int] memory_reservation: The percentage of memory reservation.
|
|
136
|
+
:param pulumi.Input[_builtins.str] name: The name for the class.
|
|
137
|
+
:param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] vgpu_devices: The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
138
|
+
"""
|
|
139
|
+
if cpu_reservation is not None:
|
|
140
|
+
pulumi.set(__self__, "cpu_reservation", cpu_reservation)
|
|
141
|
+
if cpus is not None:
|
|
142
|
+
pulumi.set(__self__, "cpus", cpus)
|
|
143
|
+
if memory is not None:
|
|
144
|
+
pulumi.set(__self__, "memory", memory)
|
|
145
|
+
if memory_reservation is not None:
|
|
146
|
+
pulumi.set(__self__, "memory_reservation", memory_reservation)
|
|
147
|
+
if name is not None:
|
|
148
|
+
pulumi.set(__self__, "name", name)
|
|
149
|
+
if vgpu_devices is not None:
|
|
150
|
+
pulumi.set(__self__, "vgpu_devices", vgpu_devices)
|
|
151
|
+
|
|
152
|
+
@_builtins.property
|
|
153
|
+
@pulumi.getter(name="cpuReservation")
|
|
154
|
+
def cpu_reservation(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
155
|
+
"""
|
|
156
|
+
The percentage of the available CPU capacity which will be reserved.
|
|
157
|
+
"""
|
|
158
|
+
return pulumi.get(self, "cpu_reservation")
|
|
159
|
+
|
|
160
|
+
@cpu_reservation.setter
|
|
161
|
+
def cpu_reservation(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
162
|
+
pulumi.set(self, "cpu_reservation", value)
|
|
163
|
+
|
|
164
|
+
@_builtins.property
|
|
165
|
+
@pulumi.getter
|
|
166
|
+
def cpus(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
167
|
+
"""
|
|
168
|
+
The number of CPUs.
|
|
169
|
+
"""
|
|
170
|
+
return pulumi.get(self, "cpus")
|
|
171
|
+
|
|
172
|
+
@cpus.setter
|
|
173
|
+
def cpus(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
174
|
+
pulumi.set(self, "cpus", value)
|
|
175
|
+
|
|
176
|
+
@_builtins.property
|
|
177
|
+
@pulumi.getter
|
|
178
|
+
def memory(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
179
|
+
"""
|
|
180
|
+
The amount of memory in MB.
|
|
181
|
+
"""
|
|
182
|
+
return pulumi.get(self, "memory")
|
|
183
|
+
|
|
184
|
+
@memory.setter
|
|
185
|
+
def memory(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
186
|
+
pulumi.set(self, "memory", value)
|
|
187
|
+
|
|
188
|
+
@_builtins.property
|
|
189
|
+
@pulumi.getter(name="memoryReservation")
|
|
190
|
+
def memory_reservation(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
191
|
+
"""
|
|
192
|
+
The percentage of memory reservation.
|
|
193
|
+
"""
|
|
194
|
+
return pulumi.get(self, "memory_reservation")
|
|
195
|
+
|
|
196
|
+
@memory_reservation.setter
|
|
197
|
+
def memory_reservation(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
198
|
+
pulumi.set(self, "memory_reservation", value)
|
|
199
|
+
|
|
200
|
+
@_builtins.property
|
|
201
|
+
@pulumi.getter
|
|
202
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
203
|
+
"""
|
|
204
|
+
The name for the class.
|
|
205
|
+
"""
|
|
206
|
+
return pulumi.get(self, "name")
|
|
207
|
+
|
|
208
|
+
@name.setter
|
|
209
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
210
|
+
pulumi.set(self, "name", value)
|
|
211
|
+
|
|
212
|
+
@_builtins.property
|
|
213
|
+
@pulumi.getter(name="vgpuDevices")
|
|
214
|
+
def vgpu_devices(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
|
|
215
|
+
"""
|
|
216
|
+
The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
217
|
+
"""
|
|
218
|
+
return pulumi.get(self, "vgpu_devices")
|
|
219
|
+
|
|
220
|
+
@vgpu_devices.setter
|
|
221
|
+
def vgpu_devices(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]):
|
|
222
|
+
pulumi.set(self, "vgpu_devices", value)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
@pulumi.type_token("vsphere:index/virtualMachineClass:VirtualMachineClass")
|
|
226
|
+
class VirtualMachineClass(pulumi.CustomResource):
|
|
227
|
+
@overload
|
|
228
|
+
def __init__(__self__,
|
|
229
|
+
resource_name: str,
|
|
230
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
|
231
|
+
cpu_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
232
|
+
cpus: Optional[pulumi.Input[_builtins.int]] = None,
|
|
233
|
+
memory: Optional[pulumi.Input[_builtins.int]] = None,
|
|
234
|
+
memory_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
235
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
236
|
+
vgpu_devices: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
|
|
237
|
+
__props__=None):
|
|
238
|
+
"""
|
|
239
|
+
Provides a resource for configuring a Virtual Machine class.
|
|
240
|
+
|
|
241
|
+
## Example Usage
|
|
242
|
+
|
|
243
|
+
### S
|
|
244
|
+
|
|
245
|
+
### Create a Basic Class
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
import pulumi
|
|
249
|
+
import pulumi_vsphere as vsphere
|
|
250
|
+
|
|
251
|
+
basic_class = vsphere.VirtualMachineClass("basic_class",
|
|
252
|
+
name="basic-class",
|
|
253
|
+
cpus=4,
|
|
254
|
+
memory=4096)
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Create a Class with a vGPU
|
|
258
|
+
|
|
259
|
+
```python
|
|
260
|
+
import pulumi
|
|
261
|
+
import pulumi_vsphere as vsphere
|
|
262
|
+
|
|
263
|
+
vgp_class = vsphere.VirtualMachineClass("vgp_class",
|
|
264
|
+
name="vgpu-class",
|
|
265
|
+
cpus=4,
|
|
266
|
+
memory=4096,
|
|
267
|
+
memory_reservation=100,
|
|
268
|
+
vgpu_devices=["vgpu1"])
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
:param str resource_name: The name of the resource.
|
|
272
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
273
|
+
:param pulumi.Input[_builtins.int] cpu_reservation: The percentage of the available CPU capacity which will be reserved.
|
|
274
|
+
:param pulumi.Input[_builtins.int] cpus: The number of CPUs.
|
|
275
|
+
:param pulumi.Input[_builtins.int] memory: The amount of memory in MB.
|
|
276
|
+
:param pulumi.Input[_builtins.int] memory_reservation: The percentage of memory reservation.
|
|
277
|
+
:param pulumi.Input[_builtins.str] name: The name for the class.
|
|
278
|
+
:param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] vgpu_devices: The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
279
|
+
"""
|
|
280
|
+
...
|
|
281
|
+
@overload
|
|
282
|
+
def __init__(__self__,
|
|
283
|
+
resource_name: str,
|
|
284
|
+
args: VirtualMachineClassArgs,
|
|
285
|
+
opts: Optional[pulumi.ResourceOptions] = None):
|
|
286
|
+
"""
|
|
287
|
+
Provides a resource for configuring a Virtual Machine class.
|
|
288
|
+
|
|
289
|
+
## Example Usage
|
|
290
|
+
|
|
291
|
+
### S
|
|
292
|
+
|
|
293
|
+
### Create a Basic Class
|
|
294
|
+
|
|
295
|
+
```python
|
|
296
|
+
import pulumi
|
|
297
|
+
import pulumi_vsphere as vsphere
|
|
298
|
+
|
|
299
|
+
basic_class = vsphere.VirtualMachineClass("basic_class",
|
|
300
|
+
name="basic-class",
|
|
301
|
+
cpus=4,
|
|
302
|
+
memory=4096)
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Create a Class with a vGPU
|
|
306
|
+
|
|
307
|
+
```python
|
|
308
|
+
import pulumi
|
|
309
|
+
import pulumi_vsphere as vsphere
|
|
310
|
+
|
|
311
|
+
vgp_class = vsphere.VirtualMachineClass("vgp_class",
|
|
312
|
+
name="vgpu-class",
|
|
313
|
+
cpus=4,
|
|
314
|
+
memory=4096,
|
|
315
|
+
memory_reservation=100,
|
|
316
|
+
vgpu_devices=["vgpu1"])
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
:param str resource_name: The name of the resource.
|
|
320
|
+
:param VirtualMachineClassArgs args: The arguments to use to populate this resource's properties.
|
|
321
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
322
|
+
"""
|
|
323
|
+
...
|
|
324
|
+
def __init__(__self__, resource_name: str, *args, **kwargs):
|
|
325
|
+
resource_args, opts = _utilities.get_resource_args_opts(VirtualMachineClassArgs, pulumi.ResourceOptions, *args, **kwargs)
|
|
326
|
+
if resource_args is not None:
|
|
327
|
+
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
|
|
328
|
+
else:
|
|
329
|
+
__self__._internal_init(resource_name, *args, **kwargs)
|
|
330
|
+
|
|
331
|
+
def _internal_init(__self__,
|
|
332
|
+
resource_name: str,
|
|
333
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
|
334
|
+
cpu_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
335
|
+
cpus: Optional[pulumi.Input[_builtins.int]] = None,
|
|
336
|
+
memory: Optional[pulumi.Input[_builtins.int]] = None,
|
|
337
|
+
memory_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
338
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
339
|
+
vgpu_devices: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
|
|
340
|
+
__props__=None):
|
|
341
|
+
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
342
|
+
if not isinstance(opts, pulumi.ResourceOptions):
|
|
343
|
+
raise TypeError('Expected resource options to be a ResourceOptions instance')
|
|
344
|
+
if opts.id is None:
|
|
345
|
+
if __props__ is not None:
|
|
346
|
+
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
|
|
347
|
+
__props__ = VirtualMachineClassArgs.__new__(VirtualMachineClassArgs)
|
|
348
|
+
|
|
349
|
+
__props__.__dict__["cpu_reservation"] = cpu_reservation
|
|
350
|
+
if cpus is None and not opts.urn:
|
|
351
|
+
raise TypeError("Missing required property 'cpus'")
|
|
352
|
+
__props__.__dict__["cpus"] = cpus
|
|
353
|
+
if memory is None and not opts.urn:
|
|
354
|
+
raise TypeError("Missing required property 'memory'")
|
|
355
|
+
__props__.__dict__["memory"] = memory
|
|
356
|
+
__props__.__dict__["memory_reservation"] = memory_reservation
|
|
357
|
+
__props__.__dict__["name"] = name
|
|
358
|
+
__props__.__dict__["vgpu_devices"] = vgpu_devices
|
|
359
|
+
super(VirtualMachineClass, __self__).__init__(
|
|
360
|
+
'vsphere:index/virtualMachineClass:VirtualMachineClass',
|
|
361
|
+
resource_name,
|
|
362
|
+
__props__,
|
|
363
|
+
opts)
|
|
364
|
+
|
|
365
|
+
@staticmethod
|
|
366
|
+
def get(resource_name: str,
|
|
367
|
+
id: pulumi.Input[str],
|
|
368
|
+
opts: Optional[pulumi.ResourceOptions] = None,
|
|
369
|
+
cpu_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
370
|
+
cpus: Optional[pulumi.Input[_builtins.int]] = None,
|
|
371
|
+
memory: Optional[pulumi.Input[_builtins.int]] = None,
|
|
372
|
+
memory_reservation: Optional[pulumi.Input[_builtins.int]] = None,
|
|
373
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
374
|
+
vgpu_devices: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None) -> 'VirtualMachineClass':
|
|
375
|
+
"""
|
|
376
|
+
Get an existing VirtualMachineClass resource's state with the given name, id, and optional extra
|
|
377
|
+
properties used to qualify the lookup.
|
|
378
|
+
|
|
379
|
+
:param str resource_name: The unique name of the resulting resource.
|
|
380
|
+
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
|
381
|
+
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
382
|
+
:param pulumi.Input[_builtins.int] cpu_reservation: The percentage of the available CPU capacity which will be reserved.
|
|
383
|
+
:param pulumi.Input[_builtins.int] cpus: The number of CPUs.
|
|
384
|
+
:param pulumi.Input[_builtins.int] memory: The amount of memory in MB.
|
|
385
|
+
:param pulumi.Input[_builtins.int] memory_reservation: The percentage of memory reservation.
|
|
386
|
+
:param pulumi.Input[_builtins.str] name: The name for the class.
|
|
387
|
+
:param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] vgpu_devices: The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
388
|
+
"""
|
|
389
|
+
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
390
|
+
|
|
391
|
+
__props__ = _VirtualMachineClassState.__new__(_VirtualMachineClassState)
|
|
392
|
+
|
|
393
|
+
__props__.__dict__["cpu_reservation"] = cpu_reservation
|
|
394
|
+
__props__.__dict__["cpus"] = cpus
|
|
395
|
+
__props__.__dict__["memory"] = memory
|
|
396
|
+
__props__.__dict__["memory_reservation"] = memory_reservation
|
|
397
|
+
__props__.__dict__["name"] = name
|
|
398
|
+
__props__.__dict__["vgpu_devices"] = vgpu_devices
|
|
399
|
+
return VirtualMachineClass(resource_name, opts=opts, __props__=__props__)
|
|
400
|
+
|
|
401
|
+
@_builtins.property
|
|
402
|
+
@pulumi.getter(name="cpuReservation")
|
|
403
|
+
def cpu_reservation(self) -> pulumi.Output[Optional[_builtins.int]]:
|
|
404
|
+
"""
|
|
405
|
+
The percentage of the available CPU capacity which will be reserved.
|
|
406
|
+
"""
|
|
407
|
+
return pulumi.get(self, "cpu_reservation")
|
|
408
|
+
|
|
409
|
+
@_builtins.property
|
|
410
|
+
@pulumi.getter
|
|
411
|
+
def cpus(self) -> pulumi.Output[_builtins.int]:
|
|
412
|
+
"""
|
|
413
|
+
The number of CPUs.
|
|
414
|
+
"""
|
|
415
|
+
return pulumi.get(self, "cpus")
|
|
416
|
+
|
|
417
|
+
@_builtins.property
|
|
418
|
+
@pulumi.getter
|
|
419
|
+
def memory(self) -> pulumi.Output[_builtins.int]:
|
|
420
|
+
"""
|
|
421
|
+
The amount of memory in MB.
|
|
422
|
+
"""
|
|
423
|
+
return pulumi.get(self, "memory")
|
|
424
|
+
|
|
425
|
+
@_builtins.property
|
|
426
|
+
@pulumi.getter(name="memoryReservation")
|
|
427
|
+
def memory_reservation(self) -> pulumi.Output[Optional[_builtins.int]]:
|
|
428
|
+
"""
|
|
429
|
+
The percentage of memory reservation.
|
|
430
|
+
"""
|
|
431
|
+
return pulumi.get(self, "memory_reservation")
|
|
432
|
+
|
|
433
|
+
@_builtins.property
|
|
434
|
+
@pulumi.getter
|
|
435
|
+
def name(self) -> pulumi.Output[_builtins.str]:
|
|
436
|
+
"""
|
|
437
|
+
The name for the class.
|
|
438
|
+
"""
|
|
439
|
+
return pulumi.get(self, "name")
|
|
440
|
+
|
|
441
|
+
@_builtins.property
|
|
442
|
+
@pulumi.getter(name="vgpuDevices")
|
|
443
|
+
def vgpu_devices(self) -> pulumi.Output[Optional[Sequence[_builtins.str]]]:
|
|
444
|
+
"""
|
|
445
|
+
The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100.
|
|
446
|
+
"""
|
|
447
|
+
return pulumi.get(self, "vgpu_devices")
|
|
448
|
+
|