> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CoPilot Disk (Volume) Management

> Allocate data disks (volumes) to your Aviatrix CoPilot deployment to be used for expandable storage.

Allocate data disks (volumes) to your Aviatrix CoPilot deployment to be used for
expandable storage.

When you initially provision CoPilot (from your cloud service provider), you
must add a disk (volume) to be used for CoPilot storage. You are required to add
at least one disk (volume) that is an additional disk (on the side) from the
25GB root disk that already comes with CoPilot. You create the data disk
(volume) in your CSP account and attach it to your CoPilot instance. During
instance provisioning, there is no minimum requirement for the disk/volume you
add. You can choose the disk type (volume type) you want. You will be able to
add more storage after deployment.

When you newly launch the CoPilot instance, the initial setup process
automatically detects the disk/volume you attached during instance provisioning.
An add-disk process prompts you to confirm the disk/volume to use and then
formats and attaches your disk(s). A logical disk/volume is created from all
physical disks (volumes) you added during provisioning. For example, if you
launch Copilot and you added two physical disks that are 8G each, CoPilot will
form a 16G volume.

The storage you need for CoPilot can increase based on several factors including
the number of Aviatrix gateways launched and the type and volume of traffic in
your network. Gateway node exporter metrics (`gw-metrics`) in particular grow
with gateway count and, at larger fleet sizes, can use as much disk as NetFlow
or DCF logs. See
[Monitor Daily Size of Gateway Metrics Indices](#monitor-daily-size-of-gateway-metrics-indices)
for reference numbers and tuning guidance. When you need more storage, you can
add additional disks (volumes) by using the *CoPilot > Settings > Resources*
page (Attach Additional Disk). For instructions, see
[Add a Disk (Volume) for CoPilot Storage after Deployment](#add-a-disk-volume-for-copilot-storage-after-deployment).

After you allocate new disks (volumes), you can only increase storage (you
cannot decrease storage).

For data disks you already allocated to your CoPilot deployment, you can
increase their size. For instructions, see
[Expand a Disk (Volume) for CoPilot Storage](#expand-a-disk-volume-for-copilot-storage).

<Note>
  Disk (volume) management for expandable storage became available with the
  release of Aviatrix CoPilot base image version 1.5.1. To use the expandable
  storage feature and leverage additional disks/volumes, you must launch a new
  CoPilot instance from the marketplace based on a CoPilot base image version
  1.5.1 or later (Appliance Version 2).
</Note>

<a id="addisk" />

## Add a Disk (Volume) for CoPilot Storage after Deployment

Add a data disk (volume) to your simple Aviatrix CoPilot deployment to be used
for expandable storage.

This procedure assumes you have a running CoPilot and want to add more storage
(add a data disk/volume) above and beyond the storage you added when you first
provisioned the CoPilot instance (from your CSP).

To add a data disk (volume) for CoPilot expandable storage after deployment:

1. Log in to your CSP account and create the disk (volume) you want to add.
   Choose the disk type (volume type) that meets your business needs given the
   size of your environment and performance requirements.
2. Attach the disk (volume) to your CoPilot instance. Do *not* reboot the
   instance (a disk can be dynamically added to an instance on any CSP without
   rebooting).
3. After you receive confirmation from the CSP that the disk is attached, log in
   to CoPilot.
4. Go to *CoPilot > Settings > Resources > Disk Utilization* and click *Attach
   Additional Disk*. If you do not see the disk (volume) you created in the
   list, press the refresh icon.
5. Select the disk/volume you created and click START.
6. When the process is complete, click FINISH.

<a id="expdisk" />

## Expand a Disk (Volume) for CoPilot Storage

For data disks you already allocated to your CoPilot deployment, increase their
size.

To expand a disk (volume) that is allocated to your CoPilot deployment:

1. Log in to your CSP account and locate the disk (volume) attached to your
   CoPilot instance that you want to expand for CoPilot storage.
2. Increase the size of the disk (volume).
3. After you receive confirmation from the CSP that the disk is resized, log in
   to CoPilot.
4. Go to CoPilot > Settings > Resources.
5. In the Disk Usage table, expand the tree-pane icon (shown) for the physical
   volume associated with your resized data disk.

<img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/tree-pane-icon-disk-usage.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=8eb5968aa2596a7ad0218601df02f332" alt="tree-pane-icon-disk-usage-table" width="889" height="95" data-path="images/guides/controlplane/tree-pane-icon-disk-usage.png" /> 6.
Click the enabled RESIZE button. CoPilot resizes the physical volume to match
the size of your expanded disk.

<a id="monitor-data-disk-volume-utilization" />

## Monitor Data Disk (Volume) Utilization

In the *CoPilot > Settings > Resources > Disk Utilization* page, CoPilot shows
you the following:

* Disk Usage section

Shows a chart of *database disk used* broken down by the top five indices. This
shows which indices are currently taking up the most space and the overall
amount.

* Estimated Disk Runway section

Shows, in general, when the database would become full and how fast it is
growing each day. Assuming data retention policies are working properly, it is
expected the database will not run out of space since data is deleted regularly
per the policies.

* Data Retention Policy

Enables you to set data retention policies for the data in CoPilot's logical
disk (volume).

<a id="data-retention" />

## Set Data Retention Policies for the Logical Disk (Volume)

You can set data retention policies for the CoPilot data stored in the logical
disk (volume) in *CoPilot > Settings > Resources > Disk Utilization*.

You can use the *Critical Capacity Management* setting to configure overall
retention for all indices.

If you want the index retention to be longer for individual indices, you can
scroll down the list of indices and configure their respective retention
policies.

## Monitor Daily Size of NetFlow Indices

You can check the daily size of NetFlow indices in your CoPilot storage in the
*CoPilot > Settings > Resources > Index Management* page. If you click the
filter icon and type `netflow` in the value column to create the filter
`Index Name contains netflow`, CoPilot shows the netflow indices and their
sizes.

## Monitor Daily Size of Gateway Metrics Indices

Gateway node exporter metrics (`gw-metrics`) scale with the number of Aviatrix
gateways CoPilot is monitoring. At larger fleet sizes, daily `gw-metrics` ingest
can approach or exceed NetFlow and DCF logs under moderate traffic, which causes
the disk retention policy to trigger sooner than expected.

For sizing purposes, plan for approximately **50 MB per gateway per day** of
`gw-metrics` storage. This translates to:

| Gateway count  | Approximate daily `gw-metrics` ingest |
| -------------- | ------------------------------------- |
| 100 gateways   | \~5 GB/day                            |
| 550 gateways   | \~30 GB/day                           |
| 1,000 gateways | \~50 GB/day                           |
| 1,400 gateways | \~80 GB/day                           |

Actual usage can vary with the number of external interfaces per gateway and
other metric cardinality factors.

You can check the daily size of `gw-metrics` indices in *CoPilot > Settings >
Resources > Index Management*. Click the filter icon and type `gw-metrics` in
the value column to create the filter `Index Name contains gw-metrics`.

If `gw-metrics` is consuming more disk than expected for your retention window,
either add storage (see
[Add a Disk (Volume) for CoPilot Storage after Deployment](#add-a-disk-volume-for-copilot-storage-after-deployment))
or shorten the retention setting for the `gw-metrics` index in *Settings >
Resources > Disk Utilization*.
