1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 """Module containing constants and functions for filesystem paths.
32
33 """
34
35 from ganeti import _constants
36 from ganeti import compat
37 from ganeti import vcluster
38
39
40
41 DEFAULT_FILE_STORAGE_DIR = "/srv/ganeti/file-storage"
42 DEFAULT_FILE_STORAGE_DIR = vcluster.AddNodePrefix(DEFAULT_FILE_STORAGE_DIR)
43 DEFAULT_SHARED_FILE_STORAGE_DIR = "/srv/ganeti/shared-file-storage"
44 DEFAULT_SHARED_FILE_STORAGE_DIR = \
45 vcluster.AddNodePrefix(DEFAULT_SHARED_FILE_STORAGE_DIR)
46 DEFAULT_GLUSTER_STORAGE_DIR = "/var/run/ganeti/gluster"
47 DEFAULT_GLUSTER_STORAGE_DIR = \
48 vcluster.AddNodePrefix(DEFAULT_GLUSTER_STORAGE_DIR)
49 EXPORT_DIR = vcluster.AddNodePrefix(_constants.EXPORT_DIR)
50 BACKUP_DIR = vcluster.AddNodePrefix(_constants.BACKUP_DIR)
51 OS_SEARCH_PATH = _constants.OS_SEARCH_PATH
52 ES_SEARCH_PATH = _constants.ES_SEARCH_PATH
53 SSH_CONFIG_DIR = _constants.SSH_CONFIG_DIR
54 XEN_CONFIG_DIR = vcluster.AddNodePrefix(_constants.XEN_CONFIG_DIR)
55 SYSCONFDIR = vcluster.AddNodePrefix(_constants.SYSCONFDIR)
56 TOOLSDIR = _constants.TOOLSDIR
57 PKGLIBDIR = _constants.PKGLIBDIR
58 SHAREDIR = _constants.SHAREDIR
59 LOCALSTATEDIR = vcluster.AddNodePrefix(_constants.LOCALSTATEDIR)
60
61
62 DAEMON_UTIL = _constants.PKGLIBDIR + "/daemon-util"
63 IMPORT_EXPORT_DAEMON = _constants.PKGLIBDIR + "/import-export"
64 KVM_CONSOLE_WRAPPER = _constants.PKGLIBDIR + "/tools/kvm-console-wrapper"
65 KVM_IFUP = _constants.PKGLIBDIR + "/kvm-ifup"
66 PREPARE_NODE_JOIN = _constants.PKGLIBDIR + "/prepare-node-join"
67 SSH_UPDATE = _constants.PKGLIBDIR + "/ssh-update"
68 NODE_DAEMON_SETUP = _constants.PKGLIBDIR + "/node-daemon-setup"
69 SSL_UPDATE = _constants.PKGLIBDIR + "/ssl-update"
70 XEN_CONSOLE_WRAPPER = _constants.PKGLIBDIR + "/tools/xen-console-wrapper"
71 CFGUPGRADE = _constants.PKGLIBDIR + "/tools/cfgupgrade"
72 POST_UPGRADE = _constants.PKGLIBDIR + "/tools/post-upgrade"
73 ENSURE_DIRS = _constants.PKGLIBDIR + "/ensure-dirs"
74
75 XEN_VIF_METAD_SETUP = _constants.PKGLIBDIR + "/vif-ganeti-metad"
76 ETC_HOSTS = vcluster.ETC_HOSTS
77
78
79 DATA_DIR = LOCALSTATEDIR + "/lib/ganeti"
80 LOCK_DIR = LOCALSTATEDIR + "/lock"
81 LOG_DIR = LOCALSTATEDIR + "/log/ganeti"
82 RUN_DIR = LOCALSTATEDIR + "/run/ganeti"
83
84
85 DEFAULT_MASTER_SETUP_SCRIPT = TOOLSDIR + "/master-ip-setup"
86
87 SSH_HOST_DSA_PRIV = _constants.SSH_HOST_DSA_PRIV
88 SSH_HOST_DSA_PUB = _constants.SSH_HOST_DSA_PUB
89 SSH_HOST_RSA_PRIV = _constants.SSH_HOST_RSA_PRIV
90 SSH_HOST_RSA_PUB = _constants.SSH_HOST_RSA_PUB
91 SSH_PUB_KEYS = DATA_DIR + "/ganeti_pub_keys"
92
93 BDEV_CACHE_DIR = RUN_DIR + "/bdev-cache"
94 DISK_LINKS_DIR = RUN_DIR + "/instance-disks"
95 SOCKET_DIR = RUN_DIR + "/socket"
96 CRYPTO_KEYS_DIR = RUN_DIR + "/crypto"
97 IMPORT_EXPORT_DIR = RUN_DIR + "/import-export"
98 INSTANCE_STATUS_FILE = RUN_DIR + "/instance-status"
99 INSTANCE_REASON_DIR = RUN_DIR + "/instance-reason"
100
101
102 UIDPOOL_LOCKDIR = RUN_DIR + "/uid-pool"
103 LIVELOCK_DIR = RUN_DIR + "/livelocks"
104 LUXID_MESSAGE_DIR = RUN_DIR + "/luxidmessages"
105
106 SSCONF_LOCK_FILE = LOCK_DIR + "/ganeti-ssconf.lock"
107
108 CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
109 RAPI_CERT_FILE = DATA_DIR + "/rapi.pem"
110 CONFD_HMAC_KEY = DATA_DIR + "/hmac.key"
111 SPICE_CERT_FILE = DATA_DIR + "/spice.pem"
112 SPICE_CACERT_FILE = DATA_DIR + "/spice-ca.pem"
113 CLUSTER_DOMAIN_SECRET_FILE = DATA_DIR + "/cluster-domain-secret"
114 SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
115 RAPI_DATA_DIR = DATA_DIR + "/rapi"
116 RAPI_USERS_FILE = RAPI_DATA_DIR + "/users"
117 QUEUE_DIR = DATA_DIR + "/queue"
118 INTENT_TO_UPGRADE = DATA_DIR + "/intent-to-upgrade"
119 CONF_DIR = SYSCONFDIR + "/ganeti"
120 XEN_IFUP_OS = CONF_DIR + "/xen-ifup-os"
121 USER_SCRIPTS_DIR = CONF_DIR + "/scripts"
122 VNC_PASSWORD_FILE = CONF_DIR + "/vnc-cluster-password"
123 HOOKS_BASE_DIR = CONF_DIR + "/hooks"
124 FILE_STORAGE_PATHS_FILE = CONF_DIR + "/file-storage-paths"
125 RESTRICTED_COMMANDS_DIR = CONF_DIR + "/restricted-commands"
126
127
128 NODED_CERT_FILE = DATA_DIR + "/server.pem"
129 NODED_CLIENT_CERT_FILE = DATA_DIR + "/client.pem"
130
131
132 NODED_CERT_MODE = 0440
133
134
135 RESTRICTED_COMMANDS_LOCK_FILE = LOCK_DIR + "/ganeti-restricted-commands.lock"
136
137
138
139 WATCHER_LOCK_FILE = LOCK_DIR + "/ganeti-watcher.lock"
140
141
142 WATCHER_GROUP_STATE_FILE = DATA_DIR + "/watcher.%s.data"
143
144
145
146 WATCHER_GROUP_INSTANCE_STATUS_FILE = DATA_DIR + "/watcher.%s.instance-status"
147
148
149 WATCHER_PAUSEFILE = DATA_DIR + "/watcher.pause"
150
151
152 EXTERNAL_MASTER_SETUP_SCRIPT = USER_SCRIPTS_DIR + "/master-ip-setup"
153
154
155 MASTER_SOCKET = SOCKET_DIR + "/ganeti-master"
156
157 QUERY_SOCKET = SOCKET_DIR + "/ganeti-query"
158
159 WCONFD_SOCKET = SOCKET_DIR + "/ganeti-wconfd"
160
161 METAD_SOCKET = SOCKET_DIR + "/ganeti-metad"
162
163 LOG_OS_DIR = LOG_DIR + "/os"
164 LOG_ES_DIR = LOG_DIR + "/extstorage"
165
166 LOG_XEN_DIR = LOG_DIR + "/xen"
167
168
169 JOB_QUEUE_LOCK_FILE = QUEUE_DIR + "/lock"
170 JOB_QUEUE_VERSION_FILE = QUEUE_DIR + "/version"
171 JOB_QUEUE_SERIAL_FILE = QUEUE_DIR + "/serial"
172 JOB_QUEUE_ARCHIVE_DIR = QUEUE_DIR + "/archive"
173 JOB_QUEUE_DRAIN_FILE = QUEUE_DIR + "/drain"
174
175 ALL_CERT_FILES = compat.UniqueFrozenset([
176 NODED_CERT_FILE,
177 RAPI_CERT_FILE,
178 SPICE_CERT_FILE,
179 SPICE_CACERT_FILE,
180 ])
181
182
184 """Returns the full path for a daemon's log file.
185
186 """
187 return "%s/%s.log" % (LOG_DIR, daemon_name)
188
189
190 LOG_WATCHER = GetLogFilename("watcher")
191 LOG_COMMANDS = GetLogFilename("commands")
192 LOG_BURNIN = GetLogFilename("burnin")
193