Creating a Cartridge Base Image on OpenStack
The following sub-sections describe the steps involved in creating a cartridge base image on the OpenStack IaaS:
Step 1 - Spawn an instance
Follow the instructions below to spawn a configured instance of Debian/Ubuntu based Linux 12.04.1 LTS distributions on OpenStack:
- Log in to the OpenStack management console.
- Click Access & Security on the menu in the left side and click Create Security Group.
- In the Add Rule window, enter the configurations of the rules for the security group as required and click Add. For more information on the ports that should be defined, see Required Ports.
- In the Create an Image window, enter the configurations for the image as required and click Create Image.
- In the Create Key Pair window, enter the configurations for the key pair as required and click Create Key Pair. When the message is prompted, download the key pair and keep it saved in a preferred location.
Protect your key pair by executing the following command in your terminal.
By default, your PEM file will be unprotected. Use the following command to secure your PEM file so that others will not have access to it:chmod 0600 <path to the private key>
- In the Details section of the Launch Instance window, enter the configurations for the instance as required.
- In the Access & Security section enter the configurations for the instance as required and click Create.
- Select the created instance in the Instances window and click Launch instance.
Step 2 - Configure the cartridge base image
Follow the steps given below to configure a base Image:
Start up a virtual machine (VM) instance using a preferred OS, on a preferred IaaS.
Install the Puppet agent.
Open the
puppet
file, which is in the<PUPPET_AGENT>/etc/default
directory and configure it as follows:START=yes
Add the following to the
puppet.conf
file, which is in the<PUPPET_AGENT>
/etc/puppet
directory:[main] server=puppet.ppaas.org
Stop the puppet instance or instances that are running.
cd /etc/init.d/puppet stop
Copy the
init.sh
script into the<PUPPET_AGENT>/root/bin
directory.Update the
/etc/rc.local
file./root/bin/init.sh > /tmp/puppet_log exit 0
Execute the following commands:
rm -rf /var/lib/puppet/ssl/* rm -rf /tmp/*
Step 3 - Create a snapshot of the instance
Follow the instructions below to create a snapshot of the instance on OpenStack:
- Log in to the OpenStack management console.
- Navigate to Instances on the menu on the left side.
- Select the respective instance and click Create Snapshot.
- Enter a name for the image and click Create Snapshot.
- Navigate to Images on the menu that is on the left side and get the Image ID. You need to define the Image ID in the Sample Cartridge Definition JSON file.
After you have finished creating the cartridge, make a note of the image ID you created for the cartridge, as you will need this when you use Stratos Manager to add a cartridge.