The following sub-sections describe the steps involved in creating a cartridge on the EC2 IaaS:
Table of Contents
Step 1 - Spawning an instance
Prerequisites
Prerequisite | Description |
---|---|
EC2 Account | To follow this guide, you need an EC2 account. Create an AWS account if you do not have an account. For more information, see Sign Up for Amazon EC2. This account must be authorized to manage EC2 instances (including start and stop instances, create security groups and key pairs). |
Create a security group | For more information, see Creating a security group. |
Create a key pair | For more information see Creating a key pair. |
...
Before launching the instance, you need to create the right security group. This security group defines firewall rules for your instances, which are a list of ports that are used as part of the default Stratos deployment. These rules specify which incoming network traffic is delivered to your instance. All other traffic is ignored. The For more information on the ports that should be defined are listed here: , see Required Ports.
To create the security group and configure it:
- On the Network and Security menu, click Security Groups.
- Click on Create Security Group.
- Enter the name and description of the security group.
- Click Yes, Create .
- Click Inbound.
Select "Custom TCP rule".
- Enter the port or port range.
There are two kinds of ports listed in the common configurations, which are namely open for outside access and restricted internal access. You will have to ideally enter each of the ports as separate rules. Click Add Rule and then click Apply Rule Changes.
Always apply rule changes, as your rule will not get saved unless the rule changes are applied.
Repeat steps 6 to 8 to add all the ports mentioned, as each port or port range has to be added as a separate rule.Info Note down the names of your security groups if you wish to enter your user data in the wizard.
Anchor | ||||
---|---|---|---|---|
|
...
- On the Network and Security menu, click Key Pairs.
- Click Create New Key Pair.
- Enter a name for your Key Pair.
- Click Create. After the Key Pair automatically downloads, click Close.
- Set the key pair permission as follows:
chmod 0600 <KEY_PAIR_NAME>
Spawning an EC2 Instance
- Sign in to the Amazon Web Services (AWS) Management Console and open the Amazon EC2 console.
- Click EC2 on the home console.
- Select the Region for the instance from the region drop down list.
Click Launch Instance.
Select Quick Launch Wizard.
Name your instance, for example 'StratosCartridgeInstance'.
- Select the key pair that you created.
Select More Amazon Machine Images and click on Continue.
- On the next page, specify the image .
- Click Continue.
- Click Edit Details.
- Edit the image size.
- Select the Instance Details option.
- Change the image type as required.
- Select a security group.
- Select the Security Settings option.
- Click Select Existing Security Groups.
- Select the security group you have created previously.
Click Launch to start the EC2 instance.
Click Close.
This will redirect you to the instance page. It takes a short time for an instance to launch. The instance's status appears as pending while it is launching. After the instance is launched, its status changes to running.
...
Excerpt | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DevOps can create a cartridge either by using the quick guide or the detailed guide, as explained below:
Follow the instructions below to configure a cartridge image for OpenStack or EC2. These instructions describe how to create a cartridge from an existing Debian/Ubuntu based Linux 12.04.1 LTS image as a quick guide.
Follow the instructions below to configure a cartridge image for OpenStack or EC2. These instructions describe how to create a cartridge from an existing Debian/Ubuntu based Linux 12.04.1 LTS image as a more detailed guide.
|
...
Open the Amazon EC2 console.
Make sure the appropriate Region is selected in the region selector of the navigation bar.
Click Instances in the navigation pane.
- On the Instances page, right-click your running instance and select Create Image.
Fill in a unique image name and an optional description of the image (up to 255 characters), and click Create Image.
Info In Amazon EC2 instance store-backed AMIs, the image name replaces the manifest name. For example,
s3_bucket/something_of_your_choice.manifest.xml
), which uniquely identifies each Amazon Amazon EC2 instance store-backed AMI.Info Amazon EC2 powers down the instance, takes images of any volumes that were attached, creates and registers the AMI, and then reboots the instance.
Go to the AMIs page and view the AMI's status. While the new AMI is being created, its status is
pending
.Info It takes a few minutes for the whole process to finish.
- Once your new AMI's status is
available
, go to the Snapshots page and get the Snapshot ID of the new snapshot that was created for the new AMI, that will be used in the Sample Cartridge Definition JSON file. Any instance you launch from the new AMI uses this snapshot for its root device volume.
Info |
---|
After you finished creating the cartridge, make a note of the image ID you creates for the cartridge, as you will need this when you use Stratos Manager to deploy the cartridge. For more information on deploying the created cartridge using the Stratos Manager, see Deploying a Multi-tenant Service Cluster via the UI. |