Skip to content

Commit

Permalink
Merge pull request #209 from clintonskitson/feature/virtualbox_driver
Browse files Browse the repository at this point in the history
Added VirtualBox driver
  • Loading branch information
akutz committed Dec 14, 2015
2 parents af90ccb + 26e5625 commit d480103
Show file tree
Hide file tree
Showing 7 changed files with 766 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .docs/user-guide/virtualbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#Virtual Box

Just for your laptop.

---

## Overview
The VirtualBox driver registers a storage driver named `virtualbox` with the
`REX-Ray` driver manager and is used by VirtualBox VM's to to connect and
manage volumes provided by Virtual Box.

## Pre-Requisites
In order to leverage the `virtualbox` driver, REX-Ray must be located on each
VM that you wish to be able to consume external volumes. The driver
leverages the `vboxwebserv` HTTP SOAP API which is a process that must be
started from the VirtualBox *host* (ie OS X) using `vboxwebsrv -H 0.0.0.0 -v` or
additionally with `-b` for running in the background. This allows the VMs
running `REX-Ray` to remotely make calls to the underlying VirtualBox
application. A test for connectivity can be done with
`telnet virtualboxip 18083` from the VM. The `virtualboxip` is what you
would put in the `endpoint` value.

It is optional to leverage authentication. The HTTP SOAP API can have
authentication disabled by running
`VBoxManage setproperty websrvauthlibrary null`.

Hot-Plugging is required, which limits the usefulness of this driver to `SATA`
only. Ensure that your VM has *pre-created* this controller and it is
named `SATA`. Otherwise the `controllerName` field must be populated
with the name of the controller you wish to use.


## Configuration
The following is an example configuration of the VirtualBox driver.
The `localMachineNameOrId` parameter is for development use where you force
REX-Ray to use a specific VM identity. Choose a `volumePath` to store the
volume files or virtual disks. This path should be created ahead of time.


```yaml
virtualbox:
endpoint: http://virtualboxhost:18083
userName: optional
password: optional
tls: false
volumePath: /Users/your_user/VirtualBox Volumes
controllerName: name
localMachineNameOrId: forDevelopmentUse
```

For information on the equivalent environment variable and CLI flag names
please see the section on how non top-level configuration properties are
[transformed](./config/#all-other-properties).

## Activating the Driver
To activate the VirtualBox driver please follow the instructions for
[activating storage drivers](/user-guide/config#activating-storage-drivers),
using `virtualbox` as the driver name.

## Examples
Below is a working `rexray.yml` file that works with VirtualBox.

```yaml
rexray:
storageDrivers:
- virtualbox
virtualbox:
endpoint: http://virtualBoxIP:18083
volumePath: /Users/your_user/VirtualBox Volumes
```

## Caveats
- This driver was developed against Ubuntu 14.04.3 but should work with
others.
- Snapshot and create volume from volume functionality is not available
since VirtualBox does not support volume snapshots directly.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Irrespective of platform, `REX-Ray` provides common functionality for the follow
- EMC VMAX
- EMC XtremIO
- Google Compute Engine (GCE)
- VirtualBox
- ..more coming

## Operating System Support
Expand Down
4 changes: 4 additions & 0 deletions drivers/os/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func (d *driver) Mount(
return nil
}

if err := d.Unmount(target); err != nil {
return err
}

fsType, err := probeFsType(device)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions drivers/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
_ "github.com/emccode/rexray/drivers/storage/openstack"
_ "github.com/emccode/rexray/drivers/storage/rackspace"
_ "github.com/emccode/rexray/drivers/storage/scaleio"
_ "github.com/emccode/rexray/drivers/storage/virtualbox"
_ "github.com/emccode/rexray/drivers/storage/vmax"
_ "github.com/emccode/rexray/drivers/storage/xtremio"
)

0 comments on commit d480103

Please sign in to comment.