Commit 5be83717 authored by Klaus Aehlig's avatar Klaus Aehlig

Make gnt-cluster upgrade honor backup-dir

Make gnt-cluster upgrade honor the --with-backup-dir configure option.
In this way, at configure time, it can be decided in which directory
the configuration backup tar balls are put.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent e544d217
......@@ -1790,6 +1790,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
-DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \
-DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \
-DEXPORT_DIR="$(EXPORT_DIR)" \
-DBACKUP_DIR="$(backup_dir)" \
-DOS_SEARCH_PATH="\"$(OS_SEARCH_PATH)\"" \
-DES_SEARCH_PATH="\"$(ES_SEARCH_PATH)\"" \
-DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \
......
......@@ -1855,9 +1855,10 @@ def _UpgradeBeforeConfigurationChange(versionstring):
ToStderr("Failed to stop daemons on %s." % (", ".join(badnodes),))
return (False, rollback)
backuptar = os.path.join(pathutils.LOCALSTATEDIR,
"lib/ganeti%d.tar" % time.time())
backuptar = os.path.join(pathutils.BACKUP_DIR, "ganeti%d.tar" % time.time())
ToStdout("Backing up configuration as %s" % backuptar)
if not _RunCommandAndReport(["mkdir", "-p", pathutils.BACKUP_DIR]):
return (False, rollback)
if not _RunCommandAndReport(["tar", "cf", backuptar,
pathutils.DATA_DIR]):
return (False, rollback)
......
......@@ -35,6 +35,7 @@ DEFAULT_SHARED_FILE_STORAGE_DIR = "/srv/ganeti/shared-file-storage"
DEFAULT_SHARED_FILE_STORAGE_DIR = \
vcluster.AddNodePrefix(DEFAULT_SHARED_FILE_STORAGE_DIR)
EXPORT_DIR = vcluster.AddNodePrefix(_constants.EXPORT_DIR)
BACKUP_DIR = vcluster.AddNodePrefix(_constants.BACKUP_DIR)
OS_SEARCH_PATH = _constants.OS_SEARCH_PATH
ES_SEARCH_PATH = _constants.ES_SEARCH_PATH
SSH_CONFIG_DIR = _constants.SSH_CONFIG_DIR
......
......@@ -73,6 +73,9 @@ sshConsoleUser = "SSH_CONSOLE_USER"
exportDir :: String
exportDir = "EXPORT_DIR"
backupDir :: String
backupDir = "BACKUP_DIR"
osSearchPath :: [String]
osSearchPath = split OS_SEARCH_PATH
......
......@@ -88,6 +88,9 @@ hasGnuLn = AutoConf.hasGnuLn
exportDir :: String
exportDir = AutoConf.exportDir
backupDir :: String
backupDir = AutoConf.backupDir
osSearchPath :: [String]
osSearchPath = AutoConf.osSearchPath
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment