Volumes
Learn how to create and manage volumes in Andasy.
Volumes are persistent storage resources that can be attached to machines in Andasy. They allow you to store data that needs to persist across machine restarts and scale your application horizontally by sharing data between multiple machines.
Creating a Volume
To create a volume using the Andasy CLI, run the following command in your terminal:
andasy volumes create -a <app-name> -s <size> <volume-name>
Replace <app-name>
with the name of the application that you want to associate the volume with, <size>
with the size of the volume in MB, and <volume-name>
with the name of the volume.
The volume will be created and associated with the specified application.
Attaching volume to a machine
Volume are attached to a specific machine of an app in andasy.hcl
configuration file
app_name = "app"
app {
...
...
storage {
name = <volume-name>
destination = <mountpoint>
}
}
<volume-name>
is the name you provided to your volume during volume create. <mountpoint>
is the mounting point of your volume.
List Volumes
To list all the volumes associated with an application, run the following command:
andasy volumes list -a <app-name>
Replace <app-name>
with the name of the application that you want to list volumes for.
This command will display a list of all the volumes associated with the specified application.
Deleting a volume
To delete a volume associated with an application, run the following command:
andasy volumes delete -a <app-name>
Replace <app-name>
with the name of the application that owns the volume. Required if config.hcl
is not present.
It is advised to keep the ID of this volume since it can be used to download its snapshot. Snapshot of a deleted volume can be retained for a limited time, so you have to download them preferably after 24 hours.
Warning:
This volume must not be attached to an existing machine of an app before being deleted.
Snapshots
Snapshots are point-in-time copies of a volume. They can be used to create a backup of your data or to restore your data to a previous state. Read more about snapshots here.