Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gce driver #194

Merged
merged 2 commits into from
Dec 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions .docs/user-guide/gce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#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
The following items are configurable specific to this driver.
- [volumeTypes](https://cloud.google.com/compute/docs/reference/latest/diskTypes/list)

## Limitations
- 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