Permalink
Browse files

Adjusted autoconfig to use nimbus-nodes

  • Loading branch information...
1 parent 280945c commit a985682e6cd23d28b133326e9f80204309cd3ed6 @labisso labisso committed Nov 3, 2010
@@ -30,6 +30,13 @@ THISDIR=`cd $THISDIR_REL; pwd`
GLOBUS_LOCATION=`cd $THISDIR/../../; pwd`
export GLOBUS_LOCATION
+NIMBUS_HOME=`cd $GLOBUS_LOCATION/../; pwd`
+export NIMBUS_HOME
+
+NIMBUS_BIN="$NIMBUS_HOME/bin"
+NIMBUS_NODES="$NIMBUS_BIN/nimbus-nodes"
+NIMBUSCTL="$NIMBUS_BIN/nimbusctl"
+
LIBDIR="$THISDIR/lib/"
if [ ! -f $LIBDIR/common-env.sh ]; then
echo "Failure, cannot find environment definitions"
@@ -290,96 +297,59 @@ fi
# }}}
# -----------------------------------------------------------------------------
-# {{{ backup pool
+# {{{ turn off fake mode; other/common.conf --> fake.mode (set to false)
# -----------------------------------------------------------------------------
-if [ "$DO_POOL" = "y" ]; then
-
- VMMPOOLDIR=`$JAVA_BIN $NIMWIZ_JAVA_OPTS $EXE_GET_VMMDIR`
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- echo "[*] Backing up old resource pool settings"
-
- if [ ! -d $VMMPOOLDIR ]; then
- echo "Not a directory? '$VMMPOOLDIR'"
- exit 1
- fi
-
- BASE_BACKUP_DIR="$VMMPOOLDIR/.backups"
-
- if [ -d "$BASE_BACKUP_DIR" ]; then
- #echo " ... base backups directory exists already '$BASE_BACKUP_DIR'"
- true
- else
- mkdir $BASE_BACKUP_DIR
- if [ $? -ne 0 ]; then
- echo ""
- echo "Problem creating directory: $BASE_BACKUP_DIR"
- exit 1
- fi
- #echo " ... created base backup directory '$BASE_BACKUP_DIR'"
- fi
-
- NEW_BACKUP_DIR=`$JAVA_BIN $NIMWIZ_JAVA_OPTS $EXE_CREATE_BACKUP_DIR $BASE_BACKUP_DIR old-pools-`
- if [ $? -ne 0 ]; then
- echo ""
- echo "Problem, exiting."
- exit 1
- fi
- echo " ... created new directory '$NEW_BACKUP_DIR'"
-
- for f in `ls $VMMPOOLDIR`; do
-
- CMD="mv $VMMPOOLDIR/$f $NEW_BACKUP_DIR/"
- $CMD
- if [ $? -ne 0 ]; then
- echo "This failed: $CMD"
- exit 1
- fi
- echo " ... moved '$f' to '$NEW_BACKUP_DIR'"
-
- done
-
- echo ""
- echo "----------"
- echo ""
-
+echo "Making sure 'fake mode' is off:"
+echo ""
+
+$JAVA_BIN $NIMWIZ_JAVA_OPTS $EXE_ALTER_FAKEMODE false
+if [ $? -ne 0 ]; then
+ exit 1
fi
+echo ""
+echo "----------"
+echo ""
+
+
# }}}
# -----------------------------------------------------------------------------
-# {{{ create sample pool
+# {{{ add first VMM
# -----------------------------------------------------------------------------
if [ "$DO_POOL" = "y" ]; then
- echo "[*] Creating new resource pool"
+ echo "[*] Adding first VMM node"
- POOLPATH="$VMMPOOLDIR/$NEW_POOL_NAME"
-
- cp $RESOURCE_POOL_TEMPLATE_FILE $POOLPATH
- if [ $? -ne 0 ]; then
- echo "Could not create '$POOLPATH' ?"
- exit 1
- fi
-
- DATE=`date`
- echo "# File contents injected @ $DATE" >> $POOLPATH
- if [ $? -ne 0 ]; then
- echo "Could not write to '$POOLPATH' ?"
- exit 1
- fi
-
- echo "$NIMBUS_CONFIG_TEST_VMM $NIMBUS_CONFIG_TEST_VMM_RAM" >> $POOLPATH
+ ADD_CMD="$NIMBUS_NODES --add $NIMBUS_CONFIG_TEST_VMM --memory $NIMBUS_CONFIG_TEST_VMM_RAM"
+
+ $NIMBUSCTL services status >/dev/null 2>&1
if [ $? -ne 0 ]; then
- echo "Could not write to '$POOLPATH' ?"
- exit 1
- fi
+ echo ""
+ echo "The Nimbus service is not running. It must be started before your first VMM node can be added. You can start Nimbus with this command:"
+ echo " $NIMBUSCTL start"
+ echo "And then add the VMM yourself:"
+ echo " $ADD_CMD"
+ VMM_NOT_ADDED="yes"
- echo " ... created '$POOLPATH'"
+ else
+
+ echo "Running '$ADD_CMD'.."
+ $ADD_CMD
+ if [ $? -ne 0 ]; then
+ echo "Failed to add VMM node!"
+ echo "This could be because Nimbus is not running. Or it could be a problem communicating with the service, which happens via Unix domain sockets. If Nimbus is installed on a distributed or network filesystem, domain sockets may not be supported. In this case, you can configure a different socket directory that is on a local filesystem. Look at the admin.conf file for details."
+ echo ""
+ echo "Once you have resolved these issues, use this command to add the VMM node:"
+ echo " $ADD_CMD"
+ VMM_NOT_ADDED="yes"
+ else
+ echo "Added node."
+ fi
+
+ fi
echo ""
echo "----------"
@@ -388,24 +358,8 @@ fi
# }}}
-# -----------------------------------------------------------------------------
-# {{{ turn off fake mode; other/common.conf --> fake.mode (set to false)
-# -----------------------------------------------------------------------------
-
-echo "Making sure 'fake mode' is off:"
-echo ""
-
-$JAVA_BIN $NIMWIZ_JAVA_OPTS $EXE_ALTER_FAKEMODE false
-if [ $? -ne 0 ]; then
- exit 1
-fi
-
-echo ""
-echo "----------"
-echo ""
-
-
-# }}}
-
echo "Finished."
+if [ "X$VMM_NOT_ADDED" = "Xyes" ]; then
+ echo "WARNING: No VMM nodes are configured! Please see above for instructions."
+fi
echo ""
@@ -28,6 +28,12 @@ THISDIR=`cd $THISDIR_REL; pwd`
GLOBUS_LOCATION=`cd $THISDIR/../../; pwd`
export GLOBUS_LOCATION
+NIMBUS_HOME=`cd $GLOBUS_LOCATION/../; pwd`
+export NIMBUS_HOME
+
+NIMBUS_BIN="$NIMBUS_HOME/bin"
+NIMBUSCTL="$NIMBUS_BIN/nimbusctl"
+
# -----------------------------------------------------------------------------
# {{{ get nimbus-wizard environment
# -----------------------------------------------------------------------------
@@ -790,6 +796,18 @@ append_nameval NIMBUS_CONFIG_VMM_CONTROL_TMPDIR "$NIMBUS_CONFIG_VMM_CONTROL_TMPD
echo "" >> $NIMWIZ_DECISIONS_FILE
+# check if service is running
+$NIMBUSCTL services status >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ echo "The Nimbus service does not appear to be running, which is required for us to add the VMM node to the resource pool. You can start it now with this command:"
+ echo " $NIMBUSCTL start"
+ echo ""
+ echo "If you don't start the service, a command will be printed for you to run later and add the node."
+ echo ""
+ echo "Please optionally start the service and then hit enter."
+ read ignore_response
+fi
+
echo ""
echo "These settings are now stored in '$NIMWIZ_DECISIONS_FILE'"
echo ""
@@ -97,18 +97,6 @@ export EXE_ALTER_CONTROLEXE
EXE_ALTER_CONTROLTMPDIR="org.nimbustools.auto_config.confmgr.AlterControlTmpDir"
export EXE_ALTER_CONTROLTMPDIR
-EXE_GET_VMMDIR="org.nimbustools.auto_config.confmgr.GetVmmPoolDirectory"
-export EXE_GET_VMMDIR
-
-EXE_CREATE_BACKUP_DIR="org.nimbustools.auto_common.dirmgr.CreateNewNumberedDirectory"
-export EXE_CREATE_BACKUP_DIR
-
-RESOURCE_POOL_TEMPLATE_FILE="$NIMBUS_WIZARD_LIBDIR/resource-pool-template.txt"
-export RESOURCE_POOL_TEMPLATE_FILE
-
-NEW_POOL_NAME="testpool"
-export NEW_POOL_NAME
-
EXE_ALTER_FAKEMODE="org.nimbustools.auto_config.confmgr.AlterFakeMode"
export EXE_ALTER_FAKEMODE
@@ -1,14 +0,0 @@
-# NOTE: a node may not be in more than one pool at the same time, this will
-# result in an initialization error
-
-# Supported form:
-# node_name memory_to_manage networks_supported
-#
-# If third field is blank (or marked with '*'), it is assumed that pool
-# node supports all networks available to remote clients. Otherwise use a comma
-# separated list (no spaces between).
-#
-# Note that if you list a network here that is not valid at runtime,
-# it will silently be ignored (check your spelling).
-
-

0 comments on commit a985682

Please sign in to comment.