Skytap recently published an OpenStack (DevStack) environment template in the Skytap Public Template Library. DevStack is a mechanism to provide tools for the installation of OpenStack services suitable for development and operational testing as well as to demonstrate examples of configuring and running services as well as command line client usage. You can read more about Devstack at this URL:
In this blog post we’ll explore how to use a DevStack environment in Skytap to explore how to launch and interact with a Virtual Machine (VM) in an OpenStack environment.
Create and Run a DevStack Environment in Skytap
The first step in our DevStack exploration process is to create and run a DevStack environment. To do this, locate the DevStack template in the Public Template Library and deploy the template that resides in the appropriate Skytap region:
Once the DevStack environment has been created from the template you selected, you can run it:
Once the Skytap DevStack environment is running, open a SmartClient desktop on your newly created and running DevStack VM and log in as user “stack”:
Start the DevStack Processes
When the logon process is complete, open a Terminal window on your desktop:
And run the “devstack/rejoin_stack.sh” script to start the DevStack processes required for the DevStack environment to function properly:
Running the “rejoin-stack.sh” script will result in a lot of diagnostic output:
When the output finally pauses, you can close or minimize the window, or you can log out altogether and log in as a different user.
Log into the DevStack Dashboard and Configure Access and Security
To log into the DevStack Dashboard, double-click on the “Login – OpenStack Dashboard” icon on your desktop:
Next, log into the DevStack Dashboard using the login credentials “admin” / “password”:
When you are successfully logged into the DevStack Dashboard, you will see the “Overview” screen:
From here you can do some exploration to become familiar with the DevStack Dashboard and Administration panels.
Configure Access and Security: Security Group
For our blog exercise today, we are going to launch a VM within DevStack and interact with it. Prior to launching a DevStack VM, however, we must first configure the Access and Security settings that will be used by the VM.
Navigate to the Project->Access & Security panel on the dashboard, select the “Security Groups” tab and click on the “Manage Rules” button associated with the “Default” Security Group:
When the Rule Management screen appears, click the “Add Rule” button:
When the Add Rule dialog appears, pull down the “Custom TCP Rule” menu and select “SSH”. This will allow VM’s associated with the Default access group to accept incoming SSH requests:
Configure the SSH rule to accept incoming SSH requests from the IP Address Block (CIDR) that corresponds to your Skytap DevStack environment network settings. Here are the network settings for the Skytap DevStack environment we are using for this blog:
In this case the CIDR for the SSH rule should be set to 10.0.0.0/24. Set the value and click the “Add” button:
You should now see the rule you just configured in the Rules Management screen for the default security group:
Configure Access and Security: Create a Secure Key Pair
Now navigate to the Key Pairs tab in the Access & Security Panel and click “Create Key Pair”. We will create a secure public and private key pair to use with SSH:
When the “Create Key Pair” dialog appears, enter a name for the Key Pair to be created, in this case “blog-key”, and click the “Create Key Pair” button:
The Key Pair will be created and the public key will be downloaded to your “Downloads” directory:
Open a terminal window and restrict access to the downloaded public key:
Launch an Instance of a Virtual Machine
Now that we have configured a security group and a created a key-pair, we can launch an instance of a Virtual Machine. To do this, navigate to the Project->Images panel and click the “Launch” button associated with the “Fedora-x86_64-20-20140618-sda” image:
When the “Launch Instance” dialog appears, provide a name for the instance, in this case “blog-vm”, and select “m1.small” as the flavor:
Now click on the “Access & Security” tab and make sure that “blog-key” is the specified Key Pair that will be used and that the Security Group is “default”. When you have confirmed the values, click the “Launch” button:
As the VM lauches, you will see the following entry in the Project->Instances panel indicating a Status of “Build” and the Task as “Spawning”:
Note that the Virtual Machine has been assigned the name of “blog-vm” and it’s assigned IP Address is 10.0.0.226.
Eventually the Status will change to “Active” and the Task will change to “None”:
Even though the Status is “Active” it will be a few minutes before the processes in the VM are fully started and capable of responding to input.
Connect to the VM We Just Launched and Interact with It
After a few minutes have passed, we can connect to the Virtual Machine we just launched. To do this, open a terminal window and issue the “ssh –i blog-key.pem firstname.lastname@example.org”. Recall that 10.0.0.226 is the IP Address assigned to the VM.
Once the connection is made, we see a “fedora@blog-vm” prompt indicating that we have a command line interface with our fedora VM. In the following screenshot we see the results of the “whoami”, “hostname” and “pwd” commands:
We have launched an OpenStack (DevStack) environment in Skytap and started the DevStack processes. We then configured the default Security Group to allow SSH access to Virtual Machines and we created a secure Key Pair to use with SSH to access Virtual Machines. We then launched a VM within the DevStack environment using the default Security Group and the Key Pair we created and then used SSH to access and interact with the Virtual Machine we launched after it was fully booted.
The principles demonstrated in this exercise can easily be expanded further into even more complex scenarios to allow expanded interaction and use of DevStack environments in Skytap.
Please contact Skytap (1-888-759-8278 or http://www.skytap.com ) for more information.