Console
Volumes
16 min
the storage page allows you to easily access and manage your volumes storage that can be attached to your instances for data storage we currently provide local volumes only , meaning a volume is physically tied to the machine it was created on it can only be attached to instances running on the same physical machine it cannot be moved or attached to instances on other machines volume size cannot be changed after creation, so be sure to choose the size carefully based on your expected storage needs creating a volume in gui this guide will walk you through the process of creating a volume using a template in the gui you can create the volume during instance creation by using a template with volume settings enabled, or you can create a volume by using dropdown menu on the search page how to create a volume via add volume dropdown menu on the search page? select a template then click on add volume dropdown you will see an option labeled local volume with a + (plus) button next to it click + button this will allow you to adjust the volume size using the slider once enabled, offes will display the available volume size create local volume click rent button to launch your instance along with the volume once the instance is running, your volume will be automatically mounted and available inside the container at the /data directory volume on instance you can find your volume information on storage page volume info how to create a volume using a template? choose a template you can either choose an existing template from the recommended list or create your own custom template open template editor (click on pencil icon on a template card) scroll down until you see the disk space (container + volume) section in this section, check the box add recommended volume settings once selected, a new configuration area will appear where you can enter the volume size and specify the installation path a default path is provided, but you can modify it if needed volume settings after filling in the volume details, click save\&use or create\&use template to apply your changes and navigate to the search page offers that support volumes will now display a volume badge showing the available volume size you can adjust the volume size using the slider in the search page after your template is configured select a gpu and click rent button how to view volume pricing? to view pricing details, simply hover over the rent button for any offer deleting volume to delete a volume, the instance it is attached to must be deleted first deleting a volume that is currently mounted to a running or stopped instance is not allowed delete a volume make sure the volume is not attached to any instance if it is, delete the instance first from the instances page once the volume is detached, go to the storage page find the volume you want to delete, click on the three dot menu (⋮) next to it, and select "delete volume" delete volume confirm the deletion this action is permanent and cannot be undone important deleting a volume will permanently remove all data stored in it make sure to back up any important data before proceeding how to create an instance with existing volume? if you already have a volume and want to launch a new instance using it, follow these steps go to the storage page and select the volume you want to use in the volume info section, you will see a button labeled rent instance using this volume click this button you will be redirected to the search page , where available offers are automatically filtered to match the same machine where the volume is located select your preferred offer and proceed to launch the instance the selected volume will be automatically attached to the instance upon creation creating a volume in cli to create a volume, you can use the vast cli see our cli documentation for set up and usage of the cli you can search for volume offers using the command vastai search volumes there is a modified list of search params available, for more information, you can add the help option to the search this will bring up a list of available volume offers you will be able to see the maximum capacity for the volume (in gigabytes) just like creating an instance, you can copy the offer id and create a volume with the command vastai create volume \<offer id> s \<volume size> n \<name> this will send a command to the host machine to allocate the given space to your volume you can optionally specify a name with n, it can be alphanumeric with underscores, with a max length of 64 if all goes well, you should be able to see your volume as created when you run the command vastai show volumes how can i create an instance with a volume? now that your volume is created, you can use it by creating an instance on the machine with the volume, and passing the volume in the env argument the format is v \<volume name> \<mount point>, for example vastai create instance 874 image pytorch/pytorch env ' v v 881 /mnt' disk 30 ssh direct that command mounts your volume at the directory /mnt the directory does not need to exist in order to be mounted can i use my volume on a different machine? you can't directly use the same volume on a different machine, but you can clone the volume to a machine that has an available volume contract the clone command will create a new volume contract on the new machine, provision the volume, and copy all existing data from the existing volume to the new volume to clone a volume, you can use the command vastai clone volume \<existing volume id> \<dest contract id> where \<dest contract id> is a volume offer of at least the size of your existing volume the volumes are independent and do not sync data after the clone is completed any changes that occur (on either) volume after the volume is successfully cloned will not be reflected on the other volume how can i delete my volume? when you're done using it, you can delete your volume using the command vastai delete volume \<volume id> this will only work if all instances using the volume have been destroyed how can i see what instances are using my volume? the command vastai show volumes will display a list of volumes you own, as well as what instances exist that are using that volume a machine with my volume went offline! am i still being charged? just like with normal instances, you are never charged when a machine is offline this is usually a temporary issue, and when the machine comes back online, volume charges will resume as normal if you wish to delete the volume in the meantime, you can do so, and you will not be charged when the machine comes back online if the machine is offline for an extended period of time, please reach out to vast support can i use my volume with a vm instance? at this time, volumes are only supported for docker instances, and cannot be used with vm instances