0

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?

neversaint
  • 60,904
  • 137
  • 310
  • 477

1 Answers1

1

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.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thanks. I already have `*.pem` made under `ap-northeast-1` How can I put it in `config` file? – neversaint Feb 06 '17 at 09:54
  • 1
    The error says `Keypair 'mykey' does not exist in region 'ap-northeast-1'`, so go into the Amazon EC2 management console for that region, look in the **Key Pairs** section, and check that you have a key called `mykey`. – John Rotenstein Feb 07 '17 at 04:11
  • Thanks. I got it. Btw care to look at this http://stackoverflow.com/questions/42069678/how-to-run-starcluster-with-aws-iam-role – neversaint Feb 07 '17 at 07:35