2018-04-06 10:31:35 +03:00
[[storage_cifs]]
2018-04-05 15:08:24 +03:00
CIFS Backend
-----------
ifdef::wiki[]
:pve-toplevel:
:title: Storage: CIFS
endif::wiki[]
Storage pool type: `cifs`
2018-04-06 10:31:35 +03:00
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
2023-11-22 10:49:28 +03:00
through the {pve} API or the web UI, with all our backend advantages,
2018-04-06 10:31:35 +03:00
like server heartbeat check or comfortable selection of exported
shares.
2018-04-05 15:08:24 +03:00
Configuration
~~~~~~~~~~~~~
The backend supports all common storage properties, except the shared
2018-04-06 10:31:35 +03:00
flag, which is always set. Additionally, the following CIFS special
properties are available:
2018-04-05 15:08:24 +03:00
server::
2018-04-06 10:31:35 +03:00
Server IP or DNS name. Required.
2018-04-05 15:08:24 +03:00
2018-04-06 10:31:35 +03:00
TIP: 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.
2018-04-05 15:08:24 +03:00
2018-04-06 10:31:35 +03:00
share::
2018-04-05 15:08:24 +03:00
2020-07-13 12:36:57 +03:00
CIFS share to use (get available ones with `pvesm scan cifs <address>` or the
2023-11-22 10:49:28 +03:00
web UI). Required.
2018-04-05 15:08:24 +03:00
username::
2018-04-06 10:31:35 +03:00
The username for the CIFS storage. Optional, defaults to `guest'.
2018-04-05 15:08:24 +03:00
password::
2018-04-06 10:31:35 +03:00
The user password. Optional.
It will be saved in a file only readable by root
2020-07-13 12:36:57 +03:00
(`/etc/pve/priv/storage/<STORAGE-ID>.pw`).
2018-04-05 15:08:24 +03:00
domain::
2018-04-06 10:31:35 +03:00
Sets the user domain (workgroup) for this storage. Optional.
2018-04-05 15:08:24 +03:00
smbversion::
2018-04-06 10:31:35 +03:00
SMB protocol Version. Optional, default is `3`.
2018-04-05 15:08:24 +03:00
SMB1 is not supported due to security issues.
path::
2018-04-06 10:31:35 +03:00
The local mount point. Optional, defaults to `/mnt/pve/<STORAGE_ID>/`.
2018-04-05 15:08:24 +03:00
2023-01-05 19:16:58 +03:00
content-dirs::
2023-01-02 19:04:38 +03:00
Overrides for the default directory layout. Optional.
2023-03-01 15:13:26 +03:00
options::
Additional CIFS mount options (see `man mount.cifs`). Some options are set
automatically and shouldn't be set here. {pve} will always set the option
`soft`. Depending on the configuration, these options are set automatically:
`username`, `credentials`, `guest`, `domain`, `vers`.
2023-02-08 12:05:27 +03:00
subdir::
2023-03-01 15:13:26 +03:00
The subdirectory of the share to mount. Optional, defaults to the root directory
of the share.
2023-02-08 12:05:27 +03:00
2018-04-05 15:08:24 +03:00
.Configuration Example (`/etc/pve/storage.cfg`)
----
cifs: backup
path /mnt/pve/backup
server 10.0.0.11
share VMData
content backup
2023-03-01 15:13:26 +03:00
options noserverino,echo_interval=30
2018-04-05 15:08:24 +03:00
username anna
smbversion 3
2023-02-08 12:05:27 +03:00
subdir /data
2018-04-05 15:08:24 +03:00
----
Storage Features
~~~~~~~~~~~~~~~~
2018-04-06 10:31:35 +03:00
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.
2018-04-05 15:08:24 +03:00
2018-04-06 10:31:35 +03:00
.Storage features for backend `cifs`
2018-04-05 15:08:24 +03:00
[width="100%",cols="m,m,3*d",options="header"]
|==============================================================================
2019-01-31 16:33:41 +03:00
|Content types |Image formats |Shared |Snapshots |Clones
|images rootdir vztmpl iso backup snippets |raw qcow2 vmdk |yes |qcow2 |qcow2
2018-04-05 15:08:24 +03:00
|==============================================================================
Examples
~~~~~~~~
You can get a list of exported CIFS shares with:
2018-04-06 10:31:35 +03:00
----
2020-07-13 12:36:57 +03:00
# pvesm scan cifs <server> [--username <username>] [--password]
2018-04-06 10:31:35 +03:00
----
Then you could add this share as a storage to the whole {pve} cluster
with:
----
# pvesm add cifs <storagename> --server <server> --share <share> [--username <username>] [--password]
----
2018-04-05 15:08:24 +03:00
ifdef::wiki[]
See Also
~~~~~~~~
* link:/wiki/Storage[Storage]
endif::wiki[]