Skip to content

Commit 8192ebd

Browse files
committed
feat: [WD-20812] Manage storage volumes
Signed-off-by: Nkeiruka <nkeiruka.whenu@canonical.com>
1 parent 608d63b commit 8192ebd

6 files changed

Lines changed: 135 additions & 8 deletions

‎doc/howto/storage_volumes.md‎

Lines changed: 135 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+
To view available storage volumes in the UI, from the {guilabel}`Storage` section of the main navigation, select {guilabel}`Volumes`.
47+
You can filter volumes by their pool by clicking on the {guilabel}`Pool` tab 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+
To create a custom storage volume, expand the {guilabel}`Storage` section from the main navigation and select {guilabel}`Volumes`.
6780
68-
lxc storage volume create my-pool vol3 --target=member1
81+
On the resulting screen, 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+
From this screen, you can 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,48 @@ 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+
```` {group-tab} UI
162+
To attach a storage volume to an instance, navigate to the configuration page of the target instance.
163+
164+
In the secondary menu, expand {guilabel}`Devices` and select {guilabel}`Disk`.
165+
166+
From here, select {guilabel}`Attach disk device`.
167+
168+
```{figure} /images/storage/storage_volumes_attach_to_instance_1.png
169+
:width: 80%
170+
:alt: Attach a storage volume to an instance - Disk configuration page
171+
```
172+
173+
The resulting modal will allow you to choose your disk type, select {guilabel}`Attach custom volume`.
174+
175+
```{figure} /images/storage/storage_volumes_attach_to_instance_2.png
176+
:width: 80%
177+
:alt: Attach a storage volume to an instance - Attach disk device modal
178+
```
179+
180+
Next, you can select a pre-existing volume to attach to the instance by clicking {guilabel}`Select`, or create a new custom volume by selecting {guilabel}`Create volume`.
181+
182+
```{figure} /images/storage/storage_volumes_attach_to_instance_3.png
183+
:width: 80%
184+
:alt: Attach a storage volume to an instance - Attach custom volume modal
185+
```
186+
187+
Once the modal closes, you may need to add a Mount Point file path in the {guilabel}`Mount point` field.
188+
Finally, you can proceed to either save your instance changes. If you were in the instance creation process, create your instance by selecting {guilabel}`Create`.
189+
190+
191+
````
192+
`````
193+
134194
(storage-volume-special)=
135195
### Use the volume for backups or images
136196

137197
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>`.
138198

199+
`````{tabs}
200+
````{group-tab} CLI
201+
139202
To do so, you must set the corresponding {ref}`server configuration <server-options-misc>`:
140203
141204
- To use a custom volume `my-backups-volume` to store the backup tarballs:
@@ -146,11 +209,24 @@ To do so, you must set the corresponding {ref}`server configuration <server-opti
146209
147210
lxc config set storage.images_volume=my-pool/my-images-volume
148211
212+
````
213+
````{group-tab} UI
214+
215+
To use a volume to store backups or images, select the {guilabel}`Settings` tab of main navigation and set the {guilabel}`value` property of the {guilabel}`storage.backups_volume` key or {guilabel}`storage.images_volume` key to the name of the relevant storage volume using the provided syntax.
216+
217+
Select {guilabel}`Save` to save your changes.
218+
219+
````
220+
`````
221+
149222
(storage-configure-volume)=
150223
## Configure storage volume settings
151224

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

227+
`````{tabs}
228+
````{group-tab} CLI
229+
154230
To set the maximum size of custom storage volume `my-volume` to 1 GiB, use the following command:
155231
156232
lxc storage volume set my-pool my-volume size=1GiB
@@ -231,3 +307,54 @@ For example, to resize `my-volume` in storage pool `my-pool` to `15GiB`, use the
231307
- Shrinking a storage volume with content type `block` is not possible.
232308
233309
```
310+
311+
````
312+
```` {group-tab} UI
313+
314+
To configure a custom storage volume, expand the {guilabel}`Storage` section of the main navigation and select {guilabel}`Volumes`. From here, select your target storage volume.
315+
316+
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.
317+
After making changes, click the {guilabel}`Save changes` button. This button also displays the number of changes you have made.
318+
319+
Volume detail 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 will redirect to their respective entity overview or list page.
320+
321+
To view storage volumes that are only of type Custom, whilst on the Volumes page, click {guilabel}`Content type` to filter by volume type.
322+
323+
````
324+
`````
325+
326+
## Create a storage volume in a cluster
327+
For most storage drivers, custom storage volumes are not replicated across the cluster and exist only on the member for which they were created.
328+
This behavior is different for remote storage pools (`ceph`, `cephfs` and `powerflex`), where volumes are available from any cluster member.
329+
330+
````` {tabs}
331+
```` {group-tab} CLI
332+
333+
To add a custom storage volume on cluster member `member1`, add the `--target` flag:
334+
335+
lxc storage volume create my-pool vol3 --target=member1
336+
337+
To create a custom storage volume of type `iso`, use `import` instead of `create`:
338+
339+
lxc storage volume import my-pool <iso_path> vol4 --type=iso
340+
341+
342+
````
343+
```` {group-tab} UI
344+
345+
To create a storage volume in a clustered environment, expand the {guilabel}`Storage` section of the main navigation and navigate to the {guilabel}`Volumes` page. On the volumes list page, click {guilabel}`Create volume` in the upper right corner.
346+
347+
On the volume creation page, you can configure the details of your storage volume, and select the Cluster member on which the storage volume will be based by selecting an appropriate cluster member from the {guilabel}`Cluster member` dropdown. This dropdown will only be available if the selected storage pool is cluster member specific.
348+
349+
```{figure} /images/storage/storage_volumes_create_clustered.png
350+
:width: 80%
351+
:alt: Create a custom storage volume in a clustered environment
352+
```
353+
354+
````
355+
`````
356+
357+
To find out more about clusters in LXD, see:
358+
359+
- {ref}`Clustering how-to guides <clustering>`
360+
- {ref}`An explanation about clusters <exp-clusters>`
35.7 KB
Loading
8.95 KB
Loading
22.8 KB
Loading
52.6 KB
Loading
54.1 KB
Loading

0 commit comments

Comments
 (0)