In my earlier blog1 and blog2 i explained how to install and manage openstack and also how to restart openstack service. Now that we have the install/manage out of the way, lets try to use the install to provision instances using the openstack user interface(UI). Open stack comes with a default image called cirros which is a small footprint linux image. I went ahead and imported fedora image as well to have a better and bigger represented image.
I will demonstrate how to provision a fedora based image virtual machine, assign a floating point ip to it and ssh to it from the public internet.
After logging into openstack i end up here as shown in figure 1 in the overview tab, let me visit the Images section to see whats available out of the box
Now click on Images & Snapshots from the left navigation pane, this will lead to a screen as shown in figure 2 and I can see the cirros default cloud image. This is a good starter image, however i plan to provision using fedora, the next steps will show how to add a image to openstack.
Click the create Image button as shown on the extreme right of figure 2 . This will popup a window as shown in figure 3 to enter details of the image to be imported.
I have entered all fedora image details, image location, format, public or private setting and the name of the image. Final step is to click on Create Image which will import the image into openstack and list it under the public images tab along with the cirros image as shown in figure 4.
Now the fun part begins, I am ready to create a few guest virtual machines. Click the launch button against the Fedora19 image as shown on the extreme right of figure 4. This will launch a popup , enter all the fields as shown in Figure 5. Make sure the Flavor option matches the size for the image, example if i were to instantiate a cirros image it would have been tiny option, but for fedora I picked small. I am not done yet, need to configure ssh so as to login after the instance is provisioned.
Click on the Access & Security tab and configure the public/private key as shown in figure 6. The instructions are self explanatory and no different than any ssh configuration
After successfully importing the keypair, click the launch button shown in figure 5, now the process begins to create a guest virtual machine . This will lead to figure 7
Figure 7 shows the new instance being created, please note even if the instance shows success, we have to wait until the status turns to running. Also notice the two ip addresses, one is the private ip, the management node can access the instance through this ip. The second is the public ip and we can ssh to this from the internet with the private key. I was able to associate the floating ip to the instance by clicking the associate ip from the more menu as shown in figure 8.
The floating ip was picked from the ip pool configured during the install of openstack, refer to earlier blog , Please take a moment to look at what is offered on the instance menu, one could associate ip as we did before, disassocaite ip, get console access to the instance through vnc, view startup logs, terminate instance etc.
Now i am left with the last step which is to confirm instance is healthy, responding to pings and i am able to ssh. If for some reason its not possible to ping, please check the security rules, the ping and ssh ports need to be opened as shown in figure 9
Here i have the rule to allow the instances to be pinged and also ssh. Now using any ssh client of choice, have the ssh private key handy and ssh to the instance, the user name is fedora. In this example i used putty(converted the private key generated in figure 6 to putty format using puttygen) to ssh into the instance. as shown in figure 10
With this i can confirm the instance is fine and i am able to ssh to it.
Conclusion: In this blog i was able to show how easy it is to create a instance and use openstack as cloud virtual machine orchestrator. This is a great tool for any developer who is working on openstack and wants to be able to debug his code, be it testing integration with openstack rest api or installation defects amd many more.