Permalink
Browse files

Addresses EUCA-2550 support for @Upgrade

  • Loading branch information...
1 parent 2e9764e commit 54f387fe5ea8e895fd7d7af08e2bce856bdc2f66 @grze grze committed Oct 22, 2012
Showing with 4,013 additions and 795 deletions.
  1. +4 −0 clc/modules/bootstrap/src/main/native/arguments.ggo.in
  2. +12 −5 clc/modules/bootstrap/src/main/native/eucalyptus-bootstrap.c
  3. +32 −2 clc/modules/bootstrap/src/main/native/eucalyptus-bootstrap.h
  4. +227 −108 clc/modules/bootstrap/src/main/native/eucalyptus-opts.c
  5. +27 −8 clc/modules/bootstrap/src/main/native/eucalyptus-opts.h
  6. +4 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/BillOfMaterials.java
  7. +1 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Bootstrap.java
  8. +6 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/BootstrapArgs.java
  9. +20 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/DatabaseBootstrapper.java
  10. +161 −49 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Databases.java
  11. +3 −1 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Hosts.java
  12. +2 −2 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/SystemIds.java
  13. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/component/ComponentDiscovery.java
  14. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/component/ComponentIds.java
  15. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/config/ComponentConfiguration.java
  16. +28 −1 clc/modules/msgs/src/main/java/com/eucalyptus/configurable/StaticDatabasePropertyEntry.java
  17. +72 −61 clc/modules/msgs/src/main/java/com/eucalyptus/system/SubDirectory.java
  18. +531 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.0.list
  19. +35 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.0.warnings
  20. +531 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.1.list
  21. +35 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.1.warnings
  22. +531 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.2.list
  23. +35 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/3.1.2.warnings
  24. +906 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/Upgrades.java
  25. +105 −0 clc/modules/msgs/src/main/java/com/eucalyptus/upgrade/entity-profile.groovy
  26. +670 −534 clc/modules/postgresql/conf/scripts/setup_db.groovy
  27. +8 −0 devel/groovy-starter.conf
  28. +19 −0 devel/groovy.sh
  29. BIN devel/jansi-1.9.jar
  30. BIN devel/jline-1.0.jar
  31. 0 project/cluster
  32. 0 project/cluster
  33. 0 project/gatherlog
  34. 0 project/gatherlog
  35. 0 project/net
  36. 0 project/net
  37. 0 project/node
  38. 0 project/node
  39. 0 project/storage
  40. 0 project/storage
  41. 0 project/tools
  42. 0 project/tools
  43. 0 project/util
  44. 0 project/util
  45. 0 project/wsdl
  46. 0 project/wsdl
  47. +5 −21 tools/euca_upgrade
