Taking an OpenStack test-drive
2.4 Accessing your first private cloud server
We’ve reached the moment you’ve been waiting for—it’s time to log into that VM. You can do that through the Instance Console.
To access the Instance Console, click the Instances link on the Management toolbar, shown previously in figure 2.5. On the Instances screen, click the name of the instance you’re interested in, and you’ll be taken to the Instance Detail screen. Now choose the Console tab, and you should see a console like the one shown in figure 2.18.
Assuming you used the cirros image provided by DevStack to create your instance, you should be able to log in using the “cirros” user and the password “cubswin:”.
Now that you can access your instance from the console, what about connecting to your host over the network? The Instances screen says the IP address is 10.0.0.4, but you can’t SSH or even ping the server, so what gives? If you’ve worked with other virtu- alization platforms, the network was likely flat. In this context, flat refers to the net- work topology where your VM connects directly to a network when a virtual interface is added. You can configure OpenStack to behave in this way, but as you’ll learn throughout this book, OpenStack networking can do much more.
For now, it’s sufficient to understand that the instance address 10.0.0.4 refers to the internal OpenStack IP address of the instance. This means that if you create another instance on this internal network, the two instances can communicate using the internal address. External network access is covered next.
Figure 2.18 Instance Console
NAT translation
If you want to be able to communicate from your new VM to outside of your OpenStack network, you can translate requests from your VM to an outside network using the following command:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
After issuing this command, internet communications such as ping 8.8.8.8 should work, assuming your OpenStack node already has connectivity.
2.4.1 Assigning a floating IP to an instance
The final demonstration in this chapter shows how you can assign a floating IP to an instance. In simplistic terms, you can think of a floating IP as an external (to Open- Stack) network representation of an instance. As explained in the previous section, the instance address is for communication inside an OpenStack network. If you want to communicate with the instance from networks outside OpenStack, you typically assign a floating IP. The floating IP will be the external network representation of your instance.
To assign a floating IP, go to the Instances screen, click on the More button associ- ated with your instance, and select Associate Floating IP. The Manage Floating IP Asso- ciations pop-up window will appear, as shown in figure 2.19.
You’ll want to select an address from the IP Address drop-down menu. If you see No IP
addresses available in the drop-down, click on the + button and Allocate a new IP from the Public Pool. Once you’ve selected an address from the IP Address drop-down menu, click Associate, and your instance will be assigned a floating IP.
In the example shown in figure 2.19, I assigned the floating IP 192.168.1.4 to the instance with the existing IP 10.0.0.1. If you access the instance using the console, you won’t see any changes, because the operating environment of the instance is unaware of the floating IP provided by OpenStack Networking. This can be confusing, but just keep in mind that there’s a one-to-one relationship between the existing and floating IPs.
2.4.2 Permitting network traffic to your floating IP
There’s one final step you must take to make your instance with its new floating IP accessible to the local network on your OpenStack server (so you can SSH into it). You must configure the default security group (or whatever group you applied to your instance) to allow network traffic to access your instance.
To do this, go to the Access & Security screen, previously shown in figure 2.6. Click Manage Rules. Then click Add Rule. From the Rule dropdown, select SSH and click Add. You should now be able to SSH into your instance using your assigned floating IP.
2.5
Summary
OpenStack is a distributed cloud framework, but all components can be installed on a single server.
DevStack is a collection of scripts that can be used to deploy a development instance of OpenStack on one or more servers.
Component deployment through DevStack is controlled by a central configura- tion file.
DevStack exercises or OpenStack Tempest can be used to test a DevStack deployment.
OpenStack can be accessed from a web-based dashboard, a command-line interface, or web-based RESTful APIs.
OpenStack instances are deployed based on volume, network, and security group specifications.
55