Hurry! 20% Off Ends SoonRegister Now

Creating an OpenStack Object Storage sandbox environment

With OpenStack Object Storage, sometimes referred to as Swift, you can use commodity hardware to store a vast amount of data in a highly redundant fashion. OpenStack manages this service in a manner comparable to Amazon's S3 storage service. In this post, we will create a single virtual machine that will replicate a multi-node OpenStack Object Storage testing environment.

Introduction to OpenStack Object Storage

OpenStack Object Storage, also known as Swift, is the service that allows massively scalable and highly redundant storage on commodity hardware. This service is analogous to Amazon’s S3 storage service and is managed in a similar way under OpenStack. With OpenStack Storage, we can store many objects of virtually unlimited size—restricted by the available hardware—and grow our environment as needed, to accommodate our storage. The highly redundant nature of OpenStack Object Storage is ideal for archiving data (such as logs) as well as providing a storage system that OpenStack Compute can use for virtual machine instance templates.

In this chapter, we will set up a single virtual machine that will represent a multi-node test environment for OpenStack Object Storage. Although we are operating on a single host, the steps involve mimic a four-device setup, so we see a lot of duplication and replication of our configuration files.

 
Enthusiastic about exploring the skill set of OpenStack? Then, have a look at the OpenStack TRAINING together additional knowledge. 
 

Creating a sandbox environment using VirtualBox and Vagrant allows us to discover and experiment with the Open Stack Compute service. 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 in creating our test environments and more time in using OpenStack. A vagrant is installable using Ubuntu’s package management.  This test environment can then be used for the rest of this chapter.

It is assumed that the computer you will be using to run your test environment has enough processing power, with hardware virtualization support (modern AMDs and Intel IX processors) and at least 8 GB of RAM. The virtual machine we will be creating will have all components installed to get you familiar with the OpenStack Object Storage services.

In this section, we will use Vagrant to create an additional virtual machine. This new virtual machine will mimic a four node Open Stack Object Storage environment. To provide identity services, we will use the existing keystone installation as built in Chapter 1, Keystone OpenStack Identity Service.

How to Start

Before beginning this section we assume that you have all completed horecipes from Chapter 1, Keystone OpenStack Identity Service.

MindMajix Youtube Channel

How to Achieve it…

To create our sandbox environment within VirtualBox we will use Vagrant to define an additional virtual machine with three 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, a second interface which will be the Public interface of our OpenStack Compute host, and the third interface will be for our Private network that OpenStack Compute uses for internal communication between different OpenStack Compute hosts. This swift virtual machine will be configured with at least 1 GB RAM, and two 20 GB hard disks.

Carry out the following simple steps to create the virtual machine with Vagrant that will be used to run OpenStack Storage services:

1. Execute the steps mentioned in the Creating a sandbox environment with VirtualBox recipe of Chapter 1, Keystone OpenStack Identity Service.

2. We are now editing the Vagrant file we have been working with,thus making it look like the following:
Editing the Vagrant file

Vagrant.configure(“2”) do |config| config.vm.box = “precise64” config.vm.box_url =
“https://files.vagrantup.com/precise64.box”
# If using Fusion uncomment the following line #config.vm.box_url =
“https://files.vagrantup.com/precise64_vmware.box”
nodes.each do |prefix, (count, ip_start)| count.times do |i|
hostname = “%s” % [prefix, (i+1)]
config.vm.define “#{hostname}” do |box| box.vm.hostname = “#{hostname}.book” box.vm.network :private_network, IP: “172.16.0.#
{ip_start+i}”, :netmask => “255.255.0.0”
box.vm.network :private_network, IP: “10.10.0.# {ip_start+i}”, :netmask => “255.255.0.0”
# If using Fusion
box.vm.provider :vmware_fusion do |v| v.vmx[“memsize”] = 1024
end
# Otherwise using VirtualBox box.vm.provider :virtualbox do |vbox|
vbox.customize [“modifyvm”, :id, “–memory”, 1024]
if prefix == “swift”
vbox.customize [“modifyvm”, :id, “–memory”, 1024] vbox.customize [“modifyvm”,
:id, “–cpus”, 1] vbox.customize [“createhd”,
“–filename”, ‘swift_disk2.vdi’, “–size”, 2000 * 1024]
vbox.customize [‘storageattach’, :id, ‘–storagectl’,
‘SATA Controller’, ‘–port’, 1, ‘–device’, 0, ‘–type’, ‘hdd’,
‘–medium’, ‘swift_disk2.vdi’]
end
end
end
end
end
end

 

3. We are now ready to power on both nodes in this configuration by issuing the following command:

Vagrant Up

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

How it Works

What we have done is created a virtual machine that will be the basis of our OpenStack Storage host. It has the necessary disk space and networking in place to allow you to access this virtual machine from your host personal computer and any other virtual machines in our OpenStack sandbox environment.

Still More

You’ll notice the preceding Vagrant file example, we have provided for a VMware Fusion configuration. Additionally, there are other virtualization products that can work outside of the Vagrant environment.

Frequently asked Openstack Interview Questions

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
OpenStack TrainingDec 24 to Jan 08View Details
OpenStack TrainingDec 28 to Jan 12View Details
OpenStack TrainingDec 31 to Jan 15View Details
OpenStack TrainingJan 04 to Jan 19View Details
Last updated: 03 Apr 2023
About Author

Ravindra Savaram is a Technical 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.

read less
  1. Share:
OpenStack Articles