import * as pulumi from "@pulumi/pulumi"; /** * The `vsphere.ComputeClusterVmGroup` resource can be used to manage groups of * virtual machines in a cluster, either created by the * [`vsphere.ComputeCluster`][tf-vsphere-cluster-resource] resource or looked up * by the [`vsphere.ComputeCluster`][tf-vsphere-cluster-data-source] data source. * * [tf-vsphere-cluster-resource]: /docs/providers/vsphere/r/compute_cluster.html * [tf-vsphere-cluster-data-source]: /docs/providers/vsphere/d/compute_cluster.html * * This resource mainly serves as an input to the * [`vsphere.ComputeClusterVmDependencyRule`][tf-vsphere-cluster-vm-dependency-rule-resource] * and * [`vsphere.ComputeClusterVmHostRule`][tf-vsphere-cluster-vm-host-rule-resource] * resources. See the individual resource documentation pages for more information. * * [tf-vsphere-cluster-vm-dependency-rule-resource]: /docs/providers/vsphere/r/compute_cluster_vm_dependency_rule.html * [tf-vsphere-cluster-vm-host-rule-resource]: /docs/providers/vsphere/r/compute_cluster_vm_host_rule.html * * > **NOTE:** This resource requires vCenter and is not available on direct ESXi * connections. * * ## Example Usage * * The example below creates two virtual machines in a cluster using the * `vsphere.VirtualMachine` resource, creating the * virtual machine in the cluster looked up by the * `vsphere.ComputeCluster` data source. It * then creates a group from these two virtual machines. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore1", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "network1", * datacenterId: datacenter.id, * })); * const vm: vsphere.VirtualMachine[] = []; * for (const range = {value: 0}; range.value < 2; range.value++) { * vm.push(new vsphere.VirtualMachine(`vm-${range.value}`, { * name: `test-${range.value}`, * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreId: datastore.then(datastore => datastore.id), * numCpus: 2, * memory: 2048, * guestId: "otherLinux64Guest", * networkInterfaces: [{ * networkId: network.then(network => network.id), * }], * disks: [{ * label: "disk0", * size: 20, * }], * })); * } * const clusterVmGroup = new vsphere.ComputeClusterVmGroup("cluster_vm_group", { * name: "test-cluster-vm-group", * computeClusterId: cluster.then(cluster => cluster.id), * virtualMachineIds: [vm.map(__item => __item.id)], * }); * ``` * * ## Import * * An existing group can be imported into this resource by * * supplying both the path to the cluster, and the name of the VM group. If the * * name or cluster is not found, or if the group is of a different type, an error * * will be returned. An example is below: * * [docs-import]: https://developer.hashicorp.com/terraform/cli/import * * ```sh * $ pulumi import vsphere:index/computeClusterVmGroup:ComputeClusterVmGroup cluster_vm_group \ * ``` * * '{"compute_cluster_path": "/dc1/host/cluster1", \ * * "name": "pulumi-test-cluster-vm-group"}' */ export declare class ComputeClusterVmGroup extends pulumi.CustomResource { /** * Get an existing ComputeClusterVmGroup 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, state?: ComputeClusterVmGroupState, opts?: pulumi.CustomResourceOptions): ComputeClusterVmGroup; /** * Returns true if the given object is an instance of ComputeClusterVmGroup. 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 ComputeClusterVmGroup; /** * The managed object reference * ID of the cluster to put the group in. Forces a new * resource if changed. */ readonly computeClusterId: pulumi.Output; /** * The name of the VM group. This must be unique in the * cluster. Forces a new resource if changed. */ readonly name: pulumi.Output; /** * The UUIDs of the virtual machines in this * group. * * > **NOTE:** The namespace for cluster names on this resource (defined by the * `name` argument) is shared with the * `vsphere.ComputeClusterHostGroup` * resource. Make sure your names are unique across both resources. * * > **NOTE:** To update a existing VM group, you must first import the group with `import` command in * import section. When importing a VM group, validate that all virtual machines that * need to be in the group are included in the `virtualMachineIds`; otherwise, any virtual machines * that are not in `virtualMachineIds` the included will be removed from the group. */ readonly virtualMachineIds: pulumi.Output; /** * Create a ComputeClusterVmGroup 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: ComputeClusterVmGroupArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ComputeClusterVmGroup resources. */ export interface ComputeClusterVmGroupState { /** * The managed object reference * ID of the cluster to put the group in. Forces a new * resource if changed. */ computeClusterId?: pulumi.Input; /** * The name of the VM group. This must be unique in the * cluster. Forces a new resource if changed. */ name?: pulumi.Input; /** * The UUIDs of the virtual machines in this * group. * * > **NOTE:** The namespace for cluster names on this resource (defined by the * `name` argument) is shared with the * `vsphere.ComputeClusterHostGroup` * resource. Make sure your names are unique across both resources. * * > **NOTE:** To update a existing VM group, you must first import the group with `import` command in * import section. When importing a VM group, validate that all virtual machines that * need to be in the group are included in the `virtualMachineIds`; otherwise, any virtual machines * that are not in `virtualMachineIds` the included will be removed from the group. */ virtualMachineIds?: pulumi.Input[]>; } /** * The set of arguments for constructing a ComputeClusterVmGroup resource. */ export interface ComputeClusterVmGroupArgs { /** * The managed object reference * ID of the cluster to put the group in. Forces a new * resource if changed. */ computeClusterId: pulumi.Input; /** * The name of the VM group. This must be unique in the * cluster. Forces a new resource if changed. */ name?: pulumi.Input; /** * The UUIDs of the virtual machines in this * group. * * > **NOTE:** The namespace for cluster names on this resource (defined by the * `name` argument) is shared with the * `vsphere.ComputeClusterHostGroup` * resource. Make sure your names are unique across both resources. * * > **NOTE:** To update a existing VM group, you must first import the group with `import` command in * import section. When importing a VM group, validate that all virtual machines that * need to be in the group are included in the `virtualMachineIds`; otherwise, any virtual machines * that are not in `virtualMachineIds` the included will be removed from the group. */ virtualMachineIds?: pulumi.Input[]>; }