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