Mindmajix

Creating an OpenStack Object Storage sandbox environment

Introduction

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.

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.

Getting started

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

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.
  1. We are now editing the Vagrant file we have been working with,thus making it look like the following:
  • -*- mode: ruby -*-
  • VI: set ft=ruby :
nodes = { => [1, 200],
‘controller’
‘compute’ => [1, 201],
‘swift’ => [1, 210],
}

Vagrant.configure(“2”) do |config| config.vm.box = “precise64” config.vm.box_url =

“http://files.vagrantup.com/precise64.box”

# If using Fusion uncomment the following line #config.vm.box_url =

“http://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

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

Note:

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.

TryStack.org – A Sandbox for OpenStack!

0 Responses on Creating an OpenStack Object Storage sandbox environment"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.