6.4. Managing Datastores

To keep your virtual machines and containers in Virtuozzo Storage, you can place them in datastores. A datastore is a directory in a Virtuozzo Storage cluster with a number of parameters set for it, namely tier, redundancy, and failure domain.

Warning

If you delete a datastore, all VMs, containers, or backups in it will be deleted!

6.4.1. Creating Datastores

To create a datastore, do the following:

  1. On the SERVICES > COMPUTE screen, click ADD DATASTORES.

    ../_images/stor_image46_2.png
  2. On the Add Datastore panel, specify a name.

  3. In Tier, select the storage tier that will be used for the object storage.

  4. In Failure domain, choose a placement policy for replicas.

  5. In Data redundancy, select the redundancy mode that the object storage will use.

  6. Click Done.

To change the datastore settings later, select it and click Configure.

6.4.2. Placing Virtual Environments and Backups in Datastores

After creating a datastore, you can set it to store your virtual environments and their backups

  • via Virtuozzo Automator (for instructions, refer to the Virtuozzo Automator Administrator’s Guide) or

  • by creating symbolic links from the virtual environments and backups default location to this datastore as follows:

    1. Log in to the server as root.

    2. Check the default location of:

      1. container private area in the /etc/vz/vz.conf file:

        VE_PRIVATE=/vz/private/$VEID
        
      2. virtual machine files by running:

        # prlsrvctl info | grep "VM home"
        VM home: /vz/vmprivate
        
      3. backup files by running:

        # prlsrvctl info | grep "Backup path"
        Backup path: /vz/vmprivate/backups
        
    3. If the /vz/private, /vz/vmprivate, and /vz/vmprivate/backups directories exist on the server, remove them.

    4. Make symbolic links from the containers, virtual machines and backups default locations to the desired datastores. For example, to store your virtual machines in the vmprivate datastore, containers in the private datastore, and their backups in the backups datastore, execute the following commands:

      # ln -s /mnt/vstorage/vols/datastores/vmprivate /vz/vmprivate
      # ln -s /mnt/vstorage/vols/datastores/private /vz/private
      # ln -s /mnt/vstorage/vols/datastores/backups /vz/vmprivate/backups
      

The newly created virtual environments and backups will be placed and stored in their respective datastores.