2015-04-09

More and more people are interested in cloud computing and OpenStack but many of them give it up because they can’t test or interact with this kind of infrastructure. This is mostly a result of either high costs of hardware or the difficulty of the deployment in a particular environment.

In order to help the community to interact more with cloud computing and learn about it, Cloudbase Solutions has come up with a simple VirtualBox driver for OpenStack. VirtualBox allows you to set up a cloud environment on your personal laptop, no matter which operating system you’re using (Windows, Linux, OS X). It also gets the job done with a free and familiar virtualization environment.

Nova hypervisor Support Matrix

Feature

Status

VirtualBox

Attach block volume to instance

optional

Partially supported

Detach block volume from instance

optional

Partially supported

Evacuate instances from host

optional

Not supported

Guest instance status

mandatory

Supported

Guest host status

optional

Supported

Live migrate instance across hosts

optional

Not supported

Launch instance

mandatory

Supported

Stop instance CPUs

optional

Supported

Reboot instance

optional

Supported

Rescue instance

optional

Not supported

Resize instance

optional

Supported

Restore instance

optional

Supported

Service control

optional

Not supported

Set instance admin password

optional

Not supported

Save snapshot of instance disk

optional

Supported

Suspend instance

optional

Supported

Swap block volumes

optional

Not supported

Shutdown instance

mandatory

Supported

Resume instance CPUs

optional

Supported

Auto configure disk

optional

Not supported

Instance disk I/O limits

optional

Not supported

Config drive support

choice

Not supported

Inject files into disk image

optional

Not supported

Inject guest networking config

optional

Not supported

Remote desktop over RDP

choice

Supported

View serial console logs

choice

Not supported

Remote desktop over SPICE

choice

Not supported

Remote desktop over VNC

choice

Supported

Block storage support

optional

Supported

Block storage over fibre channel

optional

Not supported

Block storage over iSCSI

condition

Supported

CHAP authentication for iSCSI

optional

Supported

Image storage support

mandatory

Supported

Network firewall rules

optional

Not supported

Network routing

optional

Not supported

Network security groups

optional

Not supported

Flat networking

choice

Supported

VLAN networking

choice

Not supported

More information regarding this feature can be found on the following pages: Nova Support Matrix and Hypervisor Support Matrix.

VirtualBox supported features

Guest instance status

Provides a quick report on information about the guest instance, including the power state, memory allocation, CPU allocation, number of vCPUs and cumulative CPU execution time.



Guest host status

Provides a quick report of available resources on the host machine.



Launch instance

Creates a new instance (virtual machine) on the virtualization platform.



Shutdown instance

Stop instance CPUs

Stopping an instance CPUs can be thought of as roughly equivalent to suspend-to-RAM. The instance is still present in memory, but execution has stopped.

Resume instance CPUs

Suspend instance

Suspending an instance can be thought of as roughly equivalent to suspend-to-disk. The instance no longer consumes any RAM or CPUs, having its live running state preserved in a file on disk. It can later be restored, at which point it should continue execution where it left off.

Save snapshot of instance disk

The snapshot operation allows the current state of the instance root disk to be saved and uploaded back into the glance image repository. The instance can later be booted again using this saved image.

Block storage support

Block storage provides instances with direct attached virtual disks that can be used for persistent storage of data. As an alternative to direct attached disks, an instance may choose to use network based persistent storage.

Remote desktop over VNC

Note: In order to use this feature, the VNC extension pack for VirtualBox must be installed.

You can list all of the available extension packages running the following command:

Setting up DevStack environment

Create Virtual Machine

Processors:

Number of processors: 2

Number of cores per processor 1

Memory: 4GB RAM (Recommended)

HDD – SATA – 20 GB Preallocated

Network:

Network Adapter 1: NAT

Network Adapter 2: Host Only

Network Adapter 3: Nat

Operating system – Ubuntu Server 14.04 (Recommended)

Update System

Install openssh-server, git, vim, openvswitch-switch

Edit network Interfaces

Here’s an example for a configuration. You’re free to use your own settings.

Clone devstack

Change local.conf

Here we have a template config file. You can also use your own settings.

More information regarding local.conf can be found on Devstack configuration.

Edit ~/.bashrc

Add this lines at the end of file.

Disable Firewall

Run stack.sh

IMPORTANT: If the scripts don’t end properly or something else goes wrong, please unstack first using ./unstack.sh script.

Setup networks

Change current version of nova and neutron

For the moment the *Nova Driver* and *Neutron Agent* for *VirtualBox* are not included in the current version of OpenStack. In order to use them we must change the version of *nova* and *neutron* installed by DevStack.

Change the nova version used:

Change the neutron version used:

Change mechanism drivers:

Add vbox in the following line:

Port forwarding

In order to access the services provided by the virtual host with DevStack from within the host machine you have to forward the ports towards said host.

For each used port we need to run one of the following commands:

For example the required rules for a compute node can be the following:

More information regarding Openstack default ports can be found on Appendix A. Firewalls and default ports.

Setting up nova-compute

Clone nova

Install nova & requirements

Configuration

VirtualBox Nova Driver have the following custom config options:

Group

Config option

Default value

Short description

[virtualbox]

remote_display

False

Enable or disable the VRDE Server.

[virtualbox]

retry_count

3

The number of times to retry to execute command.

[virtualbox]

retry_interval

1

Interval between execute attempts, in seconds.

[virtualbox]

vboxmanage_cmd

VBoxManage

Path of VBoxManage.

[virtualbox]

vrde_unique_port

False

Whether to use an unique port for each instance.

[virtualbox]

vrde_module

Oracle VM VirtualBox Extension Pack

The module used by VRDE Server.

[virtualbox]

vrde_port

3389

A port or a range of ports the VRDE server can bind to.

[virtualbox]

vrde_require_instance_uuid_as_password

False

Use the instance uuid as password for the VRDE server.

[virtualbox]

vrde_password_length

None

VRDE maximum length for password.

[virtualbox]

wait_soft_reboot_seconds

60

Number of seconds to wait for instance to shut down after soft reboot request is made.

[rdp]

encrypted_rdp

False

Enable or disable the rdp encryption.

[rdp]

security_method

RDP

The security method used for encryption. (RDP, TLS, Negotiate).

[rdp]

server_certificate

None

The Server Certificate.

[rdp]

server_private_key

None

The Server Private Key.

[rdp]

server_ca

None

The Certificate Authority (CA) Certificate.

The following config file is an example of nova_compute.conf. You can use your own settings.

More information regarding compute node configuration can be find on the following pages: List of compute config options and Nova compute.

Start up nova-compute

Setting up the VirtualBox Neutron Agent

Clone neutron

Install neutron & requirements

Create neutron-agent.conf

VirtualBox Neutron Agent have the following custom config options:

Group

Config option

Default value

Short description

[virtualbox]

retry_count

3

The number of times to retry to execute command.

[virtualbox]

retry_interval

1

Interval between execute attempts, in seconds.

[virtualbox]

vboxmanage_cmd

VBoxManage

Path of VBoxManage.

[virtualbox]

nic_type

82540EM

The network hardware which VirtualBox presents to the guest.

[virtualbox]

use_local_network

False

Use host-only network instead of bridge.

Here is a config file as an example for neutron_agent.conf. Feel free to use your own settings.

Start up the VirtualBox agent

Proof of concept

The post VirtualBox driver for OpenStack appeared first on Cloudbase Solutions.

Show more