amazon-web-servicesamazon-ec2starcluster

AWS-Starcluster config unable to recognize region


I have StarCluster config file that looks like this:

####################################
## StarCluster Configuration File ##
####################################
[global]
DEFAULT_TEMPLATE=smallcluster

#############################################
## AWS Credentials and Connection Settings ##
#############################################
[aws info]
AWS_ACCESS_KEY_ID = AKXXXXXXXXXXXXXXXXRQ
AWS_SECRET_ACCESS_KEY = W57kWxzzzdsfasdfasfdsflk981mc4mmsPat7+C3
# replace this with your account number
AWS_USER_ID=006171111111
# Uncomment to specify a different Amazon AWS region  (OPTIONAL)
# (defaults to us-east-1 if not specified)
# NOTE: AMIs have to be migrated!
AWS_REGION_NAME = ap-northeast-1
AWS_REGION_HOST = ec2.ap-northeast-1.amazonaws.com
# AWS_REGION_NAME = us-east-1
# AWS_REGION_HOST = ec2.us-east-1.amazonaws.com

###########################
## Defining EC2 Keypairs ##
###########################
# Sections starting with "key" define your keypairs. See "starcluster createkey
# --help" for instructions on how to create a new keypair. Section name should
# match your key name e.g.:
[key mykey]
KEY_LOCATION=~/.ssh/mykey.rsa

################################
## Defining Cluster Templates ##
################################

[cluster smallcluster]
# change this to the name of one of the keypair sections defined above
KEYNAME = mykey
# number of ec2 instances to launch
CLUSTER_SIZE = 2
# create the following user on the cluster
CLUSTER_USER = sgeadmin
# optionally specify shell (defaults to bash)
# (options: tcsh, zsh, csh, bash, ksh)
CLUSTER_SHELL = bash
NODE_IMAGE_ID = ami-3393a45a
NODE_INSTANCE_TYPE = m1.small

I have no problem starting the cluster with:

AWS_REGION_NAME = us-east-1
AWS_REGION_HOST = ec2.us-east-1.amazonaws.com

But when I changed it to:

AWS_REGION_NAME = ap-northeast-1
AWS_REGION_HOST = ec2.ap-northeast-1.amazonaws.com

I get this error:

$ starcluster start mycluster
StarCluster - (http://star.mit.edu/cluster) (v. 0.95.6)
Software Tools for Academics and Researchers (STAR)
Please submit bug reports to starcluster@mit.edu

>>> Using default cluster template: smallcluster
>>> Validating cluster template settings...
!!! ERROR - Cluster settings are not valid:
!!! ERROR - Keypair 'mykey' does not exist in region 'ap-northeast-1'

What's the right way to do it?


Solution

  • Keypairs are stored separately in each region. You will need to either create a new keypair in the ap-northeast-1 region, or import the keypair in that region.

    You will need the private key (.pem file) to import the keypair.