Attaching Instances to a Compute Cluster

After you create a compute cluster, you can create instances within the cluster. The instances must be in the same compartment and availability domain as the cluster.

For steps to create a compute cluster, see Creating a Compute Cluster.

When you use the API, SDKs, or CLI to create instances in a compute cluster, provide the compute cluster's OCID with the launch instance operation. For steps to find the OCID of a compute cluster, see Retrieving a Compute Cluster's OCID.

If the placement (Availability Domains and Fault Domains) of the compute cluster doesn't have enough capacity for the instances that you create, you might get an out of capacity error. If that occurs, create a compute cluster in a different placement, and launch instances into the new compute cluster.

To remove instances from a compute cluster, delete (terminate) the instances.

For information about required IAM policies, see Compute Clusters.

    1. Open the navigation menu and click Compute. Under Compute, click Compute Clusters.

    2. Click the compute cluster that you're interested in.
    3. Click Attach instance.
    4. Follow the steps to create an instance, with the following specific choices for this instance.
      1. In the Placement section, if advanced options aren't shown, click Show advanced options.
      2. For Capacity type, ensure Compute cluster is selected. In the Compute cluster list, confirm that the compute cluster that you want to create the instance in is selected.
      3. In the Image and shape section, click Change shape. Select Bare metal machine, and then select a shape that supports compute clusters.
    5. Click Create.
  • Use the instance launch command. Include the OCID of the compute cluster in the compute-cluster-id parameter.

    oci compute instance launch --compartment-id <compartment_OCID> --availability-domain <availability_domain> --shape <instance_shape> --subnet-id <subnet_OCID> --compute-cluster-id <compute_cluster_OCID>

    For information about using the CLI, see Command Line Interface (CLI).

  • Use the LaunchInstance operation, passing the OCID of the compute cluster in the computeClusterId parameter in LaunchInstanceDetails.