]>
Commit | Line | Data |
---|---|---|
93f65836 SI |
1 | [[storage_zfs]] |
2 | ZFS over ISCSI Backend | |
3 | ---------------------- | |
4 | ifdef::wiki[] | |
5 | :pve-toplevel: | |
6 | :title: Storage: ZFS over ISCSI | |
7 | endif::wiki[] | |
8 | ||
9 | Storage pool type: `zfs` | |
10 | ||
11 | This backend accesses a remote machine having a ZFS pool as storage and an iSCSI | |
12 | target implementation via `ssh`. For each guest disk it creates a ZVOL and, | |
13 | exports it as iSCSI LUN. This LUN is used by {pve} for the guest disk. | |
14 | ||
15 | The following iSCSI target implementations are supported: | |
16 | ||
17 | * LIO (Linux) | |
18 | * IET (Linux) | |
19 | * ISTGT (FreeBSD) | |
20 | * Comstar (Solaris) | |
21 | ||
22 | NOTE: This plugin needs a ZFS capable remote storage appliance, you cannot use | |
23 | it to create a ZFS Pool on a regular Storage Appliance/SAN | |
24 | ||
25 | ||
26 | Configuration | |
27 | ~~~~~~~~~~~~~ | |
28 | ||
29 | In order to use the ZFS over iSCSI plugin you need to configure the remote | |
30 | machine (target) to accept `ssh` connections from the {pve} node. {pve} connects to the target for creating the ZVOLs and exporting them via iSCSI. | |
31 | Authentication is done through a ssh-key (without password protection) stored in | |
32 | `/etc/pve/priv/zfs/<target_ip>_id_rsa` | |
33 | ||
34 | The following steps create a ssh-key and distribute it to the storage machine | |
35 | with IP 192.0.2.1: | |
36 | ||
37 | ---- | |
38 | mkdir /etc/pve/priv/zfs | |
39 | ssh-keygen -f /etc/pve/priv/zfs/192.0.2.1_id_rsa | |
40 | ssh-copy-id -i /etc/pve/priv/zfs/192.0.2.1_id_rsa.pub root@192.0.2.1 | |
41 | ssh -i /etc/pve/priv/zfs/192.0.2.1_id_rsa root@192.0.2.1 | |
42 | ---- | |
43 | ||
44 | The backend supports the common storage properties `content`, `nodes`, | |
45 | `disable`, and the following ZFS over ISCSI specific properties: | |
46 | ||
47 | pool:: | |
48 | ||
49 | The ZFS pool/filesystem on the iSCSI target. All allocations are done within that | |
50 | pool. | |
51 | ||
52 | portal:: | |
53 | ||
54 | iSCSI portal (IP or DNS name with optional port). | |
55 | ||
56 | target:: | |
57 | ||
58 | iSCSI target. | |
59 | ||
60 | iscsiprovider:: | |
61 | ||
62 | The iSCSI target implementation used on the remote machine | |
63 | ||
64 | comstar_tg:: | |
65 | ||
66 | target group for comstar views. | |
67 | ||
68 | comstar_hg:: | |
69 | ||
70 | host group for comstar views. | |
71 | ||
72 | lio_tpg:: | |
73 | ||
74 | target portal group for Linux LIO targets | |
75 | ||
76 | nowritecache:: | |
77 | ||
78 | disable write caching on the target | |
79 | ||
80 | blocksize:: | |
81 | ||
82 | Set ZFS blocksize parameter. | |
83 | ||
84 | sparse:: | |
85 | ||
86 | Use ZFS thin-provisioning. A sparse volume is a volume whose | |
87 | reservation is not equal to the volume size. | |
88 | ||
89 | ||
90 | .Configuration Examples (`/etc/pve/storage.cfg`) | |
91 | ---- | |
92 | zfs: lio | |
93 | blocksize 4k | |
94 | iscsiprovider LIO | |
95 | pool tank | |
96 | portal 192.0.2.111 | |
97 | target iqn.2003-01.org.linux-iscsi.lio.x8664:sn.xxxxxxxxxxxx | |
98 | content images | |
99 | lio_tpg tpg1 | |
100 | sparse 1 | |
101 | ||
102 | zfs: solaris | |
103 | blocksize 4k | |
104 | target iqn.2010-08.org.illumos:02:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:tank1 | |
105 | pool tank | |
106 | iscsiprovider comstar | |
107 | portal 192.0.2.112 | |
108 | content images | |
109 | ||
110 | zfs: freebsd | |
111 | blocksize 4k | |
112 | target iqn.2007-09.jp.ne.peach.istgt:tank1 | |
113 | pool tank | |
114 | iscsiprovider istgt | |
115 | portal 192.0.2.113 | |
116 | content images | |
117 | ||
118 | zfs: iet | |
119 | blocksize 4k | |
120 | target iqn.2001-04.com.example:tank1 | |
121 | pool tank | |
122 | iscsiprovider iet | |
123 | portal 192.0.2.114 | |
124 | content images | |
125 | ---- | |
126 | ||
127 | Storage Features | |
128 | ~~~~~~~~~~~~~~~~ | |
129 | ||
130 | The ZFS over iSCSI plugin provides a shared storage, which is capable of | |
131 | snapshots. You need to make sure that the ZFS appliance does not become a single | |
132 | point of failure in your deployment. | |
133 | ||
134 | .Storage features for backend `iscsi` | |
135 | [width="100%",cols="m,m,3*d",options="header"] | |
136 | |============================================================================== | |
137 | |Content types |Image formats |Shared |Snapshots |Clones | |
138 | |images |raw |yes |yes |no | |
139 | |============================================================================== |