Skip to content

Commit

Permalink
Merge abd8ef6 into 64d4c7e
Browse files Browse the repository at this point in the history
  • Loading branch information
clintkitson committed Dec 8, 2015
2 parents 64d4c7e + abd8ef6 commit 11cd664
Show file tree
Hide file tree
Showing 9 changed files with 518 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .docs/user-guide/isilon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#Isilon

Scale-Out NAS is my fame.

---

## Overview
The Isilon driver registers a storage driver named `isilon` with the `REX-Ray`
driver manager and is used to connect and manage Isilon NAS storage.

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

```yaml
isilon:
endpoint: https://endpoint:8080
insecure: true
username: username
password: password
volumePath: /rexray
nfsHost: nfsHost
```

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).

## Extra Paramters
The following items are configurable specific to this driver.

- `volumePath` represents the location under `/ifs/volumes` to allow volumes to be created and removed.
- `nfsHost` is the configurable host used when mounting exports

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

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

```yaml
rexray:
storageDrivers:
- isilon
isilon:
endpoint: https://endpoint:8080
insecure: true
username: username
password: password
volumePath: /rexray
nfsHost: nfsHost
```

## Instructions
It is expected that the `volumePath` exists already within the Isilon system. This would reflect a directory create under `/ifs/volumes/rexray`. It is not necessary to export this volume.

## Caveats

- This driver currently ignores the `--size` and `--volumeType` flags.
- This driver does not support pre-emption currently. Requests from alternate hosts can have bad results.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It is available as a standalone process today and in the future (0.3) as a distr
Irrespective of platform, `REX-Ray` provides common functionality for the following.
- AWS EC2 (EBS)
- OpenStack (Cinder)
- EMC Isilon
- EMC ScaleIO
- EMC XtremIO
- Google Compute Engine (GCE)
Expand Down
9 changes: 9 additions & 0 deletions core/drivers_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package core

import (
"bytes"
"strings"

log "github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/mount"
Expand Down Expand Up @@ -131,6 +132,10 @@ func (r *odm) Mount(
return errors.ErrNoOSDetected
}

func (r *odm) isNfsDevice(device string) bool {
return strings.Contains(device, ":")
}

func (r *odm) Format(
deviceName, fsType string, overwriteFs bool) error {
for _, d := range r.drivers {
Expand All @@ -140,6 +145,10 @@ func (r *odm) Format(
"overwriteFs": overwriteFs,
"driverName": d.Name()}).Info(
"formatting if blank or overwriteFs specified")
if r.isNfsDevice(deviceName) {
return nil
}

return d.Format(deviceName, fsType, overwriteFs)
}
return errors.ErrNoOSDetected
Expand Down
22 changes: 22 additions & 0 deletions drivers/os/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"runtime"
"strings"

log "github.com/Sirupsen/logrus"
"github.com/akutz/goof"
Expand Down Expand Up @@ -75,9 +76,30 @@ func (d *driver) Unmount(mountPoint string) error {
return mount.Unmount(mountPoint)
}

func (d *driver) isNfsDevice(device string) bool {
return strings.Contains(device, ":")
}

func (d *driver) nfsMount(device, target string) error {
command := exec.Command("mount", device, target)
output, err := command.CombinedOutput()
if err != nil {
return goof.WithError(fmt.Sprintf("failed mounting: %s", output), err)
}

return nil
}

func (d *driver) Mount(
device, target, mountOptions, mountLabel string) error {

if d.isNfsDevice(device) {
if err := d.nfsMount(device, target); err != nil {
return err
}
return nil
}

fsType, err := probeFsType(device)
if err != nil {
return err
Expand Down

0 comments on commit 11cd664

Please sign in to comment.