Storage: CIFS: Difference between revisions
(Created page with "<!--PVE_IMPORT_START_MARKER--> <!-- Do not edit - this is autogenerated content --> {{#pvedocs:pve-storage-cifs-plain.html}} Category:Reference Documentation <pvehide>...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
The CIFS backend extends the directory backend, so that no manual | The CIFS backend extends the directory backend, so that no manual | ||
setup of a CIFS mount is needed. Such a storage can be added directly | setup of a CIFS mount is needed. Such a storage can be added directly | ||
through the Proxmox VE API or the | through the Proxmox VE API or the web UI, with all our backend advantages, | ||
like server heartbeat check or comfortable selection of exported | like server heartbeat check or comfortable selection of exported | ||
shares. | shares. | ||
Line 20: | Line 20: | ||
server, or list the server in the local /etc/hosts file. | server, or list the server in the local /etc/hosts file. | ||
share | share | ||
CIFS share to use (get available ones with pvesm | CIFS share to use (get available ones with pvesm scan cifs <address> or the | ||
Required. | web UI). Required. | ||
username | username | ||
The username for the CIFS storage. Optional, defaults to ‘guest’. | The username for the CIFS storage. Optional, defaults to ‘guest’. | ||
Line 27: | Line 27: | ||
The user password. Optional. | The user password. Optional. | ||
It will be saved in a file only readable by root | It will be saved in a file only readable by root | ||
(/etc/pve/priv/< | (/etc/pve/priv/storage/<STORAGE-ID>.pw). | ||
domain | domain | ||
Sets the user domain (workgroup) for this storage. Optional. | Sets the user domain (workgroup) for this storage. Optional. | ||
Line 35: | Line 35: | ||
path | path | ||
The local mount point. Optional, defaults to /mnt/pve/<STORAGE_ID>/. | The local mount point. Optional, defaults to /mnt/pve/<STORAGE_ID>/. | ||
content-dirs | |||
Overrides for the default directory layout. Optional. | |||
options | |||
Additional CIFS mount options (see man mount.cifs). Some options are set | |||
automatically and shouldn’t be set here. Proxmox VE will always set the option | |||
soft. Depending on the configuration, these options are set automatically: | |||
username, credentials, guest, domain, vers. | |||
subdir | |||
The subdirectory of the share to mount. Optional, defaults to the root directory | |||
of the share. | |||
Configuration Example (/etc/pve/storage.cfg) | Configuration Example (/etc/pve/storage.cfg) | ||
cifs: backup | cifs: backup | ||
Line 41: | Line 51: | ||
share VMData | share VMData | ||
content backup | content backup | ||
options noserverino,echo_interval=30 | |||
username anna | username anna | ||
smbversion 3 | smbversion 3 | ||
subdir /data | |||
Storage Features | Storage Features | ||
CIFS does not support snapshots on a storage level. But you may use | CIFS does not support snapshots on a storage level. But you may use | ||
Line 53: | Line 65: | ||
Snapshots | Snapshots | ||
Clones | Clones | ||
images rootdir vztmpl iso backup | images rootdir vztmpl iso backup snippets | ||
raw qcow2 vmdk | raw qcow2 vmdk | ||
yes | yes | ||
Line 60: | Line 72: | ||
Examples | Examples | ||
You can get a list of exported CIFS shares with: | You can get a list of exported CIFS shares with: | ||
# pvesm | # pvesm scan cifs <server> [--username <username>] [--password] | ||
Then you could add this share as a storage to the whole Proxmox VE cluster | Then you could add this share as a storage to the whole Proxmox VE cluster | ||
with: | with: |
Latest revision as of 14:11, 23 November 2023
Storage pool type: cifs
The CIFS backend extends the directory backend, so that no manual setup of a CIFS mount is needed. Such a storage can be added directly through the Proxmox VE API or the web UI, with all our backend advantages, like server heartbeat check or comfortable selection of exported shares.
Configuration
The backend supports all common storage properties, except the shared flag, which is always set. Additionally, the following CIFS special properties are available:
- server
-
Server IP or DNS name. Required.
To avoid DNS lookup delays, it is usually preferable to use an IP address instead of a DNS name - unless you have a very reliable DNS server, or list the server in the local /etc/hosts file. |
- share
-
CIFS share to use (get available ones with pvesm scan cifs <address> or the web UI). Required.
- username
-
The username for the CIFS storage. Optional, defaults to ‘guest’.
- password
-
The user password. Optional. It will be saved in a file only readable by root (/etc/pve/priv/storage/<STORAGE-ID>.pw).
- domain
-
Sets the user domain (workgroup) for this storage. Optional.
- smbversion
-
SMB protocol Version. Optional, default is 3. SMB1 is not supported due to security issues.
- path
-
The local mount point. Optional, defaults to /mnt/pve/<STORAGE_ID>/.
- content-dirs
-
Overrides for the default directory layout. Optional.
- options
-
Additional CIFS mount options (see man mount.cifs). Some options are set automatically and shouldn’t be set here. Proxmox VE will always set the option soft. Depending on the configuration, these options are set automatically: username, credentials, guest, domain, vers.
- subdir
-
The subdirectory of the share to mount. Optional, defaults to the root directory of the share.
cifs: backup path /mnt/pve/backup server 10.0.0.11 share VMData content backup options noserverino,echo_interval=30 username anna smbversion 3 subdir /data
Storage Features
CIFS does not support snapshots on a storage level. But you may use qcow2 backing files if you still want to have snapshots and cloning features available.
Content types | Image formats | Shared | Snapshots | Clones |
---|---|---|---|---|
images rootdir vztmpl iso backup snippets |
raw qcow2 vmdk |
yes |
qcow2 |
qcow2 |
Examples
You can get a list of exported CIFS shares with:
# pvesm scan cifs <server> [--username <username>] [--password]
Then you could add this share as a storage to the whole Proxmox VE cluster with:
# pvesm add cifs <storagename> --server <server> --share <share> [--username <username>] [--password]
See Also