Using Volumes in Horizon¶
About Volumes¶
A volume is a virtual block device that may be attached to a running/active instance. Data saved to a volume is maintained across successive attachment/detachment actions.
On the left side bar, click on Project → Volumes → Volumes.
Creating a Volume¶
- Click
+ Create Volume - Volume Name: Choose short name for your volume, e.g.
<username>_data - Description: Briefly describe the volume contents
- Volume Source: There are two options,
emptyandimageempty: creates a blank volume of the specified sizeimage: uses an existingimageas a template for a new volume. Select from availableimages
- Size: modify the size of the size of the volume.All volumes count against the project’s storage quota
- Click
Create Volume


Attaching a Volume¶
- Click
Manage Attachmentsfor the desired volume

- Select an instance to attach to, and click
Attach Volume

- The device on a particular instance will now be listed in the
Attached Tocolumn

sshto your instance, create any filesystems as needed, create a mountpoint, and mount the volume.- ssh:
ssh ubuntu@ip - check if device is attached:
sudo fdisk -l <device>, often/dev/sdb - if new disk, create filesystem:
sudo mkfs.ext4 <device> - create a mountpoint:
sudo mkdir -p <path>, e.g./mnt/vol_b - mount the volume:
sudo mount -o noatime <device> <path>, e.g.sudo mount -o noatime /dev/sdb /mnt/vol_b - check the mount:
ubuntu@test-horizon-tiny:~$ df -kh /mnt/vol_b Filesystem Size Used Avail Use% Mounted on /dev/sdb 98G 24K 93G 1% /mnt/vol_b - you may need to change the permissions to make the volume accessible:
sudo chown ubuntu.ubuntu /mnt/vol_b - To make the volume mount persist, you can add an entry to
/etc/fstabsimilar to this::
/dev/sdb /mnt/vol_b ext4 defaults,noatime 0 0
- ssh:
Detaching a Volume¶
sshto your instance and unmount the volume:- ssh:
ssh ubuntu@ip - unmount:
sudo umount /mnt/vol_b
- ssh:
- In Horizon
Project→Volumes→Volumes, clickManage Attachmentsfor the desired volume - Select an instance, and click
Detach Volume

- Confirm
Detach Volume

Deleting a Volume¶
- In Horizon
Project→Volumes→Volumes, clickActionsfor the desired volume

- Click
Delete Volume -
Confirm your selection.
Deletion is permanent.
Deleted volumes are not recoverable. All data stored in the volume will be removed.
-
Confirm
Delete Volume