ResourcePool
The vsphere..ResourcePool resource can be used to create and manage
resource pools in standalone hosts or on compute clusters.
For more information on vSphere resource pools, see this page.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var datacenter = config.Get("datacenter") ?? "dc1";
var cluster = config.Get("cluster") ?? "cluster1";
var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = datacenter,
}));
var computeCluster = dc.Apply(dc => Output.Create(VSphere.GetComputeCluster.InvokeAsync(new VSphere.GetComputeClusterArgs
{
DatacenterId = dc.Id,
Name = cluster,
})));
var resourcePool = new VSphere.ResourcePool("resourcePool", new VSphere.ResourcePoolArgs
{
ParentResourcePoolId = computeCluster.Apply(computeCluster => computeCluster.ResourcePoolId),
});
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
config = pulumi.Config()
datacenter = config.get("datacenter")
if datacenter is None:
datacenter = "dc1"
cluster = config.get("cluster")
if cluster is None:
cluster = "cluster1"
dc = vsphere.get_datacenter(name=datacenter)
compute_cluster = vsphere.get_compute_cluster(datacenter_id=dc.id,
name=cluster)
resource_pool = vsphere.ResourcePool("resourcePool", parent_resource_pool_id=compute_cluster.resource_pool_id)import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const config = new pulumi.Config();
const datacenter = config.get("datacenter") || "dc1";
const cluster = config.get("cluster") || "cluster1";
const dc = pulumi.output(vsphere.getDatacenter({
name: datacenter,
}, { async: true }));
const computeCluster = dc.apply(dc => vsphere.getComputeCluster({
datacenterId: dc.id,
name: cluster,
}, { async: true }));
const resourcePool = new vsphere.ResourcePool("resource_pool", {
parentResourcePoolId: computeCluster.resourcePoolId,
});Create a ResourcePool Resource
new ResourcePool(name: string, args: ResourcePoolArgs, opts?: CustomResourceOptions);def ResourcePool(resource_name, opts=None, cpu_expandable=None, cpu_limit=None, cpu_reservation=None, cpu_share_level=None, cpu_shares=None, custom_attributes=None, memory_expandable=None, memory_limit=None, memory_reservation=None, memory_share_level=None, memory_shares=None, name=None, parent_resource_pool_id=None, tags=None, __props__=None);func NewResourcePool(ctx *Context, name string, args ResourcePoolArgs, opts ...ResourceOption) (*ResourcePool, error)public ResourcePool(string name, ResourcePoolArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ResourcePoolArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ResourcePoolArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourcePoolArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ResourcePool Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ResourcePool resource accepts the following input properties:
- Parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- Cpu
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Cpu
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Cpu
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- Custom
Attributes Dictionary<string, string> A list of custom attributes to set on this resource.
- Memory
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Memory
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Memory
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- Name string
The name of the resource pool.
- List<string>
The IDs of any tags to attach to this resource.
- Parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- Cpu
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Cpu
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Cpu
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- Custom
Attributes map[string]string A list of custom attributes to set on this resource.
- Memory
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Memory
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Memory
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- Name string
The name of the resource pool.
- []string
The IDs of any tags to attach to this resource.
- parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- cpu
Expandable boolean Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- cpu
Limit number The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- cpu
Reservation number Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- number
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- custom
Attributes {[key: string]: string} A list of custom attributes to set on this resource.
- memory
Expandable boolean Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- memory
Limit number The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- memory
Reservation number Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- number
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- name string
The name of the resource pool.
- string[]
The IDs of any tags to attach to this resource.
- parent_
resource_ strpool_ id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- cpu_
expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- cpu_
limit float The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- cpu_
reservation float Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- str
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- float
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- custom_
attributes Dict[str, str] A list of custom attributes to set on this resource.
- memory_
expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- memory_
limit float The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- memory_
reservation float Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- str
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- float
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- name str
The name of the resource pool.
- List[str]
The IDs of any tags to attach to this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourcePool resource produces the following output properties:
Look up an Existing ResourcePool Resource
Get an existing ResourcePool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ResourcePoolState, opts?: CustomResourceOptions): ResourcePoolstatic get(resource_name, id, opts=None, cpu_expandable=None, cpu_limit=None, cpu_reservation=None, cpu_share_level=None, cpu_shares=None, custom_attributes=None, memory_expandable=None, memory_limit=None, memory_reservation=None, memory_share_level=None, memory_shares=None, name=None, parent_resource_pool_id=None, tags=None, __props__=None);func GetResourcePool(ctx *Context, name string, id IDInput, state *ResourcePoolState, opts ...ResourceOption) (*ResourcePool, error)public static ResourcePool Get(string name, Input<string> id, ResourcePoolState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Cpu
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Cpu
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Cpu
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- Custom
Attributes Dictionary<string, string> A list of custom attributes to set on this resource.
- Memory
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Memory
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Memory
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- Name string
The name of the resource pool.
- Parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- List<string>
The IDs of any tags to attach to this resource.
- Cpu
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Cpu
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Cpu
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- Custom
Attributes map[string]string A list of custom attributes to set on this resource.
- Memory
Expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- Memory
Limit int The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- Memory
Reservation int Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- int
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- Name string
The name of the resource pool.
- Parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- []string
The IDs of any tags to attach to this resource.
- cpu
Expandable boolean Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- cpu
Limit number The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- cpu
Reservation number Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- number
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- custom
Attributes {[key: string]: string} A list of custom attributes to set on this resource.
- memory
Expandable boolean Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- memory
Limit number The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- memory
Reservation number Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- string
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- number
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- name string
The name of the resource pool.
- parent
Resource stringPool Id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- string[]
The IDs of any tags to attach to this resource.
- cpu_
expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- cpu_
limit float The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- cpu_
reservation float Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- str
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values incpu_shareswill be ignored. Default:normal- float
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
cpu_share_levelmust becustom.- custom_
attributes Dict[str, str] A list of custom attributes to set on this resource.
- memory_
expandable bool Determines if the reservation on a resource pool can grow beyond the specified value if the parent resource pool has unreserved resources. Default:
true- memory_
limit float The CPU utilization of a resource pool will not exceed this limit, even if there are available resources. Set to
-1for unlimited. Default:-1- memory_
reservation float Amount of CPU (MHz) that is guaranteed available to the resource pool. Default:
0- str
The CPU allocation level. The level is a simplified view of shares. Levels map to a pre-determined set of numeric values for shares. Can be one of
low,normal,high, orcustom. Whenlow,normal, orhighare specified values inmemory_shareswill be ignored. Default:normal- float
The number of shares allocated for CPU. Used to determine resource allocation in case of resource contention. If this is set,
memory_share_levelmust becustom.- name str
The name of the resource pool.
- parent_
resource_ strpool_ id The managed object ID of the parent resource pool. This can be the root resource pool for a cluster or standalone host, or a resource pool itself. When moving a resource pool from one parent resource pool to another, both must share a common root resource pool or the move will fail.
- List[str]
The IDs of any tags to attach to this resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.