Interacting with Metapod from the OpenStack CLI (or Building your OpenStack CLI VM)
Back in September 2014 Cisco acquired private OpenStack cloud service company Metacloud (http://newsroom.cisco.com/press-release-content?articleId=1489587). Initially known as Cisco OpenStack Private Cloud (COPC) and now known as Cisco Metapod®. Cisco Metapod represents one of most robust and scalable OpenStack-as-a-Service or On-Premise Public Cloud Experience offering in the market. With the agility and vision of a startup, the stability and expertise of Cisco, this is a solution and a service that helps businesses with the adoption of the agile/mode 2 or cloud native applications.
For the networking or IT teams, all these new solutions and technologies might seem intimidating at first. Do I have to become an OpenStack expert? Am I going to have my CLI or am I to become a GUI guy?
Well, you are going to have a CLI: the OpenStack CLI. The Cisco Metapod® is OpenStack and as such it maintains the standard OpenStack API so we use the standard OpenStack client libraries for this.
The following steps guide you over the process for creating your own VM with the OpenStack client libraries, which you can use as the CLI to interact with any standard OpenStack deployment.
Preparing a CentOS 7.x VM with the OpenStack client libraries and CLI:
Install EPEL repo:
Upgrade the VM after the EPEL repo installation so you start with a good base.
Install the OpenStack client libraries. CentOS maintain a repo with the OpenStack RPMs.
Finally install the OpenStack client libraries
Now we are ready to start using the OpenStack CLI with the Cisco Metapod® environment.
Setting up the environment:
The OpenStack client libraries interact over REST APIs. A REST API uses the URI/URL format, just like when we interact with a webpage. A REST API is stateless. The interaction with a stateless service requires certain attributes to be sent with each interaction. In OpenStack CLI, these are parameters like the username, the tenant project and password. These parameters can be specified during the execution of each command or we can use environment variables for this.
With Cisco Metapod® we can either create a keystone resource file with the correct environment variables or we can download it form the Metapod dashboard.
To manually create the file (i.e. keystone_mpod) use the following example as reference:
To download the keystone resource file from the Metapod dashboard:
- Login to Metapod dashboard with your user and go to your tenant (in my case mpod_demo) > Project > Access & Security and click the API Access tab
- Click Download OpenStack RC File to download the corresponding resource file.
The Metapod resource file is a little more advance. Instead of sourcing it we have to execute it.
If it is not already executable, make sure it is executable.
Then execute the file.
This will prompt for your OpenStack tenant password. The file will be similar to the following image:
Using Cisco Metapod® with the OpenStack client libraries and CLI:
Source the keystone resource file to define the environment variables required for the OpenStack CLI access. The shell prompt will change.
The shell prompt will change. Now we are ready to start using the OpenStack CLI.
If using the Metapod RC file, you will be prompted for the password when executing it:
Now you may try some commands. For example, lets say we want a list of all the Instances (Virtual Machines) in the environment we can execute the following query:
Here are some other commands you may try:
Each project brings a set of commands and client libraries. Search for your favorite OpenStack project and the available commands at http://docs.openstack.org.