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