@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
404 lines (403 loc) • 15.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `vsphere.VappContainer` resource can be used to create and manage
* vApps.
*
* For more information on vSphere vApps, see the VMware vSphere [product documentation][ref-vsphere-vapp].
*
* [ref-vsphere-vapp]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-virtual-machine-administration-guide-8-0/managing-multi-tiered-applications-with-vsphere-vapp-in-the-vsphere-web-clientvsphere-vm-admin.html
*
* ## Basic Example
*
* The example below sets up a vSphere vApp container in a compute cluster which uses
* the default settings for CPU and memory reservations, shares, and limits. The compute cluster
* needs to already exist in vSphere.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const computeCluster = datacenter.then(datacenter => vsphere.getComputeCluster({
* name: "cluster-01",
* datacenterId: datacenter.id,
* }));
* const vappContainer = new vsphere.VappContainer("vapp_container", {
* name: "vapp-01",
* parentResourcePoolId: computeCluster.then(computeCluster => computeCluster.resourcePoolId),
* });
* ```
*
* ### Example with a Virtual Machine
*
* The example below builds off the basic example, but includes a virtual machine
* in the new vApp container. To accomplish this, the `resourcePoolId` of the
* virtual machine is set to the `id` of the vApp container.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const computeCluster = datacenter.then(datacenter => vsphere.getComputeCluster({
* name: "cluster-01",
* datacenterId: datacenter.id,
* }));
* const datastore = datacenter.then(datacenter => vsphere.getDatastore({
* name: "datastore-01",
* datacenterId: datacenter.id,
* }));
* const network = datacenter.then(datacenter => vsphere.getNetwork({
* name: "VM Network",
* datacenterId: datacenter.id,
* }));
* const vappContainer = new vsphere.VappContainer("vapp_container", {
* name: "vapp-01",
* parentResourcePoolId: computeCluster.then(computeCluster => computeCluster.resourcePoolId),
* });
* const vm = new vsphere.VirtualMachine("vm", {
* name: "foo",
* resourcePoolId: vappContainerVsphereVappContainer.id,
* datastoreId: datastore.then(datastore => datastore.id),
* numCpus: 1,
* memory: 1024,
* guestId: "ubuntu64Guest",
* networkInterfaces: [{
* networkId: network.then(network => network.id),
* }],
* disks: [{
* label: "disk0",
* size: 20,
* }],
* });
* ```
*
* ## Import
*
* An existing vApp container can be imported into this resource via
*
* the path to the vApp container, using the following command:
*
* [docs-import]: https://developer.hashicorp.com/terraform/cli/import
*
* Example:
*
* ```sh
* $ pulumi import vsphere:index/vappContainer:VappContainer vapp_container /dc-01/host/cluster-01/Resources/resource-pool-01/vapp-01
* ```
*
* The example above would import the vApp container named `vapp-01` that is
*
* located in the resource pool `resource-pool-01` that is part of the host cluster
*
* `cluster-01` in the `dc-01` datacenter.
*/
export declare class VappContainer extends pulumi.CustomResource {
/**
* Get an existing VappContainer resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VappContainerState, opts?: pulumi.CustomResourceOptions): VappContainer;
/**
* Returns true if the given object is an instance of VappContainer. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is VappContainer;
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
readonly cpuExpandable: pulumi.Output<boolean | undefined>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited.
* Default: `-1`
*/
readonly cpuLimit: pulumi.Output<number | undefined>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
readonly cpuReservation: pulumi.Output<number | undefined>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `cpuShares` will be
* ignored. Default: `normal`
*/
readonly cpuShareLevel: pulumi.Output<string | undefined>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `cpuShareLevel` must be `custom`.
*/
readonly cpuShares: pulumi.Output<number>;
/**
* A list of custom attributes to set on this resource.
*/
readonly customAttributes: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
readonly memoryExpandable: pulumi.Output<boolean | undefined>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited. Default: `-1`
*/
readonly memoryLimit: pulumi.Output<number | undefined>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
readonly memoryReservation: pulumi.Output<number | undefined>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `memoryShares` will be
* ignored. Default: `normal`
*/
readonly memoryShareLevel: pulumi.Output<string | undefined>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `memoryShareLevel` must be `custom`.
*/
readonly memoryShares: pulumi.Output<number>;
/**
* The name of the vApp container.
*/
readonly name: pulumi.Output<string>;
/**
* The managed object ID of
* the vApp container's parent folder.
*/
readonly parentFolderId: pulumi.Output<string | undefined>;
/**
* 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 vApp container
* from one parent resource pool to another, both must share a common root
* resource pool or the move will fail.
*/
readonly parentResourcePoolId: pulumi.Output<string>;
/**
* The IDs of any tags to attach to this resource.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Create a VappContainer resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: VappContainerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering VappContainer resources.
*/
export interface VappContainerState {
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
cpuExpandable?: pulumi.Input<boolean>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited.
* Default: `-1`
*/
cpuLimit?: pulumi.Input<number>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
cpuReservation?: pulumi.Input<number>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `cpuShares` will be
* ignored. Default: `normal`
*/
cpuShareLevel?: pulumi.Input<string>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `cpuShareLevel` must be `custom`.
*/
cpuShares?: pulumi.Input<number>;
/**
* A list of custom attributes to set on this resource.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
memoryExpandable?: pulumi.Input<boolean>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited. Default: `-1`
*/
memoryLimit?: pulumi.Input<number>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
memoryReservation?: pulumi.Input<number>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `memoryShares` will be
* ignored. Default: `normal`
*/
memoryShareLevel?: pulumi.Input<string>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `memoryShareLevel` must be `custom`.
*/
memoryShares?: pulumi.Input<number>;
/**
* The name of the vApp container.
*/
name?: pulumi.Input<string>;
/**
* The managed object ID of
* the vApp container's parent folder.
*/
parentFolderId?: pulumi.Input<string>;
/**
* 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 vApp container
* from one parent resource pool to another, both must share a common root
* resource pool or the move will fail.
*/
parentResourcePoolId?: pulumi.Input<string>;
/**
* The IDs of any tags to attach to this resource.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a VappContainer resource.
*/
export interface VappContainerArgs {
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
cpuExpandable?: pulumi.Input<boolean>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited.
* Default: `-1`
*/
cpuLimit?: pulumi.Input<number>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
cpuReservation?: pulumi.Input<number>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `cpuShares` will be
* ignored. Default: `normal`
*/
cpuShareLevel?: pulumi.Input<string>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `cpuShareLevel` must be `custom`.
*/
cpuShares?: pulumi.Input<number>;
/**
* A list of custom attributes to set on this resource.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Determines if the reservation on a vApp
* container can grow beyond the specified value if the parent resource pool has
* unreserved resources. Default: `true`
*/
memoryExpandable?: pulumi.Input<boolean>;
/**
* The CPU utilization of a vApp container will not
* exceed this limit, even if there are available resources. Set to `-1` for
* unlimited. Default: `-1`
*/
memoryLimit?: pulumi.Input<number>;
/**
* Amount of CPU (MHz) that is guaranteed
* available to the vApp container. Default: `0`
*/
memoryReservation?: pulumi.Input<number>;
/**
* 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`, or `custom`. When
* `low`, `normal`, or `high` are specified values in `memoryShares` will be
* ignored. Default: `normal`
*/
memoryShareLevel?: pulumi.Input<string>;
/**
* The number of shares allocated for CPU. Used to
* determine resource allocation in case of resource contention. If this is set,
* `memoryShareLevel` must be `custom`.
*/
memoryShares?: pulumi.Input<number>;
/**
* The name of the vApp container.
*/
name?: pulumi.Input<string>;
/**
* The managed object ID of
* the vApp container's parent folder.
*/
parentFolderId?: pulumi.Input<string>;
/**
* 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 vApp container
* from one parent resource pool to another, both must share a common root
* resource pool or the move will fail.
*/
parentResourcePoolId: pulumi.Input<string>;
/**
* The IDs of any tags to attach to this resource.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
}