- Developer Tools
Diane Mueller, May 24, 2012
Deploying and configuring private Platform-as-a-Service (PaaS) on CloudStack with Stackato is almost as easy as downloading a Stackato micro cloud virtual machine (VM) to your desktop.
After my previous blog post in which I stepped thru deploying Stackato onto Amazon's EC2 -- an almost turn-key deployment, as there is a Stackato Private Image in the EC2 Catalog -- I wanted to see what the analogous process would be on CloudStack. The trick was getting access to a CloudStack Development environment which the good folks at Citrix recently gave me at a recent CloudStack Developer Camp in Santa Clara.
I put the CloudStack devcamp cloud access to good use, creating a CloudStack Template (think: Amazon Machine Image) with Stackato installed that is ready to run on CloudStack, spun up Stackato on CloudStack, and deployed a few apps to test out CloudStack.
PaaS on CloudStack: Easier, Faster, and more fun!
To get Stackato up and running on CloudStack, you'll need to convert a Stackato VM to VHD format, upload it to the CloudStack server, and create a template. The rest of the process is practically the same for any cloud: Spin up an instance, configure an IP address and domain name, SSH into the instance, perform a few simple stackato-admin commands, then launch the Stackato Web Management Console to complete your setup and configuration. You can then push an app from our app store or download the Stackato Client to push your applications directly to the cloud from your desktop.
Step 1: Convert the latest Stackato VMWare VM to VHD format
If your CloudStack setup uses the Xen Server hypervisor, you will need to create a VHD format Virtual Machine Image. To do this, download the VMWare VMDK format VM to your desktop. The Stackato VM is available for free subject to the terms and conditions of the Stackato Micro Cloud License Agreement.
I used a freeware product called StarWind V2V Image Converter, a downloadable V2V conversion tool for virtual machines. You can use it to convert VMDK to VHD files. It took about 10 minutes on my Windows desktop.
Note: If you are using a Mac, you can use VirtualBox to do the conversion
Step 2: Put the VHD VM in an accessible place
This is necessary because CloudStack's Template Wizard needs to be able to access it via a URL. I used FileZilla to do a secure transfer, which took a while because the converted VHD file was 4.4 GB.
Once you've finished creating the CloudStack template in Step 3, you can delete this VHD file as you will NOT need it again.
Step 3: Create a CloudStack Template
By creating a CloudStack Template, you'll be able to easily create as many instances of Stackato as need. This is handy when building a multi-node clusters or deploy more than one PaaS on the same cloud.
The CloudStack Console provides a web interface for interacting with CloudStack Services. It's a simplified and much less complex UI to use than the AWS console, thanks to a great UI design team and a series of wizards that visually unify the process of gathering all the information for creating instances via their template concept. To begin the process of creating a re-usable template, log in to your CloudStack Console using your CloudStack account name and password.
From your CloudStack console, navigate to the "Templates" Tab and click on the "Create Template". This will launch the "Create Template" dialog for you.
Give your template a friendly and memorable Name & Description, type in the location of your recently converted VHD file, and select OS Type "Ubuntu 10.04 (64-bit)".
Click on "OK" and then wait a few minutes while your image is uploaded and imported into CloudStack. When the process is finished you will see your newly minted template listed.
It may take a few minutes for the 4.4 G file to upload, but once it's done, using the template will make creating instances a snap.
Step 4: Create a CloudStack Instance
Now you are ready to create a CloudStack instance of Stackato. From your CloudStack console, navigate to the "Templates" tab and click on the "Add Instance". This will launch the "Add Instance" wizard for you.
Select the "Template" option, click on the name of the template that you've just created, choose a "Medium" Size Instance, select the default network and once again give your Instance a memorable name.
This process has a great wizard that walks you through the process.
Now you should see an ActiveState Stackato Instance running on your Console dashboard!
Step 5: Associate your Domain Name with your Stackato Instance's IP Address
The IP Address for the instance is assigned automatically by CloudStack. To find it, click on the display name of your Stackato Instance and navigate to the "NICS" Tab.
Use this IP address to direct to set up a DNS or dynamic DNS record.
Now you'll need to SSH into your instance and make a few simple changes to your DNS Configuration by editing your /etc/hosts file.
Step 6: Log in to your Stackato Instance with ssh/PuTTY
You need to tell Stackato about your instance's IP address and your chosen domain name. Log in to your machine via ssh.
SSH is just a secure way to log into a remote computer as an authenticated user. If you're using Linux or Mac OS X, use the 'ssh' client that comes with the OS, if you're using Windows get a copy of PuTTY. Launch PuTTY from your desktop and type in your IP address in the Host field, then click "Open".
Click the "Open" button and you'll be prompted to login to your instance for the first time. This first time, you'll login as the user "stackato" using the default password, which is also "stackato". Do not change the password yet, this will be done in a later step.
Step 7: Adding your domain to /etc/hosts
You'll need to add a line in the /etc/hosts file to resolve the domain name added above to localhost via the 127.0.0.1 loopback address. To make these edits, you'll need to use a console text editor like "Vim", which is already installed on your CloudStack instance (if you don't know how to use it, here's a useful cheatsheet).
To edit the /etc/hosts file, you'll have to run vim with the "sudo" command - which allows you to run programs and commands with the security privileges of another user (in this case, the superuser, or root):
$ sudo vim /etc/hosts
You'll need to add one line to the top of the /etc/hosts file, substituting your domain name for the one used in this example.
127.0.0.1 localhost stackato paas.your-domain-name.com api api.paas. your-domain-name.com
When you save the file, you may get an "unable to resolve host stackato-xxxx" error. This message can be ignored.
Step 8: Becoming Stackato: the "stackato-admin" command basics
While still logged in to your instance, you'll need to type in the final configuration using two 'stackato-admin' commands and then reboot your instance. From the command line, type in the following stackato-admin commands substituting your domain information:
$ stackato-admin admin grant firstname.lastname@example.org
The email address used here should be the same one you will use for the first admin user of the system in Step 9.
The "IP Address" is the one noted as IP Address for your CloudStack instance in Step 5
$ stackato-admin become all -m 126.96.36.199 -e api.cloudstack-stackato.dns1.us -n cloudstack -o cloudstack-stackato.dns1.us
Now reboot so all the changes take effect.
$ sudo reboot
When you do the 'reboot', your session will automatically end and disconnect.
Step 9: Sign in to the Stackato Web Management Console
Direct your browser to the API endpoint address specified with the 'stackato-admin become ...' command above (e.g. https://api.cloudstack-stackato.dns1.us). This will take you to the initial console setup welcome page. Use the same email address here that was granted admin permission in the previous step. The password that you provide here will also become the stackato system password, replacing the default 'stackato' password used previously.
After that, you are ready to deploy apps to Stackato, your own single instance personal Private PaaS on CloudStack. From here, navigate to our App Store and select any of the many Open Source projects that we have tested and included or download the Stackato Client and push apps directly from your desktop.
To learn more about deploying applications to Stackato and navigating the Stackato Web Management console, watch this short YouTube video. Thinking about setting-up a cluster for to scale for production use? Be sure to contact our sales team to learn how Stackato Enterprise can help your business.
Subscribe to ActiveState Blogs by Email
Share this post: