Tech

How to configure your OnApp cloud for Amazon EC2

Tags: , ,

OnApp provides a “single pane of glass” for Amazon EC2 as well as the huge range of IaaS capabilities that run natively on OnApp.

Here’s a brief guide to getting EC2 working with your OnApp cloud. First we’re going to enable your cloud for AWS; then set up an AWS user; then set up an OnApp user for AWS.

It’s a fairly straightforward process, but I’ve also provided some troubleshooting tips at the end of this post. Hope you find it helpful.

 

#1. Enable AWS for your OnApp cloud

If you have not enabled AWS for your users yet, you will need to do the following:

  • Log in as an Administrator
  • Go to Settings > Configuration
  • Set “Allow users connect to AWS” to ON
  • Click Save Configuration

Using EC2 with OnApp cloud - enabling AWS

 

#2. Set up a user in AWS

Next, you will need to set up a user in AWS, and get security credentials. To do that:

  • Log into your Amazon account
  • Click on your user name > Security Credentials
  • Click Users
  • Create New Users
  • Enter your Login for OnApp in the first line and click create (in theory the Login names can be different, but this may cause problems)

Using EC2 with OnApp cloud - setting up a user

  • Copy the “Access Key ID” and “Secret Access Key” and close (if you want to, you can also download the key information and then close the windows. If you don’t want to, accept the warning and then close)
  • Under the new User click Permissions > Attach Policy
  • Attach the AdministratorAccess policy

Using EC2 with OnApp cloud - attaching an administrator access policy

#3. Set up a user in OnApp

Now that you have a user setup and security credentials, do the following in OnApp:

  • Log into OnApp as the user you want to add an EC2 server to (note: impersonating the user will not let you complete this action)
  • Click on the user name at the top > My Profile
  • Next to “Amazon Disconnected” click on the link button
  • Enter the “Access Key ID” and “Secret Access Key”
  • Click Submit

 

#4. That’s it…

Now that you have Amazon connected, you can see your EC2 instances and create new instances. You will see a new “EC2 Instances” menu item on the left-hand toolbar in OnApp. Click on this and select the region you have existing instances in to view and manage them.

 

Troubleshooting

Here are a few errors you could run into while trying to make this work:

Authorization Failure
If you get a warning like “Authorization Failure” (shows in production.log as “describe_instances() AWS::EC2::Errors::AuthFailure AWS was not able to validate the provided access credentials”) – then:

  • You may need to initialize your EC2 servers by deploying your first server, or
  • Your login for OnApp and Amazon could be different

Unauthorized Operation
If you get a warning like “Unauthorized Operation” (shows in production.log as “describe_instances() AWS::EC2::Errors::UnauthorizedOperation You are not authorized to perform this operation.”) – then:

  • The Policy was not attached to the user, or you have the wrong policy attached