]> git.proxmox.com Git - pve-docs.git/blame - pmxcfs.adoc
add status.cfg to the list of files in /etc/pve
[pve-docs.git] / pmxcfs.adoc
CommitLineData
bd88f9d9 1ifdef::manvolnum[]
b2f242ab
DM
2pmxcfs(8)
3=========
5f09af76
DM
4:pve-toplevel:
5
bd88f9d9
DM
6NAME
7----
8
9pmxcfs - Proxmox Cluster File System
10
49a5e11c 11SYNOPSIS
bd88f9d9
DM
12--------
13
54079101 14include::pmxcfs.8-synopsis.adoc[]
bd88f9d9
DM
15
16DESCRIPTION
17-----------
18endif::manvolnum[]
19
20ifndef::manvolnum[]
21Proxmox Cluster File System (pmxcfs)
ac1e3896 22====================================
5f09af76 23:pve-toplevel:
194d2f29 24endif::manvolnum[]
5f09af76 25
8c1189b6 26The Proxmox Cluster file system (``pmxcfs'') is a database-driven file
ac1e3896 27system for storing configuration files, replicated in real time to all
8c1189b6 28cluster nodes using `corosync`. We use this to store all PVE related
ac1e3896
DM
29configuration files.
30
31Although the file system stores all data inside a persistent database
32on disk, a copy of the data resides in RAM. That imposes restriction
5eba0743 33on the maximum size, which is currently 30MB. This is still enough to
ac1e3896
DM
34store the configuration of several thousand virtual machines.
35
960f6344 36This system provides the following advantages:
ac1e3896
DM
37
38* seamless replication of all configuration to all nodes in real time
39* provides strong consistency checks to avoid duplicate VM IDs
a8e99754 40* read-only when a node loses quorum
ac1e3896
DM
41* automatic updates of the corosync cluster configuration to all nodes
42* includes a distributed locking mechanism
43
5eba0743 44
ac1e3896 45POSIX Compatibility
960f6344 46-------------------
ac1e3896
DM
47
48The file system is based on FUSE, so the behavior is POSIX like. But
49some feature are simply not implemented, because we do not need them:
50
51* you can just generate normal files and directories, but no symbolic
52 links, ...
53
54* you can't rename non-empty directories (because this makes it easier
55 to guarantee that VMIDs are unique).
56
57* you can't change file permissions (permissions are based on path)
58
59* `O_EXCL` creates were not atomic (like old NFS)
60
61* `O_TRUNC` creates are not atomic (FUSE restriction)
62
63
5eba0743 64File Access Rights
960f6344 65------------------
ac1e3896 66
8c1189b6
FG
67All files and directories are owned by user `root` and have group
68`www-data`. Only root has write permissions, but group `www-data` can
ac1e3896
DM
69read most files. Files below the following paths:
70
71 /etc/pve/priv/
72 /etc/pve/nodes/${NAME}/priv/
73
74are only accessible by root.
75
960f6344 76
ac1e3896
DM
77Technology
78----------
79
80We use the http://www.corosync.org[Corosync Cluster Engine] for
81cluster communication, and http://www.sqlite.org[SQlite] for the
5eba0743 82database file. The file system is implemented in user space using
ac1e3896
DM
83http://fuse.sourceforge.net[FUSE].
84
5eba0743 85File System Layout
ac1e3896
DM
86------------------
87
88The file system is mounted at:
89
90 /etc/pve
91
92Files
93~~~~~
94
95[width="100%",cols="m,d"]
96|=======
8c1189b6
FG
97|`corosync.conf` | Corosync cluster configuration file (previous to {pve} 4.x this file was called cluster.conf)
98|`storage.cfg` | {pve} storage configuration
99|`datacenter.cfg` | {pve} datacenter wide configuration (keyboard layout, proxy, ...)
100|`user.cfg` | {pve} access control configuration (users/groups/...)
101|`domains.cfg` | {pve} authentication domains
7b7e71f1 102|`status.cfg` | {pve} external metrics server configuration
8c1189b6
FG
103|`authkey.pub` | Public key used by ticket system
104|`pve-root-ca.pem` | Public certificate of cluster CA
105|`priv/shadow.cfg` | Shadow password file
106|`priv/authkey.key` | Private key used by ticket system
107|`priv/pve-root-ca.key` | Private key of cluster CA
108|`nodes/<NAME>/pve-ssl.pem` | Public SSL certificate for web server (signed by cluster CA)
109|`nodes/<NAME>/pve-ssl.key` | Private SSL key for `pve-ssl.pem`
110|`nodes/<NAME>/pveproxy-ssl.pem` | Public SSL certificate (chain) for web server (optional override for `pve-ssl.pem`)
111|`nodes/<NAME>/pveproxy-ssl.key` | Private SSL key for `pveproxy-ssl.pem` (optional)
112|`nodes/<NAME>/qemu-server/<VMID>.conf` | VM configuration data for KVM VMs
113|`nodes/<NAME>/lxc/<VMID>.conf` | VM configuration data for LXC containers
114|`firewall/cluster.fw` | Firewall configuration applied to all nodes
115|`firewall/<NAME>.fw` | Firewall configuration for individual nodes
116|`firewall/<VMID>.fw` | Firewall configuration for VMs and Containers
ac1e3896
DM
117|=======
118
5eba0743 119
ac1e3896
DM
120Symbolic links
121~~~~~~~~~~~~~~
122
123[width="100%",cols="m,m"]
124|=======
8c1189b6
FG
125|`local` | `nodes/<LOCAL_HOST_NAME>`
126|`qemu-server` | `nodes/<LOCAL_HOST_NAME>/qemu-server/`
127|`lxc` | `nodes/<LOCAL_HOST_NAME>/lxc/`
ac1e3896
DM
128|=======
129
5eba0743 130
ac1e3896
DM
131Special status files for debugging (JSON)
132~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
134[width="100%",cols="m,d"]
135|=======
8c1189b6
FG
136|`.version` |File versions (to detect file modifications)
137|`.members` |Info about cluster members
138|`.vmlist` |List of all VMs
139|`.clusterlog` |Cluster log (last 50 entries)
140|`.rrd` |RRD data (most recent entries)
ac1e3896
DM
141|=======
142
5eba0743 143
ac1e3896
DM
144Enable/Disable debugging
145~~~~~~~~~~~~~~~~~~~~~~~~
146
147You can enable verbose syslog messages with:
148
100194d7 149 echo "1" >/etc/pve/.debug
ac1e3896
DM
150
151And disable verbose syslog messages with:
152
100194d7 153 echo "0" >/etc/pve/.debug
ac1e3896
DM
154
155
156Recovery
157--------
158
159If you have major problems with your Proxmox VE host, e.g. hardware
160issues, it could be helpful to just copy the pmxcfs database file
8c1189b6 161`/var/lib/pve-cluster/config.db` and move it to a new Proxmox VE
ac1e3896 162host. On the new host (with nothing running), you need to stop the
8c1189b6
FG
163`pve-cluster` service and replace the `config.db` file (needed permissions
164`0600`). Second, adapt `/etc/hostname` and `/etc/hosts` according to the
165lost Proxmox VE host, then reboot and check. (And don't forget your
ac1e3896
DM
166VM/CT data)
167
5eba0743 168
ac1e3896
DM
169Remove Cluster configuration
170~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171
172The recommended way is to reinstall the node after you removed it from
173your cluster. This makes sure that all secret cluster/ssh keys and any
174shared configuration data is destroyed.
175
38ae8db3
TL
176In some cases, you might prefer to put a node back to local mode without
177reinstall, which is described in
178<<pvecm_separate_node_without_reinstall,Separate A Node Without Reinstalling>>
bd88f9d9 179
5db724de
FG
180
181Recovering/Moving Guests from Failed Nodes
182~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183
184For the guest configuration files in `nodes/<NAME>/qemu-server/` (VMs) and
185`nodes/<NAME>/lxc/` (containers), {pve} sees the containing node `<NAME>` as
186owner of the respective guest. This concept enables the usage of local locks
187instead of expensive cluster-wide locks for preventing concurrent guest
188configuration changes.
189
190As a consequence, if the owning node of a guest fails (e.g., because of a power
191outage, fencing event, ..), a regular migration is not possible (even if all
192the disks are located on shared storage) because such a local lock on the
193(dead) owning node is unobtainable. This is not a problem for HA-managed
194guests, as {pve}'s High Availability stack includes the necessary
195(cluster-wide) locking and watchdog functionality to ensure correct and
196automatic recovery of guests from fenced nodes.
197
198If a non-HA-managed guest has only shared disks (and no other local resources
199which are only available on the failed node are configured), a manual recovery
200is possible by simply moving the guest configuration file from the failed
201node's directory in `/etc/pve/` to an alive node's directory (which changes the
202logical owner or location of the guest).
203
204For example, recovering the VM with ID `100` from a dead `node1` to another
205node `node2` works with the following command executed when logged in as root
206on any member node of the cluster:
207
208 mv /etc/pve/nodes/node1/qemu-server/100.conf /etc/pve/nodes/node2/
209
210WARNING: Before manually recovering a guest like this, make absolutely sure
211that the failed source node is really powered off/fenced. Otherwise {pve}'s
212locking principles are violated by the `mv` command, which can have unexpected
213consequences.
214
215WARNING: Guest with local disks (or other local resources which are only
216available on the dead node) are not recoverable like this. Either wait for the
217failed node to rejoin the cluster or restore such guests from backups.
218
bd88f9d9
DM
219ifdef::manvolnum[]
220include::pve-copyright.adoc[]
221endif::manvolnum[]