.. _Managing Volumes:

Managing Volumes
----------------

A volume in Virtuozzo Infrastructure Platform is a virtual disk drive that can be attached to a VM. The integrity of data in volumes is protected by a redundancy mode specified in a storage policy.

.. _Creating, Editing, and Removing Volumes:

Creating, Editing, and Removing Volumes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To create a volume, do the following:

#. On the **COMPUTE** > **VOLUMES** tab, click **Add volume**.

   .. image:: ../../../images/stor_image79.png
      :align: center
      :class: align-center

#. In the **Add volume** window, specify volume name and size in gigabytes; select a storage policy from the corresponding drop-down list; click **Add**.

   .. to be added: create a volume from an existing snapshot; check **Create from snapshot** and select a volume from the corresponding drop-down list.

To edit a volume, select it and click the pencil icon next to a parameter you need to change. You cannot shrink volumes. To expand volumes that are in use, detach them first.

.. unclear if you can change storage policy.

To remove a volume, click the corresponding ellipsis button then click **Delete**. To remove multiple volumes at once, select them and click **Delete**. To remove a boot volume, first replace it with another one. To remove a volume that is in use, detach it first.

.. A volume cannot be removed if it has at least one snapshot.

.. _Attaching and Detaching Volumes:

Attaching and Detaching Volumes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. Probably, there will also be a cloning action.

To add a writable virtual disk drive to a VM, attach a volume to it. To do this:

#. On the **COMPUTE** > **VOLUMES** tab, click the ellipsis button next to an unused volume and click **Attach** in the context menu.

   .. image:: ../../../images/stor_image80.png
      :align: center
      :class: align-center

#. In the **Attach volume** window, select the VM from the drop-down list and click **Done**.

To detach a volume, do the following:

#. Click the ellipsis button next to the volume that is in use.

#. Click **Detach** to gracefully stop all operations and detach the volume; or click **Force detach** to immediately detach it with a risk of data loss.

.. Section to add: Managing Snapshots
