Creating an Instance Pool
Use instance pools to create multiple compute instances from the same configuration, within the same region. You can manage the instances in an instance pool as a group. For more information about instance pools and instance configurations, see Managing Compute Instances.
Optionally, you can associate one or more load balancers with an instance pool. If you do this, when you add an instance to the instance pool, the instance is automatically added to the load balancer's backend set . After the instance reaches a healthy state (the instance is listening on the configured port number), incoming traffic is automatically routed to the new instance. For background information about the Load Balancing service, see Overview of Load Balancing.
Instance pools are supported for virtual machine (VM) and bare metal instances.
Required IAM Policy
To use Oracle Cloud Infrastructure, you must be granted security access in a policy by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment you should work in.
For administrators: For a typical policy that gives access to instance pools and instance configurations, see Let users manage Compute instance configurations, instance pools, and cluster networks.
Distributing Instances Across Fault Domains for High Availability
By default, the instances in a pool are distributed across all fault domains in a best-effort manner based on capacity. If capacity isn't available in one fault domain, the instances are placed in other fault domains to allow the instance pool to launch successfully.
In a high availability scenario, you can require that the instances in a pool are evenly distributed across each of the fault domains that you specify. When sufficient capacity isn't available in one of the fault domains, the instance pool will not launch or scale successfully, and a work request for the instance pool will return an "out of capacity" error. To fix the capacity error, either wait for capacity to become available, or use the UpdateInstancePool operation to update the placement configuration (the availability domain and fault domain) for the instance pool.
Before you can create an instance pool, you need:
An instance configuration. An instance configuration is a template that defines the settings to use when creating instances. When you create the instance pool, monitoring will be enabled by default on instances that support monitoring, regardless of the settings in the instance configuration. For more information, see Creating an Instance Configuration.Note
You cannot create an instance pool from an instance configuration where the image source is a boot volume.
- If you want to associate the instance pool with a load balancer, you need a load balancer and backend set. For steps to create a load balancer, see Managing Load Balancers.
Using the Console
- Open the navigation menu. Under Core Infrastructure, go to Compute and click Instance Pools.
Click Create Instance Pool.
On the Add Basic Details page, do the following:
- Select the compartment to create the instance pool in.
- Enter a name for the instance pool. It doesn't have to be unique, and it cannot be changed later in the Console (but you can change it with the API). Avoid entering confidential information.
- Select the Instance configuration that you want to use.
- Specify the targeted Number of instances for the instance pool.
- Show Tagging Options: Optionally, you can add tags. If you have permissions to create a resource, you also have permissions to add free-form tags to that resource. To add a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure if you should add tags, skip this option (you can add tags later) or ask your administrator.
- Click Next.
On the Configure Pool Placement page, select the location where you want to place the instances. Do the following:
- Select the Availability domain to launch the instances in.
For the Fault domains box, do one of the following things:
- If you want the system to make a best effort to distribute instances across fault domains based on capacity, leave the box blank.
- If you want to require that the instances in the pool are distributed evenly in one or more fault domains, select the fault domains to place the instances in. The pool will not launch or scale successfully if sufficient capacity is unavailable in the selected fault domains. For more information, see Distributing Instances Across Fault Domains for High Availability.
In the Primary VNIC section, configure the network details for the instances:
- Virtual cloud network: The virtual cloud network (VCN) to create the instances in.
- Subnet: A subnet within the cloud network to attach the instances to. The subnets are either public or private. Private means the instances in that subnet can't have public IP addresses. For more information, see Access to the Internet. Subnets can also be either AD-specific or regional (regional ones have "regional" after the name). We recommend using regional subnets. For more information, see About Regional Subnets.
- If secondary VNICs are defined by the instance configuration, a Secondary VNIC section appears. Select the secondary VCN and subnet for the instance pool.
- If you want the instance pool to create instances in more than one availability domain, click + Another Availability Domain. Then, repeat the previous steps.
If you want to associate a load balancer with the instance pool, select the Attach a load balancer check box. Then, do the following:
- Select the Load balancer to associate with the instance pool.
- Select the Backend set on the load balancer to add instances to.
- In the Port box, enter the server port on the instances to which the load balancer must direct traffic. This value applies to all instances that use this load balancer attachment.
- In the VNIC list, select the VNIC to use when adding the instance to the backend set. Instances that belong to a backend set are also called backend servers. The private IP address is used. This value applies to all instances that use this load balancer attachment.
- If you want to associate additional load balancers with the instance pool, click + Another Load Balancer. Then, repeat the previous steps. Do this for each additional load balancer you want to associate with the instance pool.
For background information about load balancers, see Overview of Load Balancing.
- Click Next.
Review the instance pool details, and then click Create.To track the progress of the operation, you can monitor the associated work request. For more information, see Using the Console to View Work Requests.
Using the API
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.
Use these API operations to create and manage instance pools: