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