Skip to content

Commit b8743eb

Browse files
authored
Doc: [WD-20812] Manage storage volumes (#15304)
Storage Volume page - How to manage storage volumes: - View storage volumes - Create a custom storage volume - Attach the volume to an instance - Configure storage volume settings - [Added] Create a storage volume in a cluster [ X ] - Storage volumes images optimised
2 parents 3f44a75 + adb1094 commit b8743eb

6 files changed

Lines changed: 150 additions & 8 deletions

‎doc/howto/storage_volumes.md‎

Lines changed: 150 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ See the following sections for instructions on how to create, configure, view an
1010

1111
You can display a list of all available storage volumes and check their configuration.
1212

13+
`````{tabs}
14+
````{group-tab} CLI
15+
1316
To list all available storage volumes, use the following command:
1417
1518
lxc storage volume list
@@ -37,6 +40,15 @@ To show state information about a specific volume, use the following command:
3740
3841
In both commands, the default {ref}`storage volume type <storage-volume-types>` is `custom`, so you can leave out the `custom/` when displaying information about a custom storage volume.
3942
43+
````
44+
```` {group-tab} UI
45+
46+
From the main navigation, select {guilabel}`Storage` > {guilabel}`Volumes`.
47+
The resulting page displays a table of available volumes. You can sort volumes by their pool by clicking the {guilabel}`Pool` column header of the table.
48+
49+
````
50+
`````
51+
4052
## Create a custom storage volume
4153

4254
When you create an instance, LXD automatically creates a storage volume that is used as the root disk for the instance.
@@ -49,6 +61,9 @@ See {ref}`storage-volumes` for detailed information.
4961

5062
### Create the volume
5163

64+
`````{tabs}
65+
````{group-tab} CLI
66+
5267
Use the following command to create a custom storage volume `vol1` of type `filesystem` in storage pool `my-pool`:
5368
5469
lxc storage volume create my-pool vol1
@@ -57,19 +72,27 @@ By default, custom storage volumes use the `filesystem` {ref}`content type <stor
5772
To create a custom volume with content type `block`, add the `--type` flag:
5873
5974
lxc storage volume create my-pool vol2 --type=block
75+
````
76+
```` {group-tab} UI
6077
61-
```{note}
62-
For most storage drivers, custom storage volumes are not replicated across the cluster and exist only on the member for which they were created.
63-
This behavior is different for remote storage pools (`ceph`, `cephfs` and `powerflex`), where volumes are available from any cluster member.
64-
```
6578
66-
To add a custom storage volume on cluster member `member1`, add the `--target` flag:
79+
From the main navigation, select {guilabel}`Storage` > {guilabel}`Volumes`.
6780
68-
lxc storage volume create my-pool vol3 --target=member1
81+
On the resulting page, click {guilabel}`Create volume` in the upper-right corner.
6982
70-
To create a custom storage volume of type `iso`, use `import` instead of `create`:
83+
You can then configure the name and size of your storage volume.
7184
72-
lxc storage volume import my-pool <iso_path> vol4 --type=iso
85+
You can select a content type from the {guilabel}`Content type` dropdown. Additional settings might appear, depending on the content type selected.
86+
87+
Click {guilabel}`Create` to create the storage pool.
88+
89+
```{figure} /images/storage/storage_volumes_create.png
90+
:width: 80%
91+
:alt: Create a storage volume in LXD
92+
```
93+
94+
````
95+
`````
7396

7497
(storage-attach-volume)=
7598
### Attach the volume to an instance
@@ -84,6 +107,9 @@ The following restrictions apply:
84107
- Storage volumes of {ref}`content type <storage-content-types>` `iso` are always read-only, and can therefore be attached to more than one virtual machine at a time without corrupting data.
85108
- Storage volumes of {ref}`content type <storage-content-types>` `filesystem` can't be attached to virtual machines while they're running.
86109

110+
`````{tabs}
111+
````{group-tab} CLI
112+
87113
Use the following command to attach a custom storage volume `fs-vol` with content type `filesystem` to instance `c1`.
88114
`/data` is the mount point for the storage volume inside the instance:
89115
@@ -131,11 +157,52 @@ All I/O limits only apply to actual block device access.
131157
Therefore, consider the file system's own overhead when setting limits.
132158
Access to cached data is not affected by the limit.
133159
160+
````
161+
162+
```` {group-tab} UI
163+
You can attach a storage volume to an existing instance, or when creating a new instance:
164+
165+
- For an existing instance, select {guilabel}`Instances` from the main navigation, then select the target instance to view its details page. Open its {guilabel}`Configuration` tab.
166+
- For a new instance, you must first select a base image during the instance creation process.
167+
168+
In either scenario, then select {guilabel}`Disk` from the {guilabel}`Devices` section of the secondary menu.
169+
170+
Click {guilabel}`Attach disk device`.
171+
172+
```{figure} /images/storage/storage_volumes_attach_to_instance_1.png
173+
:width: 80%
174+
:alt: Attach a storage volume to an instance - Disk configuration page
175+
```
176+
177+
The resulting modal allows you to choose your disk type. Select {guilabel}`Attach custom volume`:
178+
179+
```{figure} /images/storage/storage_volumes_attach_to_instance_2.png
180+
:width: 80%
181+
:alt: Attach a storage volume to an instance - Attach disk device modal
182+
```
183+
184+
Next, you can either select a pre-existing volume to attach to the instance by clicking its corresponding {guilabel}`Select` button, or create a new custom volume by clicking {guilabel}`Create volume`:
185+
186+
```{figure} /images/storage/storage_volumes_attach_to_instance_3.png
187+
:width: 80%
188+
:alt: Attach a storage volume to an instance - Attach custom volume modal
189+
```
190+
191+
Once the modal closes, you might be required to add a mount point file path in the {guilabel}`Mount point` field.
192+
Finally, you can save your instance changes. If you are in the instance creation process, create your instance by clicking {guilabel}`Create`.
193+
194+
195+
````
196+
`````
197+
134198
(storage-volume-special)=
135199
### Use the volume for backups or images
136200

137201
Instead of attaching a custom volume to an instance as a disk device, you can also use it as a special kind of volume to store {ref}`backups <backups>` or {ref}`images <about-images>`.
138202

203+
`````{tabs}
204+
````{group-tab} CLI
205+
139206
To do so, you must set the corresponding {ref}`server configuration <server-options-misc>`:
140207
141208
- To use a custom volume `my-backups-volume` to store the backup tarballs:
@@ -146,11 +213,23 @@ To do so, you must set the corresponding {ref}`server configuration <server-opti
146213
147214
lxc config set storage.images_volume=my-pool/my-images-volume
148215
216+
````
217+
````{group-tab} UI
218+
219+
To use a volume to store backups or images, select {guilabel}`Settings` from the main navigation. From this page, set the value of the {guilabel}`storage.backups_volume` key or the {guilabel}`storage.images_volume` key to the name of the target storage volume, then select {guilabel}`Save`.
220+
221+
222+
````
223+
`````
224+
149225
(storage-configure-volume)=
150226
## Configure storage volume settings
151227

152228
See the {ref}`storage-drivers` documentation for a list of available storage volume configuration options for each driver.
153229

230+
`````{tabs}
231+
````{group-tab} CLI
232+
154233
To set the maximum size of custom storage volume `my-volume` to 1 GiB, use the following command:
155234
156235
lxc storage volume set my-pool my-volume size=1GiB
@@ -231,3 +310,66 @@ For example, to resize `my-volume` in storage pool `my-pool` to `15GiB`, use the
231310
- Shrinking a storage volume with content type `block` is not possible.
232311
233312
```
313+
314+
````
315+
```` {group-tab} UI
316+
317+
To configure a custom storage volume, select {guilabel}`Storage` > {guilabel}`Volumes` from the main navigation. Next, click the name of your target storage volume to view its details page.
318+
319+
```{note}
320+
Volume details pages are only available for volumes of type Custom. Volumes of other types—such as Instance root disks—can also be accessed from the Volumes page and redirect to their respective entity overview or list page.
321+
322+
To sort the Volumes table by type, you can click the {guilabel}`Content type` column header.
323+
```
324+
325+
On the volume's overview page, go to the {guilabel}`Configuration` tab. Here, you can configure settings such as the storage volume size. Further configuration options can be found in the secondary menu.
326+
After making changes, click the {guilabel}`Save changes` button. This button also displays the number of changes you have made.
327+
328+
````
329+
`````
330+
331+
## Create a storage volume in a cluster
332+
333+
For most storage drivers, custom storage volumes are not replicated across the cluster and exist only on the member for which they were created.
334+
This behavior differs for remote storage pools (`ceph`, `cephfs` and `powerflex`), where volumes are available from any cluster member.
335+
336+
`````{tabs}
337+
````{group-tab} CLI
338+
339+
To add a custom storage volume on a cluster member, add the `--target` flag:
340+
341+
```bash
342+
lxc storage volume create <pool-name> <volume-name> --target=<member-name>
343+
```
344+
345+
Example:
346+
```bash
347+
lxc storage volume create my-pool my-volume --target=my-member
348+
```
349+
350+
To create a custom storage volume of type `iso`, use `import` instead of `create`:
351+
352+
```bash
353+
lxc storage volume import <pool-name> <path-to-iso> <volume-name> --type=iso
354+
```
355+
356+
357+
````
358+
```` {group-tab} UI
359+
360+
To create a storage volume in a clustered environment, select {guilabel}`Storage` > {guilabel}`Volumes` from the main navigation. On the Volumes page, click {guilabel}`Create volume` in the upper-right corner.
361+
362+
On the volume creation page, select the cluster member on which to base the storage volume from the {guilabel}`Cluster member` dropdown. This dropdown is only available if the storage pool selected for this volume is cluster-member specific, rather than shared across the cluster.
363+
364+
```{figure} /images/storage/storage_volumes_create_clustered.png
365+
:width: 80%
366+
:alt: Create a custom storage volume in a clustered environment
367+
```
368+
369+
````
370+
`````
371+
372+
To find out more about clusters in LXD, see:
373+
374+
- {ref}`Clustering how-to guides <clustering>`
375+
- {ref}`An explanation about clusters <exp-clusters>`
35.7 KB
Loading
8.95 KB
Loading
16.1 KB
Loading
52.6 KB
Loading
54.1 KB
Loading

0 commit comments

Comments
 (0)