Volumes

Volumes are the basic service of the StorPool storage system. A volume always has a name, a global ID and a certain size. It can be read from and written to. It could be attached to hosts as read-only or read-write block device under the /dev/storpool directory (available as well at /dev/storpool-byid).

digraph G {
  rankdir=TD;
  compound=true;
  ranksep=1;
  image=svg;

  subgraph cluster_step_0 {
    shape="box";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    a1 [shape="box",label="vol1"];
  }

}

A single volume

The volume name is a string consisting of one or more of the allowed characters - upper and lower Latin letters (a-z,A-Z), numbers (0-9) and the delimiters dot (.), colon (:), dash (-) and underscore (_).

Creating a volume

digraph G {
  rankdir=LR;
  compound=true;
  ranksep=1;
  image=svg;
  edge [min=2]

  subgraph cluster_step_0 {
    label="Before";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [color=transparent,fillcolor=transparent];
    a1 [shape="box",label="(no volume)"];
  }

  subgraph cluster_step_1 {
    label="After";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    b1 [shape="box",label="volume1"];
  }
// It only works because the length of '(empty)' and 'volume1' is the same ..

  a1 -> b1 [label="Create" ltail="cluster_step_0" lhead="cluster_step_1"  ];
}

Creating a volume

All volumes are thin provisioned. Creating a volume is not limited to physical disk or disk pool size. Creating a volume doesn’t pre-allocate physical space in the storage cluster.

Here is an example how you can create a volume using the CLI (see Creating a volume):

# storpool volume volume1 create size 100G template ssd

Deleting a volume

digraph G {
  rankdir=LR;
  compound=true;
  ranksep=1;
  image=svg;
  edge [min=2]

  subgraph cluster_step_0 {
    label="Before";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    a1 [shape="box",label="volume1"];
  }

  subgraph cluster_step_1 {
    label="After";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [color=transparent,fillcolor=transparent];
    b1 [shape="box",label="(no volume)"];
  }

  a1 -> b1 [label="Delete" ltail="cluster_step_0" lhead="cluster_step_1"  ];
}

Deleting a volume

Here is an example how you can delete a volume using the CLI (see Deleting volumes):

# storpool volume volume1 delete volume1

Renaming a volume

digraph G {
  rankdir=LR;
  compound=true;
  ranksep=1;
  image=svg;
  edge [min=2]

  subgraph cluster_step_0 {
    label="Before";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    a1 [shape="box",label="volume1"];
  }

  subgraph cluster_step_1 {
    label="After";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    b1 [shape="box",label="volume2"];
  }

  a1 -> b1 [label="Rename" ltail="cluster_step_0" lhead="cluster_step_1"];
}

Renaming a volume

Here is an example how you can rename a volume using the CLI (see Renaming volumes):

# storpool volume volume1 update rename volume2

Resizing a volume

digraph G {
  rankdir=LR;
  compound=true;
  ranksep=1;
  image=svg;
  edge [min=2]

  subgraph cluster_step_0 {
    label="Before";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    a1 [shape="box",label="volume1\n100GB"];
  }

  subgraph cluster_step_1 {
    label="After";
    shape="square";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    b1 [shape="box",label="volume1\n101GB"];
  }

  a1 -> b1 [label="Resize" ltail="cluster_step_0" lhead="cluster_step_1"];
}

Resizing a volume

Here is an example how you can resize a volume using the CLI (see Resizing volumes):

# storpool volume volume1 update size +1G

Cloning a volume

You have a volume:

digraph G {
  rankdir=TD;
  compound=true;
  ranksep=1;
  image=svg;

  subgraph cluster_step_0 {
    shape="box";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    a1 [shape="box",label="vol1"];
  }

}

When you clone it the system performs two steps. First, it creates a new transient snapshot of the volume. Then it creates a second volume, which is based on the same snapshot.

digraph G {
  rankdir=TB;
  compound=true;
  ranksep=1;
  image=svg;
  edge [min=2]

  subgraph cluster_step_0 {
    shape="box";
    style="filled";
    color="black";
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    snap1 [shape="ellipse",label="vol1@5"];
    vol1 [shape="box",label="vol1"];
    vol2 [shape="box",label="vol2"];
    snap1 -> {vol1 vol2}
  }


}

Cloned volumes with transient snapshot

Here is an example how you can clone a volume using the CLI (see Volume operations):

# storpool volume vol2 create size 2G template ssd baseOn vol1

Rebasing a volume

The rebasing operations can be performed when using the snapshot functionality (see Snapshots). For details on how rebasing works on the command line, see Rebasing volumes.

Rebasing to null (promoting a volume)

The vol1 volume is based on the snap1 snapshot (see the diagram below). snap1 is in turn based on snap0. snap1 contains the changes between the moment snap0 was taken and when snap1 was taken. vol1 contains the changes since the moment snap1 was taken.

digraph G {
  rankdir=TB;
  image=svg;
  ranksep=0.5;
  compound=true;

  subgraph cluster_0 {
    shape="box";
    style=filled;
    color=black;
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    snap0 [shape="ellipse",label="snap0"];
    snap1 [shape="ellipse",label="snap1"];
    vol1 [shape="box",label="vol1"];
    snap0 -> snap1;
    snap1 -> vol1;
  }
}

Before rebase to null

After promotion the vol1 volume is not based on a snapshot. It now contains all data, not just the changes since snap1 was taken. Any relation between snap1 and snap0 is unaffected.

digraph G {
  rankdir=TB;
  image=svg;
  ranksep=0.5;
  compound=true;

  subgraph cluster_0 {
    shape="box";
    style=filled;
    color=black;
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    snap0 [shape="ellipse",label="snap0"];
    snap1 [shape="ellipse",label="snap1"];
    vol1 [shape="box",label="vol1"];
    snap0 -> snap1;
  }
}

After rebase to null

Here is an example how you can promote a volume using the CLI:

# storpool volume vol1 rebase

Rebasing a volume to a snapshot

The vol1 volume is based on the snap1 snapshot (see the diagram below). snap1 is in turn based on snap0. snap1 contains the changes between the moment snap0 was taken and when snap1 was taken. vol1 contains the changes since the moment snap1 was taken.

digraph G {
  rankdir=TB;
  image=svg;
  ranksep=0.5;
  compound=true;

  subgraph cluster_0 {
    shape="box";
    style=filled;
    color=black;
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    snap0 [shape="ellipse",label="snap0"];
    snap1 [shape="ellipse",label="snap1"];
    vol1 [shape="box",label="vol1"];
    snap0 -> snap1;
    snap1 -> vol1;
  }
}

Before rebase

After the rebase operation vol1 is based on snap0. vol1 now contains all changes since snap0 was taken, not just since snap1. snap1 is unchanged.

digraph G {
  rankdir=TB;
  image=svg;
  ranksep=0.5;
  compound=true;

  subgraph cluster_0 {
    shape="box";
    style=filled;
    color=black;
    fillcolor="lightgrey:white";
    gradientangle=90;
    node [style=filled,color=black,fillcolor=white];
    snap0 [shape="ellipse",label="snap0"];
    snap1 [shape="ellipse",label="snap1"];
    vol1 [shape="box",label="vol1"];
    snap0 -> snap1;
    snap0 -> vol1;
  }
}

After rebase

Here is an example how you can rebase a volume using the CLI:

# storpool volume vol rebase snap0

More information

Volumes and snapshots