Skip to content

Commit

Permalink
Bugfixes and updates for GCE driver
Browse files Browse the repository at this point in the history
This updates a few things relating to bugs found during
initial testing and includes some features to minimize
the configuration of the driver.
  • Loading branch information
clintkitson committed Dec 4, 2015
1 parent 8f1cff0 commit ec5e6dd
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 196 deletions.
52 changes: 52 additions & 0 deletions .docs/user-guide/gce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#Google Compute Engine

The Google Cloud

---

## Overview
The GCE registers a storage driver named `gce` with the `REX-Ray`
driver manager and is used to connect and manage Google Compute Engine storage.

## Pre-Requisites
In order to leverage the GCE driver, REX-Ray must be located on the
running GCE instane that you wish to receive storage. There must also
be a `json key` file for the credentials that can be retrieved from the [API
portal](https://console.developers.google.com/apis/credentials).

## Configuration
The following is an example configuration of the GCE driver.

```yaml
gce:
keyfile: path_to_json_key
```

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 XtremIO driver please follow the instructions for
[activating storage drivers](/user-guide/config#activating-storage-drivers),
using `gce` as the driver name.

## Examples
Below is a full `rexray.yml` file that works with GCE.

```yaml
rexray:
storageDrivers:
- gce
gce:
keyfile: /certdir/cert.json
```

## Configurable items

https://cloud.google.com/compute/docs/reference/latest/diskTypes/list

## Limitations
- This driver does not currently support snapshot functionality.
- Debian 8.2 forced mounts via pre-emption results in Input/Output error until
remounted
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Irrespective of platform, `REX-Ray` provides common functionality for the follow
- OpenStack (Cinder)
- EMC ScaleIO
- EMC XtremIO
- Google Compute Engine (GCE)
- ..more coming

## Operating System Support
Expand All @@ -36,8 +37,8 @@ The following command will install the REX-Ray client-server tool. If using `Ce

```bash
$ export REXRAY_STORAGEDRIVERS=ec2
$ export AWS_ACCESS_KEY=access_key
$ export AWS_SECRET_KEY=secret_key
$ export AWS_ACCESSKEY=access_key
$ export AWS_SECRETKEY=secret_key
$ rexray volume get

- providername: ec2
Expand All @@ -53,8 +54,8 @@ Additionally, it can be ran as a service to support `Docker`, `Mesos`, and other

```bash
$ export REXRAY_STORAGEDRIVERS=ec2
$ export AWS_ACCESS_KEY=access_key
$ export AWS_SECRET_KEY=secret_key
$ export AWS_ACCESSKEY=access_key
$ export AWS_SECRETKEY=secret_key
$ rexray service start
Starting REX-Ray...SUCESS!

Expand Down
2 changes: 1 addition & 1 deletion core/drivers_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (r *sdm) GetVolumeMapping() ([]*BlockDevice, error) {
for _, driver := range r.drivers {
blockDevices, err := driver.GetVolumeMapping()
if err != nil {
return []*BlockDevice{}, errors.ErrDriverBlockDeviceDiscovery
return []*BlockDevice{}, err
}

if len(blockDevices) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion drivers/os/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (d *driver) Format(
if overwriteFs || !fsDetected {
switch newFsType {
case "ext4":
if err := exec.Command("mkfs.ext4", deviceName).Run(); err != nil {
if err := exec.Command("mkfs.ext4", "-F", deviceName).Run(); err != nil {
return fmt.Errorf(
"Problem creating filesystem on %s with error %s",
deviceName, err)
Expand Down

0 comments on commit ec5e6dd

Please sign in to comment.