Home  >  Blog  >   OpenStack  > 

Creating a sandbox Network server for Neutron with VirtualBox and Vagrant – OpenStack

Vagrant may be installed using Ubuntu's package manager. To define another virtual machine as a sandbox server for hosting OpenStack Network within VirtualBox, we will utilize Vagrant. This article will guide you through the process of constructing a sandbox Neutron network server using VirtualBox and Vagrant.

Rating: 4
  1. Share:
OpenStack Articles


Creating a sandbox server for running the OpenStack Network  Neutron services is easy using VirtualBox and Vagrant. VirtualBox gives us the ability to spin up virtual machines and networks without affecting the rest of our working environment and is freely available for Windows, Mac OSX, and Linux. Vagrant allows us to automate this task, meaning we can spend less time creating our test environments and more time using OpenStack.

Creating a sandbox Network server for Neutron

Tip to VirtualBox Vagrant

A Vagrant is installable using Ubuntu’s package management. This test environment can then be used for the rest of this section.

It is assumed that the computer you will be using to run your test environment, has enough processing power that has hardware virtualization support (for example, Intel VT-X and AMD-V support) with at least 8 GB RAM. Our nested virtual machines will require virtual RAM, so more physical RAM will help our virtual machines run much better.

If you would like to Enrich your career with an OpenStack certified professional, then visit Mindmajix - A Global online training platform: “Openstack Course Training”  Course.  This course will help you to achieve excellence in this domain.

Getting ready sandbox network server neutron VirtualBox vagrant

To begin with, ensure that VirtualBox and Vagrant are installed and networking set up as described in Creating a Sandbox Environment With Virtual And Vagrant recipe of Keystone OpenStack Identity Service:

How to achieve sandbox network server neutron VirtualBox vagrant

To create our sandbox server for running OpenStack Network within VirtualBox we will use Vagrant to define another virtual machine that allows us to run Open vSwitch and supporting Neutron services. This virtual machine, which we will refer to as the OpenStack Network node, will be configured with at least 1 GB RAM, 1 CPU, and 20 GB of hard drive space and have four network interfaces.

The first will be a NAT interface that allows our virtual machine to connect to the network outside of VirtualBox to download packages. The second interface will be the Management interface of our OpenStack Network host, the third interface will be for our Data network that Neutron uses for transit of data for the software-defined networking, and the fourth interface will be used for routing outside of our virtual environment.

[ Related Page: OpenStack Dashboard Installing ]

Carry out the following steps to create the virtual machine with Vagrant that will be used to run Open vSwitch and Neutron services:

  • Edit the file named Vagrantfile created in Creating a sandbox environment with VirtualBox and Vagrant recipe of Keystone OpenStack Identity Service and add the following section between the final two end blocks:
# compute VM
config.vm.define ;network do |network_config|
Every Vagrant virtual environment requires
a box to build off of.
network_config.vm.box ="precise64"
network_config.vm.network :hostonly, "", :netmask => ""
network_config.vm.network :hostonly, "", :netmask => ""
network_config.vm.network :hostonly, "", :netmask => ""
# Customise the VM virtual hardware network_config.vm.customize["modifyvm", :id,"--memory, 1024"]
network_config.vm.cutomize["modifyvm", :id, "--cpus", 1] end
  • We are now ready to power on our network node. We do this by simply running the following command:

[ Related Article: Interview Questions on Openstack ]

vagrant up network

Note: Congratulations! We have successfully created the VirtualBox virtual machine running Ubuntu 12.04, which is able to run OpenStack Network.

[ Related Article: How to Configure Ubuntu Cloud Archive ]

How to sandbox network server neutron VirtualBox vagrant works

What we have done is created a virtual machine within VirtualBox by defining it in Vagrant. Vagrant then configures this virtual machine, based on the settings given in the Vagrantfile configuration file in the directory, which will store and run our VirtualBox VMs. This file is based on Ruby syntax, but the lines are relatively self-explanatory. We have specified the following:

  • The hostname is called “network”
  • The VM is based on Precise64, an alias for Ubuntu 12.04 LTS 64-Bit We have specified 1Gb Ram and 1 CPU
  • eth0 is used for NAT and exists in all our Vagrant spun up instances
  • eth1 is a host-only network address and used for the Management of our
  • node eth2 is for inter-communication of network traffic
  • eth3 is used to route to the outside of our environment (in a physical environment, this is used to connect to an external, routable network). Note that in our Vagrant environment here, we assigned an IP address to this node. The next section removes this, as it’s a requirement for external router networks to not assign an IP, but Vagrant requires it.

[ Related Page: Managing Images with OpenStack ]

We then launch this VirtualBox VM using Vagrant using the following simple command:

vagrant up network

There’s more…

There are a number of virtualization products available that are suitable for trying OpenStack, for example, VMware Server, VMware Player, and VMware Fusion are equally suitable.

Join our newsletter

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
OpenStack TrainingApr 01 to Apr 16
OpenStack TrainingApr 04 to Apr 19
OpenStack TrainingApr 08 to Apr 23
OpenStack TrainingApr 11 to Apr 26
Last updated: 31 March 2023
About Author
Remy Sharp
Ravindra Savaram

Ravindra Savaram is a Content Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

Recommended Courses

1 /15