]>
Commit | Line | Data |
---|---|---|
8119f671 | 1 | [[storage_lvmthin]] |
9801e1c3 DM |
2 | LVM thin Backend |
3 | ---------------- | |
5f09af76 DM |
4 | ifdef::wiki[] |
5 | :pve-toplevel: | |
cb84ed18 | 6 | :title: Storage: LVM Thin |
5f09af76 DM |
7 | endif::wiki[] |
8 | ||
9801e1c3 DM |
9 | Storage pool type: `lvmthin` |
10 | ||
11 | LVM normally allocates blocks when you create a volume. LVM thin pools | |
12 | instead allocates blocks when they are written. This behaviour is | |
13 | called thin-provisioning, because volumes can be much larger than | |
14 | physically available space. | |
15 | ||
16 | You can use the normal LVM command line tools to manage and create LVM | |
8c1189b6 | 17 | thin pools (see `man lvmthin` for details). Assuming you already have |
9801e1c3 DM |
18 | a LVM volume group called `pve`, the following commands create a new |
19 | LVM thin pool (size 100G) called `data`: | |
20 | ||
21 | ---- | |
22 | lvcreate -L 100G -n data pve | |
23 | lvconvert --type thin-pool pve/data | |
24 | ---- | |
25 | ||
26 | ||
27 | Configuration | |
28 | ~~~~~~~~~~~~~ | |
29 | ||
30 | The LVM thin backend supports the common storage properties `content`, `nodes`, | |
31 | `disable`, and the following LVM specific properties: | |
32 | ||
33 | `vgname`:: | |
34 | ||
35 | LVM volume group name. This must point to an existing volume group. | |
36 | ||
37 | `thinpool`:: | |
38 | ||
39 | The name of the LVM thin pool. | |
40 | ||
41 | ||
8c1189b6 | 42 | .Configuration Example (`/etc/pve/storage.cfg`) |
9801e1c3 DM |
43 | ---- |
44 | lvmthin: local-lvm | |
45 | thinpool data | |
46 | vgname pve | |
47 | content rootdir,images | |
48 | ---- | |
49 | ||
50 | ||
51 | File naming conventions | |
52 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
53 | ||
54 | The backend use basically the same naming conventions as the ZFS pool | |
55 | backend. | |
56 | ||
57 | vm-<VMID>-<NAME> // normal VM images | |
58 | ||
59 | ||
60 | Storage Features | |
61 | ~~~~~~~~~~~~~~~~ | |
62 | ||
63 | LVM thin is a block storage, but fully supports snapshots and clones | |
64 | efficiently. New volumes are automatically initialized with zero. | |
65 | ||
66 | It must be mentioned that LVM thin pools cannot be shared across | |
67 | multiple nodes, so you can only use them as local storage. | |
68 | ||
69 | .Storage features for backend `lvmthin` | |
70 | [width="100%",cols="m,m,3*d",options="header"] | |
71 | |============================================================================== | |
72 | |Content types |Image formats |Shared |Snapshots |Clones | |
73 | |images rootdir |raw |no |yes |yes | |
74 | |============================================================================== | |
75 | ||
76 | Examples | |
77 | ~~~~~~~~ | |
78 | ||
79 | List available LVM thin pools on volume group `pve`: | |
80 | ||
81 | # pvesm lvmthinscan pve | |
82 | ||
deb4673f DM |
83 | ifdef::wiki[] |
84 | ||
85 | See Also | |
86 | ~~~~~~~~ | |
87 | ||
f532afb7 | 88 | * link:/wiki/Storage[Storage] |
deb4673f DM |
89 | |
90 | endif::wiki[] |