Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial install-from support, missing cumulus import

  • Loading branch information...
commit 43149cba6b8ab024ee44331e57abab43567086e5 1 parent bd8be2c
@timf timf authored
View
12 README.mkd
@@ -17,6 +17,18 @@ Run this command to build, install, and configure Nimbus to a specified path:
./install /path/to/destination
+NOTE: This is an interactive program, you will be asked a few questions at
+ the end.
+
+Run this command to do the same thing but use a previously installed Nimbus
+service as the basis for the configuration of the new one.
+
+ ./install-from /path/to/old/install /path/to/destination
+
+NOTE: 1) This will only work if the old install is Nimbus 2.5 or higher.
+ 2) The old installation needs to be taken offline first and no VMs
+ should be running.
+
Advanced users may also want to build and deploy to an existing GT4.0
container. Refer to the readme and scripts in the `scripts/` directory
for more information.
View
324 home/libexec/nimbusconfigure.py
@@ -9,10 +9,11 @@
import ConfigParser
from StringIO import StringIO
import readline
+import shutil
import string
import time
from random import Random
-from nimbusweb.setup import pathutil,javautil,checkssl,gtcontainer,autoca,derbyutil
+from nimbusweb.setup import pathutil,javautil,checkssl,gtcontainer,autoca,derbyutil,runutil
from nimbusweb.setup.setuperrors import *
CONFIGSECTION = 'nimbussetup'
@@ -38,6 +39,13 @@
"""
CONFIG_STATE_PATH = 'nimbus-setup.conf'
+CONFIG_KEY_CA_DIR="ca.dir"
+CONFIG_KEY_HOSTCERT="hostcert"
+CONFIG_KEY_HOSTKEY="hostkey"
+CONFIG_KEY_KEYSTORE="keystore"
+CONFIG_KEY_GRIDMAP="gridmap"
+CONFIG_KEY_TRUSTED_CERTS="ca.trustedcerts.dir"
+
CA_NAME_QUESTION = """
Nimbus uses an internal Certificate Authority (CA) for some services. This CA
is also used to generate host and user certificates if you do not have your own.
@@ -185,6 +193,12 @@ class ARGS:
IMPORTDB_LONG= "--import-db"
IMPORTDB_HELP = "Import a Nimbus accounting database from another install"
+ IMPORTPREV_LONG= "--import-prev"
+ IMPORTPREV_HELP = "[Only used programmatically]"
+
+ IMPORTVMMS_LONG= "--import-vmms"
+ IMPORTVMMS_HELP = "Import VMMs from an old-style 'vmm-pools' directory"
+
PRINT_HOSTNAME_LONG = "--print-hostname"
PRINT_HOSTNAME = "-Z"
PRINT_HOSTNAME_HELP = "Print chosen hostname or error if none chosen"
@@ -230,6 +244,13 @@ def parsersetup():
group.add_option(ARGS.IMPORTDB_LONG,
dest="importdb", metavar="PATH", help=ARGS.IMPORTDB_HELP)
+
+ group.add_option(ARGS.IMPORTVMMS_LONG,
+ dest="importvmms", metavar="PATH", help=ARGS.IMPORTVMMS_HELP)
+
+ group.add_option(ARGS.IMPORTPREV_LONG,
+ action="store_true", dest="importprev", default=False,
+ help=ARGS.IMPORTPREV_HELP)
group.add_option(ARGS.PRINT_HOSTNAME, ARGS.PRINT_HOSTNAME_LONG,
action="store_true", dest="print_chosen_hostname",
@@ -280,9 +301,9 @@ def fold_opts_to_config(opts, config):
if opts.ca_name:
config.set(CONFIGSECTION, 'ca.name', opts.ca_name)
if opts.hostkey:
- config.set(CONFIGSECTION, 'hostkey', opts.hostkey)
+ config.set(CONFIGSECTION, CONFIG_KEY_HOSTKEY, opts.hostkey)
if opts.hostcert:
- config.set(CONFIGSECTION, 'hostcert', opts.hostcert)
+ config.set(CONFIGSECTION, CONFIG_KEY_HOSTCERT, opts.hostcert)
def get_user_input(valuename, default=None, required=True):
answer = None
@@ -309,12 +330,12 @@ def __init__(self, basedir, config, interactive=True):
self.webdir = self.resolve_path('web/')
self.gtdir = self.resolve_path('services/')
- self.cadir = self.resolve_config_path('ca.dir')
- self.trustedcertsdir = self.resolve_config_path('ca.trustedcerts.dir')
- self.hostcert_path = self.resolve_config_path('hostcert')
- self.hostkey_path = self.resolve_config_path('hostkey')
- self.keystore_path = self.resolve_config_path('keystore')
- self.gridmap_path = self.resolve_config_path('gridmap')
+ self.cadir = self.resolve_config_path(CONFIG_KEY_CA_DIR)
+ self.trustedcertsdir = self.resolve_config_path(CONFIG_KEY_TRUSTED_CERTS)
+ self.hostcert_path = self.resolve_config_path(CONFIG_KEY_HOSTCERT)
+ self.hostkey_path = self.resolve_config_path(CONFIG_KEY_HOSTKEY)
+ self.keystore_path = self.resolve_config_path(CONFIG_KEY_KEYSTORE)
+ self.gridmap_path = self.resolve_config_path(CONFIG_KEY_GRIDMAP)
self.envfile_path = self.resolve_path('libexec/environment.sh')
def __getitem__(self, key):
@@ -354,6 +375,22 @@ def resolve_config_path(self, config):
if path:
return self.resolve_path(path)
return None
+
+ def is_config_present(self, configkey):
+ path = self[configkey]
+ if path:
+ return True
+ else:
+ return False
+
+ def is_config_relative(self, configkey):
+ """
+ Resolves if a config is a relative path or not.
+ """
+ path = self[configkey]
+ if not path:
+ return False
+ return not os.path.isabs(path)
def ask_hostname(self):
hostguess = self['hostname']
@@ -373,7 +410,7 @@ def ask_ca_name(self):
ca_name_config = self['ca.name']
if self.interactive:
- print CA_NAME_QUESTION % {'ca.dir' : self.cadir}
+ print CA_NAME_QUESTION % {CONFIG_KEY_CA_DIR : self.cadir}
ca_name = get_user_input("CA Name", default=ca_name_config,
required=False)
if not ca_name:
@@ -544,7 +581,7 @@ def perform_setup(self):
relpath(self.hostcert_path, self.webdir))
webconf.set('nimbusweb', 'ssl.key',
relpath(self.hostkey_path, self.webdir))
- webconf.set('nimbusweb', 'ca.dir', relpath(self.cadir, self.webdir))
+ webconf.set('nimbusweb', CONFIG_KEY_CA_DIR, relpath(self.cadir, self.webdir))
webconffile = open(webconfpath, 'wb')
try:
@@ -582,6 +619,10 @@ def perform_setup(self):
self.write_cumulus_props()
self.write_cumulus_init()
+def generate_password(length=25):
+ okchars = string.letters + string.digits + "!@^_&*+-"
+ return ''.join(Random().sample(okchars, length))
+
def import_db(setup, old_db_path):
derbyrun_path = os.path.join(setup.gtdir, 'lib/derbyrun.jar')
if not os.path.exists(derbyrun_path):
@@ -600,10 +641,249 @@ def import_db(setup, old_db_path):
if derbyutil.update_db(ij_path, old_db_path, new_db_path) == 1:
raise UnexpectedError("Failed to update Accounting DB")
-def generate_password(length=25):
- okchars = string.letters + string.digits + "!@^_&*+-"
- return ''.join(Random().sample(okchars, length))
+def get_oldsetup(config):
+ old_nimbus_home = os.getenv("PREVIOUS_NIMBUS_HOME_VALIDATED")
+ if not old_nimbus_home:
+ raise IncompatibleEnvironment("Could not find the old Nimbus home environment variable: PREVIOUS_NIMBUS_HOME_VALIDATED")
+
+ # Represent the old config in an object:
+ oldsetup = NimbusSetup(old_nimbus_home, config)
+ return oldsetup
+
+def import_relatives(setup, config, oldversion):
+ """Look for conf paths from a previous config that are relative.
+ The old nimbus home (where the relative paths are taken from) must be
+ provided via environment variable currently.
+ """
+
+ oldsetup = get_oldsetup(config)
+
+ acknowledge = "\nAcknowledge (type any key) "
+
+ print "CA directory configuration: %s" % setup.cadir
+ if oldsetup.is_config_relative(CONFIG_KEY_CA_DIR):
+ print "Importing previous CA directory: %s ... " % oldsetup.cadir
+ if os.path.isdir(setup.cadir):
+ raise IncompatibleEnvironment("Directory exists already: %s" % setup.cadir)
+ shutil.copytree(oldsetup.cadir, setup.cadir, symlinks=True)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import CA directory, it was an absolute path configuration which is a customization: %s" % oldsetup.cadir
+
+ # re-running configure takes care of the X509_CERT_DIR in the
+ # $NIMBUS_HOME/libexec/environment.sh file.
+
+ value = raw_input(acknowledge)
+
+ print "\nTrusted certificate configuration: %s" % setup.trustedcertsdir
+ if oldsetup.is_config_relative(CONFIG_KEY_TRUSTED_CERTS):
+ print "Checking trusted certificates exists: %s" % setup.trustedcertsdir
+ if not os.path.isdir(setup.trustedcertsdir):
+ print "Does not exist as part of the CA directory, importing: %s ..." % oldsetup.trustedcertsdir
+ shutil.copytree(oldsetup.trustedcertsdir, setup.trustedcertsdir, symlinks=True)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import trusted certificate directory, it was an absolute path configuration which is a customization: %s" % oldsetup.trustedcertsdir
+ value = raw_input(acknowledge)
+
+ print "\nHost certificate configuration: %s" % setup.hostcert_path
+ if oldsetup.is_config_relative(CONFIG_KEY_HOSTCERT):
+ print "Importing previous host certificate: %s ... " % oldsetup.hostcert_path
+ if os.path.exists(setup.hostcert_path):
+ raise IncompatibleEnvironment("File exists already: %s" % setup.hostcert_path)
+ shutil.copy(oldsetup.hostcert_path, setup.hostcert_path)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import host certificate, it was an absolute path configuration which is a customization: %s" % oldsetup.hostcert_path
+ value = raw_input(acknowledge)
+
+ print "\nHost key configuration: %s" % setup.hostkey_path
+ if oldsetup.is_config_relative(CONFIG_KEY_HOSTKEY):
+ print "Importing previous host key: %s ... " % oldsetup.hostkey_path
+ if os.path.exists(setup.hostkey_path):
+ raise IncompatibleEnvironment("File exists already: %s" % setup.hostkey_path)
+ shutil.copy(oldsetup.hostkey_path, setup.hostkey_path)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import host key, it was an absolute path configuration which is a customization: %s" % oldsetup.hostkey_path
+ value = raw_input(acknowledge)
+
+ print "\nKeystore configuration: %s" % setup.keystore_path
+ if oldsetup.is_config_relative(CONFIG_KEY_KEYSTORE):
+ print "Importing previous keystore: %s ... " % oldsetup.keystore_path
+ if os.path.exists(setup.keystore_path):
+ raise IncompatibleEnvironment("File exists already: %s" % setup.keystore_path)
+ shutil.copy(oldsetup.keystore_path, setup.keystore_path)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import keystore, it was an absolute path configuration which is a customization: %s" % oldsetup.keystore_path
+ value = raw_input(acknowledge)
+
+ print "\nGridmap configuration: %s" % setup.gridmap_path
+ if oldsetup.is_config_relative(CONFIG_KEY_GRIDMAP):
+ print "Importing previous ACL (gridmap): %s ... " % oldsetup.gridmap_path
+ shutil.copy(oldsetup.gridmap_path, setup.gridmap_path)
+ print " - Done."
+ else:
+ print >>sys.stderr, "* Did not import ACL (gridmap), it was an absolute path configuration which is a customization: %s" % oldsetup.gridmap_path
+ value = raw_input(acknowledge)
+
+def import_authz(setup, config, oldversion):
+ oldsetup = get_oldsetup(config)
+
+ ws_dir = "services/etc/nimbus/workspace-service"
+ group_authz_dir = setup.resolve_path("%s/group-authz" % ws_dir)
+ group_authz_backup_dir = setup.resolve_path("%s/.prev-group-authz" % ws_dir)
+ if not os.path.isdir(group_authz_dir):
+ raise IncompatibleEnvironment("Not a directory: %s" % group_authz_dir)
+
+ old_group_authz = oldsetup.resolve_path("%s/group-authz" % ws_dir)
+ if not os.path.isdir(old_group_authz):
+ raise IncompatibleEnvironment("Not a directory: %s" % old_group_authz)
+
+ # back this up, just in case this script is used in an odd way
+ print "\nBacking up group-authz to: %s ... " % group_authz_backup_dir
+ shutil.move(group_authz_dir, group_authz_backup_dir)
+ print " - Done."
+
+ print "\nImporting previous group-authz ..."
+ shutil.copytree(old_group_authz, group_authz_dir)
+ print " - Done."
+
+def import_net(setup, config, oldversion):
+ oldsetup = get_oldsetup(config)
+
+ ws_dir = "services/etc/nimbus/workspace-service"
+ netpool_dir = setup.resolve_path("%s/network-pools" % ws_dir)
+ netpool_backup_dir = setup.resolve_path("%s/.prev-network-pools" % ws_dir)
+ if not os.path.isdir(netpool_dir):
+ raise IncompatibleEnvironment("Not a directory: %s" % netpool_dir)
+
+ old_netpool_dir = oldsetup.resolve_path("%s/network-pools" % ws_dir)
+ if not os.path.isdir(old_netpool_dir):
+ raise IncompatibleEnvironment("Not a directory: %s" % old_netpool_dir)
+
+ # back this up, just in case this script is used in an odd way
+ print "\nBacking up old_netpool_dir to: %s ... " % netpool_backup_dir
+ shutil.move(netpool_dir, netpool_backup_dir)
+ print " - Done."
+
+ print "\nImporting previous network-pools to: %s ..." % netpool_dir
+ shutil.copytree(old_netpool_dir, netpool_dir)
+ print " - Done."
+
+def import_accounting(setup, config, oldversion):
+ oldsetup = get_oldsetup(config)
+ events_txt_relpath = "services/var/nimbus/accounting-events.txt"
+ old_events_txt = oldsetup.resolve_path(events_txt_relpath)
+ events_txt = setup.resolve_path(events_txt_relpath)
+
+ print "\nImporting accounting events log: %s ... " % events_txt
+ if not os.path.exists(old_events_txt):
+ raise IncompatibleEnvironment("File does not exist: %s" % old_events_txt)
+ shutil.copy(old_events_txt, events_txt)
+ print " - Done."
+
+ events_db_relpath = "services/var/nimbus/WorkspaceAccountingDB/"
+ old_db_path = oldsetup.resolve_path(events_db_relpath)
+ if not os.path.isdir(old_db_path):
+ raise IncompatibleEnvironment("Not a directory: %s" % old_db_path)
+
+ print "\nImporting accounting database ... "
+ import_db(setup, old_db_path)
+ print " - Done."
+
+def import_webapp(setup, config, oldversion):
+ oldsetup = get_oldsetup(config)
+ webconf_relpath = "web/nimbusweb.conf"
+ old_webconf = oldsetup.resolve_path(webconf_relpath)
+ webconf = setup.resolve_path(webconf_relpath)
+
+ print "\nImporting webapp configuration to: %s ... " % webconf
+ if not os.path.exists(old_webconf):
+ raise IncompatibleEnvironment("File does not exist: %s" % old_webconf)
+ shutil.copy(old_webconf, webconf)
+ print " - Done."
+
+def _get_none_comment_lines(fullpath):
+ """Return a list of lines from this file that are not comments and not
+ empty lines"""
+ f = open(fullpath, 'r')
+ all_lines = f.readlines()
+ f.close()
+
+ lines = []
+ for line in all_lines:
+ stripped = line.strip()
+ if len(stripped) == 0:
+ continue
+ if stripped.startswith("#"):
+ continue
+ lines.append(stripped)
+ return lines
+
+def _one_vmm_file(directory, pool, nodestool):
+ print " - Importing VMM pool '%s'" % pool
+ fullpath = os.path.join(directory, pool)
+ lines = _get_none_comment_lines(fullpath)
+
+ for line in lines:
+ parts = line.split(" ")
+ if len(parts) < 2:
+ print " **** Invalid Pool Entry: '%s'" % line
+ continue
+ vmm = parts[0]
+ ram = parts[1]
+ net = None
+ if len(parts) > 2:
+ net = parts[2]
+ cmd = "%s --add-nodes %s --memory %s" % (nodestool, vmm, ram)
+ if net:
+ cmd += " --networks '%s'" % net
+ cmd += " --pool %s" % pool
+ (exitcode, stdout, stderr) = runutil.runexe(cmd, log, killtime=0)
+ if exitcode:
+ err = " **** Problem importing VMM '%s', command was '%s'\n\n" % (vmm, cmd)
+ err += " %s\n\n" % stdout
+ err += " %s\n" % stderr
+ raise UnexpectedError(err)
+
+def import_vmms(setup, old_vmmdir):
+
+ nodestool = setup.resolve_path("bin/nimbus-admin")
+
+ print "\nImporting VMM configuration ... "
+ if not os.path.isdir(old_vmmdir):
+ raise IncompatibleEnvironment("Directory does not exist: %s" % old_vmmdir)
+ files = os.listdir(old_vmmdir)
+ for pool in files:
+ fullpath = os.path.join(old_vmmdir, pool)
+ if pool.startswith("."):
+ print " - Ignoring '%s'" % fullpath
+ elif os.path.isdir(fullpath):
+ print " - Ignoring directory '%s'" % fullpath
+ else:
+ _one_vmm_file(old_vmmdir, pool, nodestool)
+ print " - Done."
+
+def getoldversion(config):
+ oldsetup = get_oldsetup(config)
+ version_tool = oldsetup.resolve_path("bin/nimbus-version")
+
+ if not os.path.exists(version_tool):
+ raise IncompatibleEnvironment("nimbus-version does not exist in the old installation, it must be too old to import: %s" % version_tool)
+
+ cmd = "%s --majorminor" % (version_tool)
+ (exitcode, stdout, stderr) = runutil.runexe(cmd, log, killtime=0)
+ if exitcode:
+ err = " **** Problem getting version, command was '%s'\n\n" % cmd
+ err += " %s\n\n" % stdout
+ err += " %s\n" % stderr
+ raise UnexpectedError(err)
+
+ return stdout.strip()
+
def main(argv=None):
if os.name != 'posix':
print >>sys.stderr, "\nERROR: Only runs on POSIX systems."
@@ -654,6 +934,20 @@ def main(argv=None):
elif opts.importdb:
import_db(setup, opts.importdb)
return 0
+ elif opts.importprev:
+ oldversion = getoldversion(config)
+ print "Old Nimbus version: %s\n" % oldversion
+ import_relatives(setup, config, oldversion)
+ import_authz(setup, config, oldversion)
+ import_net(setup, config, oldversion)
+ import_accounting(setup, config, oldversion)
+ import_webapp(setup, config, oldversion)
+ print ""
+ return 0
+ elif opts.importvmms:
+ import_vmms(setup, opts.importvmms)
+ print ""
+ return 0
elif opts.print_repo_bucket:
bucket = setup.get_repobucket_no_asking()
if not bucket:
@@ -670,7 +964,7 @@ def main(argv=None):
return 0
else:
setup.perform_setup()
-
+
log.debug("saving settings to %s" % config_state_path)
try:
f = None
View
102 install
@@ -116,6 +116,15 @@ if [ ! -f $CUMULUS_ENV ]; then
fi
echo ""
+export NIMBUS_HOME
+$NIMBUS_SRC/lantorrent/install.sh $NIMBUS_HOME/lantorrent | tee -a $NIMBUS_HOME/install.log
+rc=$PIPESTATUS
+if [ $rc -ne 0 ]; then
+ echo "lantorrent install failed"
+ exit $rc
+fi
+
+echo ""
echo "-----------------------------------------------------------------"
echo " Configuring installed services"
echo "-----------------------------------------------------------------"
@@ -127,8 +136,44 @@ if [ ! -f $CONFIG_SCRIPT ]; then
exit 1
fi
-$CONFIG_SCRIPT
+vmm_cmd="Programmer. Error."
+EXTRA_CONFIG_SCRIPT_ARGS=""
+if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
+ echo ""
+ echo "Beginning the configuration with values from the old Nimbus installation: $PREVIOUS_NIMBUS_HOME_VALIDATED"
+ echo ""
+
+ oldnimbusconf=$PREVIOUS_NIMBUS_HOME_VALIDATED/nimbus-setup.conf
+ if [ ! -f $oldnimbusconf ]; then
+ echo "The old Nimbus installation does not have a configuration file, expecting to find: $oldnimbusconf"
+ exit 1
+ fi
+
+ cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf
+ if [ $? -ne 0 ]; then
+ echo "Could not copy the old configuration file: cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf"
+ exit 1
+ fi
+
+ EXTRA_CONFIG_SCRIPT_ARGS="--conf $NIMBUS_HOME/nimbus-setup.conf"
+
+ # We know that a fresh installation will have missing things specified in
+ # that conf file. Any relative path configuratoin in that previous conf
+ # file will be copied over here. Any absolute path will be noted but not
+ # touched.
+
+ $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-prev
+ if [ $? -ne 0 ]; then
+ echo ""
+ echo "Could not import something specified in the old configuration file: $oldnimbusconf"
+ exit 1
+ fi
+
+ old_vmmdir = "$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus/workspace-service/vmm-pools"
+ vmm_cmd="$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-vmms $old_vmmdir"
+fi
+$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS
if [ $? -ne 0 ]; then
echo "Nimbus configuration script failed! You may try running it manually:"
echo " $CONFIG_SCRIPT"
@@ -137,19 +182,58 @@ if [ $? -ne 0 ]; then
exit 1
fi
-
-$NIMBUS_SRC/libexec/install-real.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
+$NIMBUS_SRC/libexec/configure-cumulus.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
# need PIPESTATUS because tee is not the exit code of interest
rc=$PIPESTATUS
if [ $rc -ne 0 ]; then
exit $rc
fi
-export NIMBUS_HOME
-$NIMBUS_SRC/lantorrent/install.sh $NIMBUS_HOME/lantorrent | tee -a $NIMBUS_HOME/install.log
-rc=$PIPESTATUS
-if [ $rc -ne 0 ]; then
- echo "lantorrent install failed"
- exit $rc
+if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
+ echo "TODO: import cumulus settings"
+fi
+
+echo ""
+GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
+if [ $? -ne 0 ]; then
+ GUIDEURL="Development mode: no guide url"
+fi
+
+echo ""
+echo "-----------------------------------------------------------------"
+echo " Nimbus installation succeeded!"
+echo "-----------------------------------------------------------------"
+echo ""
+echo "Additional configuration may be necessary, refer to this URL for information:"
+echo ""
+echo " $GUIDEURL"
+echo ""
+echo "You can start/stop Nimbus services with the nimbusctl command. e.g:"
+echo ""
+echo " $NIMBUS_HOME/bin/nimbusctl start"
+echo ""
+
+if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
+ old_etc_dir=$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus
+ new_etc_dir=$NIMBUS_HOME/services/etc/nimbus
+ echo "-----------------------------------------------------------------"
+ echo " ** Upgrade configuration still needed **"
+ echo "-----------------------------------------------------------------"
+ echo ""
+ echo "While key settings have been transferred from your old install,"
+ echo "you still need to do a manual confirmation and transfer of"
+ echo "customizations."
+ echo ""
+ echo "Run the following command to look for customizations:"
+ echo ""
+ echo " diff -u -r $old_etc_dir $new_etc_dir"
+ echo ""
+ echo "After using nimbusctl to start the services, use the following"
+ echo "command to import VMM configurations. This can only be done "
+ echo "with a running service:"
+ echo ""
+ echo " $vmm_cmd"
+ echo ""
fi
+
exit 0
View
79 install-from
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+FORCE_FRESH_INSTALL="yes"
+
+START_DIR=`pwd`
+
+NIMBUS_SRC_REL="`dirname $0`"
+NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
+
+function usagetxt {
+ echo ""
+ echo "Usage: $0 old_dir destination_dir"
+ echo ""
+}
+
+# ---------------------------------------------------------------------------
+
+if [ "X$1" = "X" ]; then
+ usagetxt
+ echo "You must specify the previous Nimbus 2.5+ directory."
+ exit 1
+fi
+
+if [ "X$2" = "X" ]; then
+ usagetxt
+ echo "You must specify the destination directory."
+ exit 1
+fi
+
+OLDNIMBUS_BASE_HOME=`cd $1; pwd`
+if [ ! -e $OLDNIMBUS_BASE_HOME ]; then
+ echo "The old Nimbus installation must exist already: $1"
+ exit 1
+fi
+
+# ---------------------------------------------------------------------------
+
+# Validate that the old Nimbus directory is usable before proceeding
+
+NV=$OLDNIMBUS_BASE_HOME/bin/nimbus-version
+if [ ! -f $NV ]; then
+ echo "The old Nimbus installation does not have a nimbus-version program,"
+ echo "looking for '$NV'"
+ echo ""
+ echo "This means it is broken or pre-2.5 and hence too old to work with $0"
+ exit 1
+fi
+
+# This is a proof of concept for later on, we know that this is 2.5+ already.
+fullversion=`$NV --fullversion`
+
+major=`$NV --major`
+if [ $major -lt 2 ]; then
+ echo "Nimbus $fullversion can not be upgraded anymore, please see the docs"
+ echo "or inquire why on the mailing list."
+ exit 1
+fi
+
+minor=`$NV --minor`
+if [ $minor -eq 2 ] && [ $minor -lt 5 ]; then
+ echo "Nimbus $fullversion can not be upgraded anymore, please see the docs"
+ echo "or inquire why on the mailing list."
+ exit 1
+fi
+
+
+# ---------------------------------------------------------------------------
+
+# Launch the installation which proceeds as normal until the end when we pick
+# back up with configuration tasks.
+
+export PREVIOUS_NIMBUS_HOME_VALIDATED=$OLDNIMBUS_BASE_HOME
+
+if [ ! -f $NIMBUS_SRC/install ]; then
+ echo "Cannot find the installation program? $NIMBUS_SRC/install"
+ exit 1
+fi
+
+exec $NIMBUS_SRC/install $2
View
20 libexec/install-real.sh → libexec/configure-cumulus.sh
@@ -60,24 +60,4 @@ if [ $? -ne 0 ]; then
fi
echo "Created repo admin."
-echo ""
-GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
-if [ $? -ne 0 ]; then
- GUIDEURL="Development mode: no guide url"
-fi
-
-echo ""
-echo "-----------------------------------------------------------------"
-echo " Nimbus installation succeeded!"
-echo "-----------------------------------------------------------------"
-echo ""
-echo "Additional configuration may be necessary, refer to this URL for information:"
-echo ""
-echo " $GUIDEURL"
-echo ""
-echo "You can start/stop Nimbus services with the nimbusctl command. e.g:"
-echo ""
-echo " $NIMBUS_HOME/bin/nimbusctl start"
-echo ""
-
exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.