diff --git a/oam/cloud/IDBInstanceCmds.sh b/oam/cloud/IDBInstanceCmds.sh index 1a33c8328..3592f48de 100644 --- a/oam/cloud/IDBInstanceCmds.sh +++ b/oam/cloud/IDBInstanceCmds.sh @@ -111,7 +111,7 @@ export JAVA_HOME=$java # get Keys and region AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey` -if [ $AmazonAccessKeyfile == "unassigned" ]; then +if [ $AmazonAccessKeyFile == "unassigned" ]; then echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile" exit 1 fi diff --git a/oam/cloud/IDBVolumeCmds.sh b/oam/cloud/IDBVolumeCmds.sh index 02482b43b..82f2dd6a9 100644 --- a/oam/cloud/IDBVolumeCmds.sh +++ b/oam/cloud/IDBVolumeCmds.sh @@ -111,7 +111,7 @@ export JAVA_HOME=$java # get Keys and region AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey` -if [ $AmazonAccessKeyfile == "unassigned" ]; then +if [ $AmazonAccessKeyFile == "unassigned" ]; then echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile" exit 1 fi @@ -193,25 +193,26 @@ createvolume() { if [ $moduleType == "um" ]; then # get type - volumeType=`$prefix/Calpont/bin/IDBInstanceCmds.sh UMVolumeType` + volumeType=`$prefix/Calpont/bin/getConfig Installation UMVolumeType` if [ $volumeType == "io1" ]; then # get IOPS - volumeIOPS=`$prefix/Calpont/bin/IDBInstanceCmds.sh UMVolumeIOPS` + volumeIOPS=`$prefix/Calpont/bin/getConfig Installation UMVolumeIOPS` fi else # pm # get type - volumeType=`$prefix/Calpont/bin/IDBInstanceCmds.sh PMVolumeType` + volumeType=`$prefix/Calpont/bin/getConfig Installation PMVolumeType` if [ $volumeType == "io1" ]; then # get IOPS - volumeIOPS=`$prefix/Calpont/bin/IDBInstanceCmds.sh PMVolumeIOPS` + volumeIOPS=`$prefix/Calpont/bin/getConfig Installation PMVolumeIOPS` fi fi #create volume if [ $volumeType == "io1" ]; then - volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` + volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` else - volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` + volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` + fi echo $volume return diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index 280e164e1..0b07f2faf 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -5946,7 +5946,7 @@ namespace oam } //attach and format volumes - device = "/dev/sdf" + itoa(moduleID); + device = "/dev/sdf"; string localInstance = getEC2LocalInstance(); diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 8d728406f..369d78432 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -850,7 +850,8 @@ int main(int argc, char *argv[]) cloud = oam::UnassignedName; } - cout << "Amazon EC2-API-TOOLS Instance install. You have 2 install options: " << endl << endl; + cout << "===== Amazon EC2-API-TOOLS Instance Install =====" << endl << endl; + cout << "You have 2 install options: " << endl << endl; cout << "1. Utilizing the Amazon IDs for instances and volumes which allows for features like" << endl; cout << "automaticly launching instances and EBS volumes when configuring and system expansion." << endl; cout << "This option is recommended and would be use if you are setting up a InfiniDB system." << endl << endl; @@ -1316,9 +1317,9 @@ int main(int argc, char *argv[]) cout << "===== Setup the Module Configuration =====" << endl << endl; if (amazonInstall) { - cout << "Amazon Install: For Module Configuration, you will have the option to Enter the Instance IDs" << endl; - cout << "if you have already precreated the Instance's you want to install on or have postConfigure create" << endl; - cout << "the Instances for you. You will be prompted during the Module Configuration setup section." << endl; + cout << "Amazon Install: For Module Configuration, you will have the option to provide the" << endl; + cout << "existing Instance IDs or have postConfigure create the Instances used for the other nodes." << endl; + cout << "You will be prompted during the Module Configuration setup section." << endl; } //get OAM Parent Module IP addresses and Host Name, if it exist @@ -1652,47 +1653,52 @@ int main(int argc, char *argv[]) } else { - //check if need to create instance or user enter ID - string create = "y"; - - while(true) + if ( moduleHostName == oam::UnassignedName ) { - pcommand = callReadline("Do you need the instance created for " + newModuleName + " [y,n] (y) > "); - if (pcommand) + //check if need to create instance or user enter ID + string create = "y"; + + while(true) { - if (strlen(pcommand) > 0) create = pcommand; - callFree(pcommand); + pcommand = callReadline("Create Instance for " + newModuleName + " [y,n] (y) > "); + if (pcommand) + { + if (strlen(pcommand) > 0) create = pcommand; + callFree(pcommand); + } + if ( create == "y" || create == "n" ) + break; + else + cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl; + create = "y"; + if ( noPrompting ) + exit(1); } - if ( create == "y" || create == "n" ) - break; - else - cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl; - create = "y"; - if ( noPrompting ) - exit(1); - } + + + if ( create == "y" ) { + ModuleIP moduleip; + moduleip.moduleName = newModuleName; + + string AmazonVPCNextPrivateIP = "autoassign"; + try { + oam.getSystemConfig("AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP); + } + catch(...) {} + + moduleip.IPaddress = AmazonVPCNextPrivateIP; - - if ( create == "y" ) { - ModuleIP moduleip; - moduleip.moduleName = newModuleName; - - string AmazonVPCNextPrivateIP = "autoassign"; - try { - oam.getSystemConfig("AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP); + newModuleHostName = launchInstance(moduleip); + if ( newModuleHostName == oam::UnassignedName ) + { + cout << "launch Instance failed for " + newModuleName << endl; + exit (1); + } + + prompt = ""; } - catch(...) {} - - moduleip.IPaddress = AmazonVPCNextPrivateIP; - - newModuleHostName = launchInstance(moduleip); - if ( newModuleHostName == oam::UnassignedName ) - { - cout << "launch Instance failed for " + newModuleName << endl; - exit (1); - } - - prompt = ""; + else + prompt = "Enter EC2 Instance ID (" + moduleHostName + ") > "; } else prompt = "Enter EC2 Instance ID (" + moduleHostName + ") > "; @@ -2095,8 +2101,7 @@ int main(int argc, char *argv[]) while(true) { - pcommand = callReadline("Do you need the volume created [y,n] (y) > "); - if (pcommand) + pcommand = callReadline("Create an EBS volume for " + newModuleName + " ? [y,n] (y) > "); { if (strlen(pcommand) > 0) create = pcommand; callFree(pcommand); @@ -2132,7 +2137,7 @@ int main(int argc, char *argv[]) } //get device name based on DBRoot ID - deviceName = "/dev/sdf" + oam.itoa(moduleID); + deviceName = "/dev/sdf"; } else { @@ -4287,13 +4292,11 @@ bool storageSetup(bool amazonInstall) // get Frontend Data storage type // - cout << "----- Setup High Availability Frontend MySQL Data Storage Mount Configuration -----" << endl << endl; + cout << "----- Setup User Module MySQL Data Storage Mount Configuration -----" << endl << endl; cout << "There are 2 options when configuring the storage: internal and external" << endl << endl; - cout << " 'internal' - This is specified when a local disk is used for the MySQL Data storage." << endl; - cout << " High Availability Server Failover is not Supported in this mode," << endl << endl; - cout << " 'external' - This is specified when the MySQL Data directory is externally mounted." << endl; - cout << " High Availability Server Failover is Supported in this mode." << endl << endl; + cout << " 'internal' - This is specified when a local disk is used for the MySQL Data storage." << endl << endl; + cout << " 'external' - This is specified when the MySQL Data directory is externally mounted." << endl << endl; try { UMStorageType = sysConfig->getConfig(InstallSection, "UMStorageType"); @@ -4370,6 +4373,12 @@ bool storageSetup(bool amazonInstall) return false; } + string minSize = "1"; + string maxSize = "16384"; + + if (UMVolumeType == "io1") + minSize = "4"; + cout << endl; try { oam.getSystemConfig("UMVolumeSize", UMVolumeSize); @@ -4377,14 +4386,8 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( UMVolumeSize.empty() || UMVolumeSize == "") - UMVolumeSize = oam::UnassignedName; - - string minSize = "1"; - string maxSize = "16384"; - - if (UMVolumeType == "io1") - minSize = "4"; + if ( UMVolumeSize.empty() || UMVolumeSize == "" || UMVolumeSize == oam::UnassignedName) + UMVolumeSize = "10"; while(true) { @@ -4527,7 +4530,7 @@ bool storageSetup(bool amazonInstall) if ( DBRootStorageType == "hdfs" ) storageType = "4"; - cout << endl << "----- Setup High Availability Data Storage Mount Configuration -----" << endl << endl; + cout << endl << "----- Setup Performance Module DBRoot Data Storage Mount Configuration -----" << endl << endl; if ( glusterInstalled == "n" && hadoopInstalled == "n" ) { @@ -4710,8 +4713,8 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( PMVolumeSize.empty() || PMVolumeSize == "") - PMVolumeSize = oam::UnassignedName; + if ( PMVolumeSize.empty() || PMVolumeSize == "" || PMVolumeSize == oam::UnassignedName) + PMVolumeSize = "100"; string minSize = "1"; string maxSize = "16384"; @@ -4762,7 +4765,7 @@ bool storageSetup(bool amazonInstall) catch(...) {} - if ( PMVolumeIOPS.empty() || PMVolumeIOPS == "") + if ( PMVolumeIOPS.empty() || PMVolumeIOPS == "" || PMVolumeIOPS == oam::UnassignedName) PMVolumeIOPS = maxIOPS; while(true) @@ -4771,11 +4774,11 @@ bool storageSetup(bool amazonInstall) pcommand = callReadline(prompt); if (pcommand) { - if (strlen(pcommand) > 0) PMVolumeSize = pcommand; + if (strlen(pcommand) > 0) PMVolumeIOPS = pcommand; callFree(pcommand); } - if ( atoi(PMVolumeSize.c_str()) < atoi(minIOPS.c_str()) || atoi(PMVolumeSize.c_str()) > atoi(maxIOPS.c_str()) ) + if ( atoi(PMVolumeIOPS.c_str()) < atoi(minIOPS.c_str()) || atoi(PMVolumeIOPS.c_str()) > atoi(maxIOPS.c_str()) ) { cout << endl << "Invalid Entry, please re-enter" << endl << endl; if ( noPrompting )