Originally posted by: Rui_Gao
Learn how to set up your Amazon Web Services environment and provision compute hosts from the Amazon cloud for IBM Spectrum Symphony workload
IBM Spectrum Symphony Version 7.2 introduced host factory, a framework that enables your on-premises cluster to dynamically include compute hosts from the cloud based on the resource demands of applications in your cluster. With host factory, you can leverage the on-demand capabilities of cloud infrastructure to provision as many resources as you need and pay only for what you use.
This blog focuses on how to set up your AWS environment and trigger bursting to the AWS cloud in your cluster.
Step 1: Create an AWS account
- Launch your web browser and go to https://aws.amazon.com/.
- Choose Create an AWS Account. Follow the online instructions to create the account.
It is recommended that the cluster administrator create an Amazon account and designate an IAM user within this account with appropriate authorization to access AWS resources (that is, EC2 full access, AmazonVPCFull Access). The AWS credentials of the designated IAM user will be used to provision EC2 hosts in your cluster. Alternatively, you can use root access keys for your AWS account. The root account credentials provide unlimited access to your AWS resources; for account security, AWS does not consider this a good practice.
Step 2: Create a custom image in AWS for an IBM Spectrum Symphony compute host
You can choose between the following options to create an image (Amazon Machine Image or AMI) for an IBM Spectrum Symphony compute host. This AMI will be used to launch Amazon Elastic Compute Cloud (EC2) instances on demand:
Option 1: Select a standard OS image that AWS provides (for example, RedHat, Ubuntu, Suse, or Windows).
Option 2: Create a custom image with the standard OS and IBM Spectrum Symphony installed and configured.
For advantages and disadvantages of both options, refer to the Cloud host provisioning options topic in the IBM Knowledge Center.
Here, for demonstration purposes, we will use option 2. In general, option 2 involves two steps:
- Manually launch an EC2 instance with a standard OS image.
- Customize the instance by installing IBM Spectrum Symphony on it.
Step 2.1: Launch an EC2 instance with a standard OS image
- Use your AWS account to sign in to the AWS Management Console.
- Click Services from the top navigation bar, and choose EC2. You will be redirected to the EC2 dashboard.
- Click Launch Instance.
- Choose an AMI; for example, Red Hat which is free.
- Choose an Instance Type; for example, t2.micro which is free.
- Configure Instance Details. You can use Amazon’s default VPC or your own VPC. To create your own VPC, navigate to the VPC Dashboard, click Start VPC Wizard, and follow the wizard prompts.
Then, while configuring instance details, select the VPC that you created.
- Add Storage. Enter Size (GiB) as 30G. Currently, Free-tier eligible customers can get up to 30 GB of EBS General Purpose (SSD) or Magnetic storage. IBM Spectrum Symphony needs at least 6G for installation.
NOTE: Ensure that the Delete on Termination check box is selected (default) to remove additional storage when the instance terminates.
- Add Tags. Skip this step.
- Configure the Security Group. Security groups act as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level. You must add rules to a security group that enable you to connect to your instance from your IP address using SSH.
Click Create a new security group to create a new security group for use only by your IBM Spectrum Symphony cluster. Note your security group ID; you will need it for subsequent steps.
NOTE: Configure the security that is appropriate for your cluster. For details about inbound and outbound rules for security group, refer to the Create a Base Security Group and Using Network Security topics in Amazon documentation. For testing purposes, 0.0.0.0/0 which allows all IP addresses to access your instance can be used. or a production deployment cluster, however, the security group must be created and configured while creating a VPC as part of secure network setup required for cloud access. In this blog, we will not elaborate on the secure networking configuration. The Security Group configuration can be modified at any time, even after the instance is created. For details, refer to Security Group documentation.
- Review Instance Launch. Click Launch, which will open the Select an existing key pair or create a new key pair dialog.
Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. To log in to your instance, you must create a key pair, specify the name of the key pair when you launch the instance, and provide the private key when you connect to the instance. Linux instances have no password, and you use a key pair to log in using SSH. For details about Amazon key pairs, refer to EC2 Key Pairs documentation.
In the Select an existing key pair or create a new key pair dialog, enter a key-pair name, and click Download Key Pair.
IMPORTANT: Ensure that you download the .pem file before you continue. You will not be able to download the file again after it is created.
- Click Launch Instances.
- On the EC2 Dashboard, check if your instance is launched.
Step 2.2: Customize the instance by installing IBM Spectrum Symphony on it
- To customize the EC2 instance, log on using SSH. For example:
# ssh -i "symphony-use.pem" ec2-user@ec2-34-208-112-19.uswest-2.compute.amazonaws.com
- Copy the IBM Spectrum Symphony package to your EC2 instance. For example:
# scp -i symphony-use.pem sym-7.2.0.0_x86_64.bin ec2-user@ec2-54-148-208-105.uswest 2.compute.amazonaws.com:~/.
- Switch to root user:
[ec2-user@ip-172-31-20-94 ~]$ sudo su root
- Install IBM Spectrum Symphony on the EC2 instance. For details, refer to the Install Symphony Compute On Linux Host topic in the IBM Knowledge Center.
For example:
# export BASEPORT=30600
# export CLUSTERADMIN=root
# export CLUSTERNAME=cloud
# export DERBY_DB_HOST=ec2-54-148-208-105.us-west-2.compute.amazonaws.com
# export SIMPLIFIEDWEM=N
# export EGOCOMPUTEHOST=Y
./sym-7.2.0.0_x86_64.bin --dbpath /opt/cloud/test/db --prefix /opt/cloud/test/platform
- Update the /etc/hosts file on the EC2 host to add the host names of the IBM Spectrum Symphony master and master candidate hosts.
- Join the host to the cluster and start IBM Spectrum Symphony on the EC2 host. For example:
source $EGO_TOP/profile.platform
egoconfig join symhost
egosetrc.sh
egosh ego start
- Create the custom AMI. On the EC2 > Instances page, click Actions > Image > Create Image.
Enter the image name (for example, “symphony”). Change Size(GiB) to 30 as the IBM Spectrum Symphony installation needs at least 6G.
A new image is created. Remember your AMI ID; you need this value for host factory configuration.
Step 3: Configure the AWS provider plug-in in IBM Spectrum Symphony
- Copy your AWS credentials file and the private key file to your master host. For more information, refer to the Setting up an AWS account topic in the IBM Knowledge Center.
- Copy your .pem file to a specific directory on the IBM Spectrum Symphony master host (for example, "/amazonkey/symphony-use.pem").
- From the AWS IAM console, create an access key for the designated IAM user.
- Download the AWS security credentials for the designated IAM user to a secure location on your master host (for example, "/amazonkey/credentials.csv”).
- Create a credentials file to include the downloaded key information in the following format:
[root@ma1symv14 amazonkey]# cat credentials.csv
[default]
aws_access_key_id=<your_access_key_id>
aws_secret_access_key=<your_secret_access_key>
- Configure the awsprov_config.json at $HF_CONFDIR/providers/aws/conf/ (where $HF_CONFDIR is by default $EGO_ESRVDIR/hostfactory/conf/) as follows:
[root@ma1symv14 conf]# cat awsprov_config.json
{
"AWS_CREDENTIAL_FILE": "/amazonkey/credentials.csv",
"AWS_REGION": "us-west-2",
"AWS_KEY_FILE": "/amazonkey/"
}
The value of AWS_REGION is Amazon EC2 region. The region information can be obtained from the region selector in the upper right corner of the AWS console. Obtain the corresponding region code from the Available Regions section in Amazon documentation. For example:
- Configure awsprov_templates.json at $HF_CONFDIR/providers/aws/conf/ as follows:
[root@symhost conf]# cat awsprov_templates.json
{
"templates": [
{
"templateId": "Template-VM-SYMA",
"maxNumber": 10,
"attributes": {
"type": ["String", "X86_64"],
"ncores": ["Numeric", "1"],
"ncpus": ["Numeric", "1"],
"nram": ["Numeric", "1024"]
},
"imageId": "ami-8cc85cec",
"subnetId": "subnet-d3ea529a",
"vmType": "t2.micro",
"keyName": "test",
"securityGroupIds": ["sg-585eb123"],
"userData": "/scripts/user_data.sh"
}
]
}
For details of each configuration parameter, refer to the awsprov_templates.json reference in the IBM Knowledge Center.
- "imageId" is the ID of the AMI that is used to launch EC2 instances, for example, the custom image that you created in Step 2. Alternatively, obtain the information from Image > AMI on the EC2 console.
- “subnetId” is the ID of the subnet (in the desired VPC) into which the instances are launched. Get your information from the VPC console. Click Subnet on the navigation pane to view subnet IDs for your VPC.
- "securityGroupIds" is your AWS security group ID, which you used in the previous step while creating EC2 instances. You can also get this information from the EC2’s dashboard; click NETWORK & SECURITY > Security Groups on the navigation pane and get the Group ID from the Description tab.
- “keyName” is the name of the Amazon EC2 key pair, which you used in the previous step while creating EC2 instances. You can also get this information from the EC2’s dashboard; click NETWORK & SECURITY > Key Pairs to get the key pair name.
Step 4: Configure the symA requestor plug-in on the management host
The symA requestor plug-in monitors the workload of cloud-enabled applications in the cluster and triggers requests for cloud bursting based on demand.
We can control the requestor plug-in’s configuration through the symAref_config.json and symAreq_policy_config.json files at $HF_CONFDIR/requestors/symA/conf. For details of each parameter, refer to the symAreq_config.json reference and symAreq_policy_config.json reference in the IBM Knowledge Center. In this blog, we will use the default configuration.
[root@symhost conf]# cat symAreq_config.json
{
"scaling_policy": "throughput",
"slot_mapping":
{
"ncores": 1,
"nram": 256
},
"cloud_apps":[
{
"name": "symping7.2"
}
],
"host_return_policy": "lazy"
}
[root@symhost conf]# cat symAreq_policy_config.json
{
"scaling_policy":[
{
"name": "throughput",
"description": "Throughput is the number of tasks executed per minutes per slot",
"warmup_time": 1,
"history_expiry_time": 60,
"desired_task_complete_duration": 1
}
],
"host_return_policy":[
{
"name": "lazy",
"description": "Return cloud hosts closer to the end of billing interval",
"billing_interval": 60,
"return_interval": 10
}
]
}
Step 5: Trigger cloud bursting with IBM Spectrum Symphony
- Start the HostFactory service:
# egosh service start HostFactory
# egosh service list -s HostFactory
- Submit the “symping” application for cloud bursting. For example:
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
[root@symhost log]# symping -a symping7.2 -r 1000 -m 1000 > /dev/null &
- Check the log at $EGO_TOP/eservice/hostfactory/log to view details of scale-out requests.
- Check the AWS E2 Instances webpage for details of cloud hosts:
That’s it! You have successfully set up your AWS environment for cloud bursting and triggered the HostFactory service to provision compute hosts from the Amazon cloud. For more details of host factory in IBM Spectrum Symphony, refer to the Working with host factory for cloud bursting section in the IBM Knowledge Center.
Next steps: Talk to us!
We’d love to hear from you. If you’ve got comments or questions, add a comment below. You can also post in our IBM Spectrum Symphony forum.
#SpectrumComputingGroup