# Provision Dedicated Instance Pools
 

Exoscale __Instance Pools__ are a service to provision groups of identical
Compute instances automatically. You can define several instances in the pool, and the service will keep the required number up and running for you to achieve:

* __High availability__: using an Instance Pool ensures that the target quantity of instances is running.
* __Elasticity__: Instance Pools can be scaled up and down dynamically so the number of instances matches the actual load for better cost efficiency.
* __Hardware Isolation__: Full hardware isolation from other Exoscale Compute customers with used in combination with Dedicated Hypervisors.

> [!NOTE]
> You need to have a Dedicated Hypervisor behind a Deployment target to proceed. 

### Getting Started

Before creating an Instance Pool with Dedicated hosts, please note the following aspects and restrictions:

* Instance Pools and their managed Compute Instances cannot span multiple Exoscale zones. They cannot be migrated to another zone after being created. 
* Instance Pool member instances might have different types. Updating the instance type applies __only to new members__; existing members remain untouched.
* If an Instance Pool is referenced by a Network Load Balancer service, it
cannot be deleted.
* Ensure that Exoscale Support has provisioned your dedicated resources and provided you with the relevant Deploy Target. *Without this you will not be able to launch instances on your dedicated Hypervisor.*
* Exoscale CLI - Download the latest (≥ v1.45) binary for macOS, Linux, or Windows from [GitHub](https://github.com/exoscale/cli/releases/latest).
* API Key/Secret - Configure via the [CLI]({{< ref "/tools/command-line-interface/" >}}) with `exo config`. 

> [!NOTE]
> You can create an Instance Pool from the Exoscale Portal, however to make use of your Deployment Target you will need to use
> the CLI.

### Confirm deployment target

A [Deployment Target]({{< ref "/product/compute/dedicated-hypervisors/overview/#deployment-target" >}}) is a virtual abstraction layer that allows you to provision Compute Instances onto dedicated hypervisors.

Run the following command with valid credentials for the target account, be sure to use the correct [Zone]({{< ref "/platform/dc-zones/#building-around-the-zone-concept" >}}):

```bash
exo api list-deploy-targets  --zone=ch-gva-2 
```

  <details>

  <summary>Example output</summary>

  

  ```bash
  exo api list-deploy-targets  --zone=ch-gva-2 
  {
    "deploy-targets": [
    {
      "description": "dedicated resources group",
      "id": "c9a64f12-3ba7-4c19-bd93-61f2d84c3e55",
      "name": "Dedicated-ch-gva-coe",
      "type": "dedicated"
    }
  ]
  }

  ```

  </details>

### Create Instance Pool ###

> [!NOTE]
> You need to have created a [Security Group]({{< ref "/product/networking/security-group/" >}}) should you wish to reference one here, as well as the relevant [SSH-Key]({{< ref "/product/compute/instances/how-to/ssh-keypairs/" >}})!

Here is an example of Instance Pool creation on your Deployment Target using the CLI:

```bash
exo compute instance-pool create web \
    --zone ch-gva-2 \
    --size 3 \
    --description "Web servers" \
    --instance-type medium \
    --template "Linux Ubuntu 20.04 LTS 64-bit" \
    --security-group web \
    --ssh-key william-demo \
    --ipv6 \
    --deploy-target c9a64f12-3ba7-4c19-bd93-61f2d84c3e55 \
```
<details>

  <summary>Example output</summary>

  

  ```bash
  exo compute instance-pool create web \

  --zone ch-gva-2 \

  --size 3 \

  --description "Web servers" \

  --instance-type medium \

  --template "Linux Ubuntu 20.04 LTS 64-bit" \

  --security-group web \

  --ssh-key william-demo \

  --deploy-target c9a64f12-3ba7-4c19-bd93-61f2d84c3e55 \

  ✔ Creating Instance Pool "web"... 30s
┼──────────────────────┼──────────────────────────────────────┼
│    INSTANCE POOL     │                                      │
┼──────────────────────┼──────────────────────────────────────┼
│ ID                   │ f7252176-54f8-47ed-8af1-9524db3b81e2 │
│ Name                 │ web                                  │
│ Description          │                                      │
│ Instance Type        │ standard.medium                      │
│ Template             │ Linux Ubuntu 22.04 LTS 64-bit        │
│ Zone                 │ ch-gva-2                             │
│ Anti-Affinity Groups │ n/a                                  │
│ Security Groups      │ web                                  │
│ Private Networks     │ n/a                                  │
│ Elastic IPs          │ n/a                                  │
│ IPv6                 │ false                                │
│ SSH Key              │ william-demo                         │
│ Size                 │ 3                                    │
│ Disk Size            │ 50 GiB                               │
│ Instance Prefix      │ pool-willdemo                        │
│ State                │ scaling-up                           │
│ Labels               │ n/a                                  │
│ Instances            │ pool-willdemo-b01a8-hnuqt            |
|                      | pool-willdemo-b01a8-jcoog            |
|                      │ pool-willdemo-b01a8-pryrh            |
┼──────────────────────┼──────────────────────────────────────┼

  ```

  </details>

### Check the instance is running where you intended

Run the following command to check the instance had landed on your dedicated hypervisor. 

```bash
exo api get-deploy-target c9a64f12-3ba7-4c19-bd93-61f2d84c3e55 --zone=ch-gva-2
```

<details>
<summary>Example output</summary>

```bash

exo api get-deploy-target c9a64f12-3ba7-4c19-bd93-61f2d84c3e55 --zone=ch-gva-2

{
  "allocation": [
    {
      "hypervisor": {
        "id": "b3c8f2a1-6d4e-419a-9e7b-c3f2b8a1d4e0",
        "name": "virt-hv416.gv2.p.exoscale.net"
      },
      "instances": [
        {
          "id": "7f9a1c3e-5b8d-426f-bd02-a4e7c1f8d3b6",
          "name": "pool-willdemo-b01a8-hnuqt"
        },
        {
          "id": "8be57fff-10b9-4a15-a20d-6493b517324d",
          "name": "pool-willdemo-b01a8-jcoog"
        }
      ]
    },
    {
      "hypervisor": {
        "id": "f8e7d6c5-b4a3-4210-9f8e-7d6c5b4a3f2e",
        "name": "virt-hv731.gv2.p.exoscale.net"
      },
      "instances": [
        {
          "id": "ad4c5e6f-7a8b-49c0-be1f-2a3b4c5d6e7f",
          "name": "pool-willdemo-b01a8-pryrh"
        },
        {
          "id": "6b7c8d9e-0f1a-42bc-ad3e-4f5a6b7c8d9e",
          "name": "test-instance-002"
        }
      ]
    }
  ],
  "description": "dedicated resources group",
  "id": "c9a64f12-3ba7-4c19-bd93-61f2d84c3e55",
  "name": "Dedicated-ch-gva-2",
  "type": "dedicated"
}
```

</details>

If you review the output, we can see that the instance pool is running 3 instances across both the Hypervisors virt-hv731.gv2.p.exoscale.net and virt-hv416.gv2.p.exoscale.net in the Geneva Zone.

### Managing Instance Pools

All management tasks associated with  are also avaliable using the same commands and are detailed in our [Instance Pools How To]({{< ref "/product/compute/instances/how-to/instance-pools" >}})

## Next Steps 

Learn more about the Exoscale Dedicated Hypervisor architecture and concepts in the
[Overview]({{< ref "/product/compute/dedicated-hypervisors/overview" >}}). For advanced usage check the
[How-To]({{< ref "/product/compute/dedicated-hypervisors/how-to" >}}) section for other guides.
[Instance-Pools]({{< ref "/product/compute/instances/how-to/instance-pools" >}})

