In the previous chapter, we prepared to launch an instance by importing disk images into Glance. The next preparation required for launching an instance is to create a virtual network for the instance to use. Neutron is the network management component in OpenStack. In this chapter, we'll look at how to create virtual networks and routers for the OpenStack instances to use. We will also look at some of the underlying plumbing that is used to support the virtual networks.
You're reading from OpenStack Essentials. - Second Edition
As I was learning Neutron networking and started to present my experiences to audiences, I coined a phrase that I continue to stand by: Networking is hard. Networking is the most complex component in OpenStack and for good reason. This is because networking is a complex part of computing. It takes time and hard work to understand networking. It is often left to the network administrators and neglected by others. Hats off to you network administrators. I spent 7 years of my professional career avoiding learning some of the core concepts of networking and leaving it to the folks that did networking. OpenStack is where it caught up with me and bowled me over. To administer an OpenStack cloud that uses Neutron networking, you have to understand some of the core concepts used in networking. As we work through the rest of this book, I will make sure to explain these concepts as we come across them so that if you're not a networking guru, you will hopefully come out on the...
By default, the RDO installation you ran back in Chapter 1, RDO Installation, installed Open vSwitch (OVS), and configured the Neutron Open vSwitch plugin for you. Open vSwitch is virtual networking software that allows you to create virtual switches on your nodes and ties the virtual switches on your nodes together by way of a configured transport. A configured transport is a defined method for the virtual switches to talk to each other. As traffic comes out of an instance, it travels through these connections between each of the virtual switches. There are three common methods for configuring OVS, which are explained here.
Virtual Local Area Network (VLAN) is the most complex to set up. This is because the hardware switch that carries your traffic must be configured properly to carry the VLAN tagging that is assigned to the traffic. When the network traffic is traveling through one of the virtual networks, it is assigned a VLAN tag, which is basically a...
Now that we've explored some of the intricacies of what's happening under the hood, let's actually use Neutron to create a network by performing the following steps:
Log in to your control node and source your
overcloudrc
file; use the non-administrative user for this. The command to create a virtual network is as follows:undercloud# openstack network create internal undercloud# neutron subnet-create internal 192.168.37.0/24
That is it. You just created a virtual network. I know that for the length of the introduction we just covered, that was pretty anticlimactic. Note that when you create the subnet, you are adding it to the network named
internal
that you just created. It is important to note the difference in the two commands. The first uses the command structure that has been used thus far. The second one calls a command named after the component being configured, Neutron. OpenStack has been going through a slow transition from having a command-line client for each...
The web interface lets you create the network and subnet in the same dialog. Perform the following steps to obtain a network and a router:
Log in as your non-administrative user, select the Network menu, select the Networks submenu, and click on the Create Network button in the top-right corner, as shown here:
After you have filled in the network name, go to the next dialog screen and fill in the subnet information, as shown in the following screenshot:
In the final dialog box, add the DNS entries, as shown in the following screenshot:
When you've completed filling in the dialog, you'll end up with a network and a subnet that's associated with the network, as shown in the following screenshot:
Next, create the router. Select Routers from the Network menu, and click on Create Router in the top-right corner of the page, as shown in the following screenshot:
Once you've filled in the router name, click on Create Router, as shown in the following screenshot:
Next, click on...
Every project will have at least one network to launch instances on, which will be built as we have just built a network. Whenever a new project is created, the steps that have just been performed will need to be performed for that new project. All projects will share a network that provides external access to the outside world. Let's work through creating this external network.
Earlier, we discussed how Neutron is an API layer that manages virtual networking resources. The preparation for external network access will be different for different Neutron plugins. Talk to your networking vendor for your specific implementation. In general, what is being accomplished by this preparation is the connection of the networking node to a set of externally routable IP addresses. External just means external to, or outside of, the OpenStack cluster. These may be a pool within your company's 10.0.0.0/8
network or a pool of IPs public to the Internet. The project...
Creating the external network can be completed through the web interface by performing the following steps:
Start by logging in to the web interface as the Admin user to create the external network and subnet. Select the Networks submenu from the Admin menu and click on Create Network. Give the network a name, flag it as external and make sure that it is assigned to the service project. The default provider type configured by Triple-O is VXLAN. On the command line, this was taken care of for you; here, select VXLAN for the Provider Network Type and set the Segmentation ID to
1
. This step is encapsulated in the following screenshot:Once you have created the network, select the network by its name from the list, as shown in the following screenshot, and click on Create Subnet:
Fill out the form with the network information for the external pool of IP addresses. Make sure the correct gateway is specified. The following screenshot captures this step:
Move to...
In this chapter, we looked at creating networks, subnets, and routers, and looked through the OpenVSwitch configuration used for this to work. Using these resources, the necessary virtual networking fabric has been created for an instance to be launched on. Now that we have created virtual networks for the instances to attach to, let's get into launching instances. In the next chapter, we will do what we have been working towards – launch an instance. We will use Nova to launch an instance from the image that was imported and attach it to these virtual networking resources.