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.
-
Open the navigation menu and click Compute. Under Compute, click Compute Clusters.
- Click the compute cluster that you're interested in.
- Click Attach instance.
- Follow the steps to create an instance, with the following specific choices for this instance.
- In the Placement section, if advanced options aren't shown, click Show advanced options.
- 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.
- In the Image and shape section, click Change shape. Select Bare metal machine, and then select a shape that supports compute clusters.
- 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.