vsphere.ComputeClusterVmDependencyRule
Explore with Pulumi AI
The vsphere.ComputeClusterVmDependencyRule
resource can be used to manage
VM dependency rules in a cluster, either created by the
vsphere.ComputeCluster
resource or looked up
by the vsphere.ComputeCluster
data source.
A virtual machine dependency rule applies to vSphere HA, and allows
user-defined startup orders for virtual machines in the case of host failure.
Virtual machines are supplied via groups, which can be managed via the
vsphere.ComputeClusterVmGroup
resource.
NOTE: This resource requires vCenter and is not available on direct ESXi connections.
Example Usage
The example below creates two virtual machine in a cluster using the
vsphere.VirtualMachine
resource in a cluster
looked up by the vsphere.ComputeCluster
data source. It then creates a group with this virtual machine. Two groups are created, each with one of the created VMs. Finally, a rule is created to ensure that vm1
starts before vm2
.
Note how
dependency_vm_group_name
andvm_group_name
are sourced off of thename
attributes from thevsphere.ComputeClusterVmGroup
resource. This is to ensure that the rule is not created before the groups exist, which may not possibly happen in the event that the names came from a “static” source such as a variable.
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 vm1 = new vsphere.VirtualMachine("vm1", {
name: "test1",
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 vm2 = new vsphere.VirtualMachine("vm2", {
name: "test2",
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 clusterVmGroup1 = new vsphere.ComputeClusterVmGroup("cluster_vm_group1", {
name: "test-cluster-vm-group1",
computeClusterId: cluster.then(cluster => cluster.id),
virtualMachineIds: [vm1.id],
});
const clusterVmGroup2 = new vsphere.ComputeClusterVmGroup("cluster_vm_group2", {
name: "test-cluster-vm-group2",
computeClusterId: cluster.then(cluster => cluster.id),
virtualMachineIds: [vm2.id],
});
const clusterVmDependencyRule = new vsphere.ComputeClusterVmDependencyRule("cluster_vm_dependency_rule", {
computeClusterId: cluster.then(cluster => cluster.id),
name: "test-cluster-vm-dependency-rule",
dependencyVmGroupName: clusterVmGroup1.name,
vmGroupName: clusterVmGroup2.name,
});
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
datastore = vsphere.get_datastore(name="datastore1",
datacenter_id=datacenter.id)
cluster = vsphere.get_compute_cluster(name="cluster-01",
datacenter_id=datacenter.id)
network = vsphere.get_network(name="network1",
datacenter_id=datacenter.id)
vm1 = vsphere.VirtualMachine("vm1",
name="test1",
resource_pool_id=cluster.resource_pool_id,
datastore_id=datastore.id,
num_cpus=2,
memory=2048,
guest_id="otherLinux64Guest",
network_interfaces=[{
"network_id": network.id,
}],
disks=[{
"label": "disk0",
"size": 20,
}])
vm2 = vsphere.VirtualMachine("vm2",
name="test2",
resource_pool_id=cluster.resource_pool_id,
datastore_id=datastore.id,
num_cpus=2,
memory=2048,
guest_id="otherLinux64Guest",
network_interfaces=[{
"network_id": network.id,
}],
disks=[{
"label": "disk0",
"size": 20,
}])
cluster_vm_group1 = vsphere.ComputeClusterVmGroup("cluster_vm_group1",
name="test-cluster-vm-group1",
compute_cluster_id=cluster.id,
virtual_machine_ids=[vm1.id])
cluster_vm_group2 = vsphere.ComputeClusterVmGroup("cluster_vm_group2",
name="test-cluster-vm-group2",
compute_cluster_id=cluster.id,
virtual_machine_ids=[vm2.id])
cluster_vm_dependency_rule = vsphere.ComputeClusterVmDependencyRule("cluster_vm_dependency_rule",
compute_cluster_id=cluster.id,
name="test-cluster-vm-dependency-rule",
dependency_vm_group_name=cluster_vm_group1.name,
vm_group_name=cluster_vm_group2.name)
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
datastore, err := vsphere.GetDatastore(ctx, &vsphere.GetDatastoreArgs{
Name: "datastore1",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
cluster, err := vsphere.LookupComputeCluster(ctx, &vsphere.LookupComputeClusterArgs{
Name: "cluster-01",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
network, err := vsphere.GetNetwork(ctx, &vsphere.GetNetworkArgs{
Name: "network1",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
vm1, err := vsphere.NewVirtualMachine(ctx, "vm1", &vsphere.VirtualMachineArgs{
Name: pulumi.String("test1"),
ResourcePoolId: pulumi.String(cluster.ResourcePoolId),
DatastoreId: pulumi.String(datastore.Id),
NumCpus: pulumi.Int(2),
Memory: pulumi.Int(2048),
GuestId: pulumi.String("otherLinux64Guest"),
NetworkInterfaces: vsphere.VirtualMachineNetworkInterfaceArray{
&vsphere.VirtualMachineNetworkInterfaceArgs{
NetworkId: pulumi.String(network.Id),
},
},
Disks: vsphere.VirtualMachineDiskArray{
&vsphere.VirtualMachineDiskArgs{
Label: pulumi.String("disk0"),
Size: pulumi.Int(20),
},
},
})
if err != nil {
return err
}
vm2, err := vsphere.NewVirtualMachine(ctx, "vm2", &vsphere.VirtualMachineArgs{
Name: pulumi.String("test2"),
ResourcePoolId: pulumi.String(cluster.ResourcePoolId),
DatastoreId: pulumi.String(datastore.Id),
NumCpus: pulumi.Int(2),
Memory: pulumi.Int(2048),
GuestId: pulumi.String("otherLinux64Guest"),
NetworkInterfaces: vsphere.VirtualMachineNetworkInterfaceArray{
&vsphere.VirtualMachineNetworkInterfaceArgs{
NetworkId: pulumi.String(network.Id),
},
},
Disks: vsphere.VirtualMachineDiskArray{
&vsphere.VirtualMachineDiskArgs{
Label: pulumi.String("disk0"),
Size: pulumi.Int(20),
},
},
})
if err != nil {
return err
}
clusterVmGroup1, err := vsphere.NewComputeClusterVmGroup(ctx, "cluster_vm_group1", &vsphere.ComputeClusterVmGroupArgs{
Name: pulumi.String("test-cluster-vm-group1"),
ComputeClusterId: pulumi.String(cluster.Id),
VirtualMachineIds: pulumi.StringArray{
vm1.ID(),
},
})
if err != nil {
return err
}
clusterVmGroup2, err := vsphere.NewComputeClusterVmGroup(ctx, "cluster_vm_group2", &vsphere.ComputeClusterVmGroupArgs{
Name: pulumi.String("test-cluster-vm-group2"),
ComputeClusterId: pulumi.String(cluster.Id),
VirtualMachineIds: pulumi.StringArray{
vm2.ID(),
},
})
if err != nil {
return err
}
_, err = vsphere.NewComputeClusterVmDependencyRule(ctx, "cluster_vm_dependency_rule", &vsphere.ComputeClusterVmDependencyRuleArgs{
ComputeClusterId: pulumi.String(cluster.Id),
Name: pulumi.String("test-cluster-vm-dependency-rule"),
DependencyVmGroupName: clusterVmGroup1.Name,
VmGroupName: clusterVmGroup2.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var datastore = VSphere.GetDatastore.Invoke(new()
{
Name = "datastore1",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
var cluster = VSphere.GetComputeCluster.Invoke(new()
{
Name = "cluster-01",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
var network = VSphere.GetNetwork.Invoke(new()
{
Name = "network1",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
var vm1 = new VSphere.VirtualMachine("vm1", new()
{
Name = "test1",
ResourcePoolId = cluster.Apply(getComputeClusterResult => getComputeClusterResult.ResourcePoolId),
DatastoreId = datastore.Apply(getDatastoreResult => getDatastoreResult.Id),
NumCpus = 2,
Memory = 2048,
GuestId = "otherLinux64Guest",
NetworkInterfaces = new[]
{
new VSphere.Inputs.VirtualMachineNetworkInterfaceArgs
{
NetworkId = network.Apply(getNetworkResult => getNetworkResult.Id),
},
},
Disks = new[]
{
new VSphere.Inputs.VirtualMachineDiskArgs
{
Label = "disk0",
Size = 20,
},
},
});
var vm2 = new VSphere.VirtualMachine("vm2", new()
{
Name = "test2",
ResourcePoolId = cluster.Apply(getComputeClusterResult => getComputeClusterResult.ResourcePoolId),
DatastoreId = datastore.Apply(getDatastoreResult => getDatastoreResult.Id),
NumCpus = 2,
Memory = 2048,
GuestId = "otherLinux64Guest",
NetworkInterfaces = new[]
{
new VSphere.Inputs.VirtualMachineNetworkInterfaceArgs
{
NetworkId = network.Apply(getNetworkResult => getNetworkResult.Id),
},
},
Disks = new[]
{
new VSphere.Inputs.VirtualMachineDiskArgs
{
Label = "disk0",
Size = 20,
},
},
});
var clusterVmGroup1 = new VSphere.ComputeClusterVmGroup("cluster_vm_group1", new()
{
Name = "test-cluster-vm-group1",
ComputeClusterId = cluster.Apply(getComputeClusterResult => getComputeClusterResult.Id),
VirtualMachineIds = new[]
{
vm1.Id,
},
});
var clusterVmGroup2 = new VSphere.ComputeClusterVmGroup("cluster_vm_group2", new()
{
Name = "test-cluster-vm-group2",
ComputeClusterId = cluster.Apply(getComputeClusterResult => getComputeClusterResult.Id),
VirtualMachineIds = new[]
{
vm2.Id,
},
});
var clusterVmDependencyRule = new VSphere.ComputeClusterVmDependencyRule("cluster_vm_dependency_rule", new()
{
ComputeClusterId = cluster.Apply(getComputeClusterResult => getComputeClusterResult.Id),
Name = "test-cluster-vm-dependency-rule",
DependencyVmGroupName = clusterVmGroup1.Name,
VmGroupName = clusterVmGroup2.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetDatastoreArgs;
import com.pulumi.vsphere.inputs.GetComputeClusterArgs;
import com.pulumi.vsphere.inputs.GetNetworkArgs;
import com.pulumi.vsphere.VirtualMachine;
import com.pulumi.vsphere.VirtualMachineArgs;
import com.pulumi.vsphere.inputs.VirtualMachineNetworkInterfaceArgs;
import com.pulumi.vsphere.inputs.VirtualMachineDiskArgs;
import com.pulumi.vsphere.ComputeClusterVmGroup;
import com.pulumi.vsphere.ComputeClusterVmGroupArgs;
import com.pulumi.vsphere.ComputeClusterVmDependencyRule;
import com.pulumi.vsphere.ComputeClusterVmDependencyRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var datastore = VsphereFunctions.getDatastore(GetDatastoreArgs.builder()
.name("datastore1")
.datacenterId(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
final var cluster = VsphereFunctions.getComputeCluster(GetComputeClusterArgs.builder()
.name("cluster-01")
.datacenterId(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
final var network = VsphereFunctions.getNetwork(GetNetworkArgs.builder()
.name("network1")
.datacenterId(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
var vm1 = new VirtualMachine("vm1", VirtualMachineArgs.builder()
.name("test1")
.resourcePoolId(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.resourcePoolId()))
.datastoreId(datastore.applyValue(getDatastoreResult -> getDatastoreResult.id()))
.numCpus(2)
.memory(2048)
.guestId("otherLinux64Guest")
.networkInterfaces(VirtualMachineNetworkInterfaceArgs.builder()
.networkId(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.build())
.disks(VirtualMachineDiskArgs.builder()
.label("disk0")
.size(20)
.build())
.build());
var vm2 = new VirtualMachine("vm2", VirtualMachineArgs.builder()
.name("test2")
.resourcePoolId(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.resourcePoolId()))
.datastoreId(datastore.applyValue(getDatastoreResult -> getDatastoreResult.id()))
.numCpus(2)
.memory(2048)
.guestId("otherLinux64Guest")
.networkInterfaces(VirtualMachineNetworkInterfaceArgs.builder()
.networkId(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.build())
.disks(VirtualMachineDiskArgs.builder()
.label("disk0")
.size(20)
.build())
.build());
var clusterVmGroup1 = new ComputeClusterVmGroup("clusterVmGroup1", ComputeClusterVmGroupArgs.builder()
.name("test-cluster-vm-group1")
.computeClusterId(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.id()))
.virtualMachineIds(vm1.id())
.build());
var clusterVmGroup2 = new ComputeClusterVmGroup("clusterVmGroup2", ComputeClusterVmGroupArgs.builder()
.name("test-cluster-vm-group2")
.computeClusterId(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.id()))
.virtualMachineIds(vm2.id())
.build());
var clusterVmDependencyRule = new ComputeClusterVmDependencyRule("clusterVmDependencyRule", ComputeClusterVmDependencyRuleArgs.builder()
.computeClusterId(cluster.applyValue(getComputeClusterResult -> getComputeClusterResult.id()))
.name("test-cluster-vm-dependency-rule")
.dependencyVmGroupName(clusterVmGroup1.name())
.vmGroupName(clusterVmGroup2.name())
.build());
}
}
resources:
vm1:
type: vsphere:VirtualMachine
properties:
name: test1
resourcePoolId: ${cluster.resourcePoolId}
datastoreId: ${datastore.id}
numCpus: 2
memory: 2048
guestId: otherLinux64Guest
networkInterfaces:
- networkId: ${network.id}
disks:
- label: disk0
size: 20
vm2:
type: vsphere:VirtualMachine
properties:
name: test2
resourcePoolId: ${cluster.resourcePoolId}
datastoreId: ${datastore.id}
numCpus: 2
memory: 2048
guestId: otherLinux64Guest
networkInterfaces:
- networkId: ${network.id}
disks:
- label: disk0
size: 20
clusterVmGroup1:
type: vsphere:ComputeClusterVmGroup
name: cluster_vm_group1
properties:
name: test-cluster-vm-group1
computeClusterId: ${cluster.id}
virtualMachineIds:
- ${vm1.id}
clusterVmGroup2:
type: vsphere:ComputeClusterVmGroup
name: cluster_vm_group2
properties:
name: test-cluster-vm-group2
computeClusterId: ${cluster.id}
virtualMachineIds:
- ${vm2.id}
clusterVmDependencyRule:
type: vsphere:ComputeClusterVmDependencyRule
name: cluster_vm_dependency_rule
properties:
computeClusterId: ${cluster.id}
name: test-cluster-vm-dependency-rule
dependencyVmGroupName: ${clusterVmGroup1.name}
vmGroupName: ${clusterVmGroup2.name}
variables:
datacenter:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: dc-01
datastore:
fn::invoke:
Function: vsphere:getDatastore
Arguments:
name: datastore1
datacenterId: ${datacenter.id}
cluster:
fn::invoke:
Function: vsphere:getComputeCluster
Arguments:
name: cluster-01
datacenterId: ${datacenter.id}
network:
fn::invoke:
Function: vsphere:getNetwork
Arguments:
name: network1
datacenterId: ${datacenter.id}
Create ComputeClusterVmDependencyRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeClusterVmDependencyRule(name: string, args: ComputeClusterVmDependencyRuleArgs, opts?: CustomResourceOptions);
@overload
def ComputeClusterVmDependencyRule(resource_name: str,
args: ComputeClusterVmDependencyRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ComputeClusterVmDependencyRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
compute_cluster_id: Optional[str] = None,
dependency_vm_group_name: Optional[str] = None,
vm_group_name: Optional[str] = None,
enabled: Optional[bool] = None,
mandatory: Optional[bool] = None,
name: Optional[str] = None)
func NewComputeClusterVmDependencyRule(ctx *Context, name string, args ComputeClusterVmDependencyRuleArgs, opts ...ResourceOption) (*ComputeClusterVmDependencyRule, error)
public ComputeClusterVmDependencyRule(string name, ComputeClusterVmDependencyRuleArgs args, CustomResourceOptions? opts = null)
public ComputeClusterVmDependencyRule(String name, ComputeClusterVmDependencyRuleArgs args)
public ComputeClusterVmDependencyRule(String name, ComputeClusterVmDependencyRuleArgs args, CustomResourceOptions options)
type: vsphere:ComputeClusterVmDependencyRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ComputeClusterVmDependencyRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ComputeClusterVmDependencyRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ComputeClusterVmDependencyRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeClusterVmDependencyRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeClusterVmDependencyRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var computeClusterVmDependencyRuleResource = new VSphere.ComputeClusterVmDependencyRule("computeClusterVmDependencyRuleResource", new()
{
ComputeClusterId = "string",
DependencyVmGroupName = "string",
VmGroupName = "string",
Enabled = false,
Mandatory = false,
Name = "string",
});
example, err := vsphere.NewComputeClusterVmDependencyRule(ctx, "computeClusterVmDependencyRuleResource", &vsphere.ComputeClusterVmDependencyRuleArgs{
ComputeClusterId: pulumi.String("string"),
DependencyVmGroupName: pulumi.String("string"),
VmGroupName: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Mandatory: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var computeClusterVmDependencyRuleResource = new ComputeClusterVmDependencyRule("computeClusterVmDependencyRuleResource", ComputeClusterVmDependencyRuleArgs.builder()
.computeClusterId("string")
.dependencyVmGroupName("string")
.vmGroupName("string")
.enabled(false)
.mandatory(false)
.name("string")
.build());
compute_cluster_vm_dependency_rule_resource = vsphere.ComputeClusterVmDependencyRule("computeClusterVmDependencyRuleResource",
compute_cluster_id="string",
dependency_vm_group_name="string",
vm_group_name="string",
enabled=False,
mandatory=False,
name="string")
const computeClusterVmDependencyRuleResource = new vsphere.ComputeClusterVmDependencyRule("computeClusterVmDependencyRuleResource", {
computeClusterId: "string",
dependencyVmGroupName: "string",
vmGroupName: "string",
enabled: false,
mandatory: false,
name: "string",
});
type: vsphere:ComputeClusterVmDependencyRule
properties:
computeClusterId: string
dependencyVmGroupName: string
enabled: false
mandatory: false
name: string
vmGroupName: string
ComputeClusterVmDependencyRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ComputeClusterVmDependencyRule resource accepts the following input properties:
- Compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- Dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - Vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - Enabled bool
- Enable this rule in the cluster. Default:
true
. - Mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- Name string
- The name of the rule. This must be unique in the cluster.
- Compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- Dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - Vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - Enabled bool
- Enable this rule in the cluster. Default:
true
. - Mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- Name string
- The name of the rule. This must be unique in the cluster.
- compute
Cluster StringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm StringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - vm
Group StringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - enabled Boolean
- Enable this rule in the cluster. Default:
true
. - mandatory Boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name String
- The name of the rule. This must be unique in the cluster.
- compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - enabled boolean
- Enable this rule in the cluster. Default:
true
. - mandatory boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name string
- The name of the rule. This must be unique in the cluster.
- compute_
cluster_ strid - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency_
vm_ strgroup_ name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - vm_
group_ strname - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - enabled bool
- Enable this rule in the cluster. Default:
true
. - mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name str
- The name of the rule. This must be unique in the cluster.
- compute
Cluster StringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm StringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - vm
Group StringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started. - enabled Boolean
- Enable this rule in the cluster. Default:
true
. - mandatory Boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name String
- The name of the rule. This must be unique in the cluster.
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeClusterVmDependencyRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ComputeClusterVmDependencyRule Resource
Get an existing ComputeClusterVmDependencyRule 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?: ComputeClusterVmDependencyRuleState, opts?: CustomResourceOptions): ComputeClusterVmDependencyRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compute_cluster_id: Optional[str] = None,
dependency_vm_group_name: Optional[str] = None,
enabled: Optional[bool] = None,
mandatory: Optional[bool] = None,
name: Optional[str] = None,
vm_group_name: Optional[str] = None) -> ComputeClusterVmDependencyRule
func GetComputeClusterVmDependencyRule(ctx *Context, name string, id IDInput, state *ComputeClusterVmDependencyRuleState, opts ...ResourceOption) (*ComputeClusterVmDependencyRule, error)
public static ComputeClusterVmDependencyRule Get(string name, Input<string> id, ComputeClusterVmDependencyRuleState? state, CustomResourceOptions? opts = null)
public static ComputeClusterVmDependencyRule get(String name, Output<String> id, ComputeClusterVmDependencyRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- Dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - Enabled bool
- Enable this rule in the cluster. Default:
true
. - Mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- Name string
- The name of the rule. This must be unique in the cluster.
- Vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
- Compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- Dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - Enabled bool
- Enable this rule in the cluster. Default:
true
. - Mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- Name string
- The name of the rule. This must be unique in the cluster.
- Vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
- compute
Cluster StringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm StringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - enabled Boolean
- Enable this rule in the cluster. Default:
true
. - mandatory Boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name String
- The name of the rule. This must be unique in the cluster.
- vm
Group StringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
- compute
Cluster stringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm stringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - enabled boolean
- Enable this rule in the cluster. Default:
true
. - mandatory boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name string
- The name of the rule. This must be unique in the cluster.
- vm
Group stringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
- compute_
cluster_ strid - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency_
vm_ strgroup_ name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - enabled bool
- Enable this rule in the cluster. Default:
true
. - mandatory bool
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name str
- The name of the rule. This must be unique in the cluster.
- vm_
group_ strname - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
- compute
Cluster StringId - The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
- dependency
Vm StringGroup Name - The name of the VM group that this
rule depends on. The VMs defined in the group specified by
vm_group_name
will not be started until the VMs in this group are started. - enabled Boolean
- Enable this rule in the cluster. Default:
true
. - mandatory Boolean
When this value is
true
, prevents any virtual machine operations that may violate this rule. Default:false
.NOTE: The namespace for rule names on this resource (defined by the
name
argument) is shared with all rules in the cluster - consider this when naming your rules.- name String
- The name of the rule. This must be unique in the cluster.
- vm
Group StringName - The name of the VM group that is the subject of
this rule. The VMs defined in this group will not be started until the VMs in
the group specified by
dependency_vm_group_name
are started.
Import
An existing rule can be imported into this resource by supplying
both the path to the cluster, and the name the rule. If the name or cluster is
not found, or if the rule is of a different type, an error will be returned. An
example is below:
$ pulumi import vsphere:index/computeClusterVmDependencyRule:ComputeClusterVmDependencyRule cluster_vm_dependency_rule \
‘{“compute_cluster_path”: “/dc1/host/cluster1”, \
“name”: “pulumi-test-cluster-vm-dependency-rule”}’
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphere
Terraform Provider.