@@ -76,6 +76,10 @@ option "home" h "Eucalyptus home directory."
option "extra-version" - "Extra version string." string typestr="EXTRAVERSION" default="@EXTRA_VERSION@" no hidden
option "initialize" - "Perform first-time setup. This is run one time (only!) on the first cloud controller before the first time it is run." flag off
+option "upgrade" - "Perform database upgrade procedure and exit immediately after completion. Normally, upgrade is performed in-line with regular execution. This flag causes upgrade to be run and then for the process to terminate. Useful for debugging upgrade failures." flag off
+option "upgrade-old-version" - "Upgrade from specified version." string typestr="VERSION" no dependon="upgrade" hidden
+option "upgrade-old-dir" - "Upgrade from specified directory." string typestr="VERSION" no dependon="upgrade" hidden
+option "upgrade-force" - "Skip version check to force upgrade to run again." flag off dependon="upgrade" hidden
option "bind-addr" i "Specifying this option causes eucalyptus-cloud to only bind the specified local addresses. The default behaviour is to listen on the any address while determining the user facing local address based on default route and netmask size." string typestr="HOSTNAME" optional multiple
option "bootstrap-host" b "Host to be used for bootstrapping group membership. Many can be provided. Note this should only be necessary when UDP multicast is not available." string typestr="HOSTNAME" optional multiple
option "force-remote-bootstrap" - "Force the system to boot as a remote component." flag off hidden
@@ -688,9 +688,9 @@ char* java_library_path(euca_opts *args) {
__die((strlen(GETARG(args, home)) + strlen(EUCALYPTUS_JAVA_LIB_DIR) >= 256),
"Directory path too long: " EUCALYPTUS_JAVA_LIB_DIR, GETARG(args, home));
snprintf(lib_dir, 255, EUCALYPTUS_JAVA_LIB_DIR, GETARG(args, home));
- snprintf(etc_dir, 255, EUCA_ETC_DIR, GETARG(args, home));
- snprintf(class_cache_dir, 255, EUCA_CLASSCACHE_DIR, GETARG(args, home));
- snprintf(script_dir, 255, EUCA_SCRIPT_DIR, GETARG(args, home));
+ snprintf(etc_dir, 255, EUCALYPTUS_ETC_DIR, GETARG(args, home));
+ snprintf(class_cache_dir, 255, EUCALYPTUS_CLASSCACHE_DIR, GETARG(args, home));
+ snprintf(script_dir, 255, EUCALYPTUS_SCRIPT_DIR, GETARG(args, home));
if (!CHECK_ISDIR(lib_dir))
__die(1, "Can't find library directory %s", lib_dir);
int wb = 0;
@@ -812,6 +812,13 @@ int java_init(euca_opts *args, java_home_t *data) {
if (args->initialize_flag) {
JVM_ARG(opt[++x], "-Deuca.initialize=true");
JVM_ARG(opt[++x], "-Deuca.remote.dns=true");
+ } else if (args->upgrade_flag) {
+ JVM_ARG(opt[++x], "-Deuca.upgrade=true");
+ if(args->upgrade_force_flag){
+ JVM_ARG(opt[++x], "-Deuca.upgrade.force=true");
+ }
+ JVM_ARG(opt[++x], "-Deuca.upgrade.old.dir=%1$s",GETARG(args,upgrade_old_dir));
+ JVM_ARG(opt[++x], "-Deuca.upgrade.old.version=%1$s",GETARG(args,upgrade_old_version));
} else {
if (args->remote_dns_flag) {
JVM_ARG(opt[++x], "-Deuca.remote.dns=true");
@@ -832,9 +839,9 @@ int java_init(euca_opts *args, java_home_t *data) {
JVM_ARG(opt[++x], "-Deuca.db.home=%s", GETARG(args, db_home));
}
+ JVM_ARG(opt[++x], "-XX:+HeapDumpOnOutOfMemoryError");
+ JVM_ARG(opt[++x], "-XX:HeapDumpPath=%s/var/log/eucalyptus/", GETARG(args, home));
if (args->debug_flag) {
- JVM_ARG(opt[++x], "-XX:+HeapDumpOnOutOfMemoryError");
- JVM_ARG(opt[++x], "-XX:HeapDumpPath=%s/var/log/eucalyptus/", GETARG(args, home));
JVM_ARG(opt[++x], "-Xdebug");
JVM_ARG(
opt[++x],
@@ -73,7 +73,6 @@
#include <sys/stat.h>
#include <linux/capability.h>
#include "eucalyptus-opts.h"
-#include <eucalyptus.h>
#define PRINT_NULL(x) ((x) == NULL ? "null" : (x))
#define LIMIT_FILENO 65535
@@ -123,7 +122,38 @@ static int debug = 0;
#define __error(format,...) do { fprintf(stderr,"[error:%04d] ", __LINE__);fprintf(stderr, format "\n", ##__VA_ARGS__ );fflush(stderr); } while(0)
#define EUCA_MAIN "com/eucalyptus/bootstrap/SystemBootstrapper"
#define EUCA_RET_RELOAD 123
+
+#ifndef LIBDIR
+#define LIBDIR "/usr/lib"
+#endif
+#ifndef SYSCONFDIR
+#define SYSCONFDIR "/etc"
+#endif
+#ifndef DATADIR
+#define DATADIR "/usr/share"
+#endif
+#ifndef LIBEXECDIR
+#define LIBEXECDIR "/usr/lib"
+#endif
+#ifndef SBINDIR
+#define SBINDIR "/usr/sbin"
+#endif
+#ifndef LOCALSTATEDIR
+#define LOCALSTATEDIR "/var"
+#endif
+#define EUCALYPTUS_DATA_DIR "%s" DATADIR "/eucalyptus"
+#define EUCALYPTUS_CONF_DIR "%s" SYSCONFDIR "/eucalyptus"
+#define EUCALYPTUS_LIB_DIR "%s" LIBDIR "/eucalyptus"
+#define EUCALYPTUS_LIBEXEC_DIR "%s" LIBEXECDIR "/eucalyptus"
+#define EUCALYPTUS_RUN_DIR "%s" LOCALSTATEDIR "/run/eucalyptus"
+#define EUCALYPTUS_STATE_DIR "%s" LOCALSTATEDIR "/lib/eucalyptus"
+#define EUCALYPTUS_LOG_DIR "%s" LOCALSTATEDIR "/log/eucalyptus"
+#define EUCALYPTUS_ETC_DIR EUCALYPTUS_CONF_DIR "/cloud.d"
+#define EUCALYPTUS_SCRIPT_DIR EUCALYPTUS_ETC_DIR "/scripts"
+#define EUCALYPTUS_JAVA_LIB_DIR EUCALYPTUS_DATA_DIR
+#define EUCALYPTUS_CLASSCACHE_DIR EUCALYPTUS_RUN_DIR "/classcache"
#define java_load_bootstrapper euca_load_bootstrapper
+
void euca_load_bootstrapper(void);
typedef struct {
@@ -166,7 +196,7 @@ static char *jvm_default_opts[] = {
"-XX:MaxPermSize=256m",
"-XX:+UseConcMarkSweepGC",
"-Djava.net.preferIPv4Stack=true",
- "-Djava.security.policy=" EUCA_ETC_DIR "/security.policy",
+ "-Djava.security.policy=" EUCALYPTUS_ETC_DIR "/security.policy",
"-Djava.library.path=" EUCALYPTUS_LIB_DIR,
"-Djava.awt.headless=true",
"-Dsun.java.command=Eucalyptus",
Oops, something went wrong.

0 comments on commit 54f387f

Please sign in to comment.