Skip to content

Commit

Permalink
DigitalOcean Docs / Rename DigitalOcean to dobs
Browse files Browse the repository at this point in the history
This patch adds documentation for the DigitalOcean Block Storage driver
as well as renaming said driver to `dobs`.
  • Loading branch information
akutz committed Feb 24, 2017
1 parent af90486 commit e3fd86b
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 45 deletions.
56 changes: 48 additions & 8 deletions .docs/user-guide/storage-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services.

### Elastic Block Storage
The AWS EBS driver registers a storage driver named `ebs` with the
`libStorage` driver manager and is used to connect and manage AWS Elastic Block
libStorage service registry and is used to connect and manage AWS Elastic Block
Storage volumes for EC2 instances.

!!! note
Expand Down Expand Up @@ -129,7 +129,7 @@ libstorage:

### Elastic File System
The AWS EFS driver registers a storage driver named `efs` with the
`libStorage` driver manager and is used to connect and manage AWS Elastic File
libStorage service registry and is used to connect and manage AWS Elastic File
Systems.

#### Requirements
Expand Down Expand Up @@ -236,7 +236,7 @@ libstorage:

### Simple Storage Service
The AWS S3FS driver registers a storage driver named `s3fs` with the
`libStorage` driver manager and provides the ability to mount Amazon Simple
libStorage service registry and provides the ability to mount Amazon Simple
Storage Service (S3) buckets as filesystems using the
[`s3fs`](https://github.com/s3fs-fuse/s3fs-fuse) FUSE command.

Expand Down Expand Up @@ -437,7 +437,7 @@ libStorage includes support for several Dell EMC storage platforms.

### Isilon
The Isilon driver registers a storage driver named `isilon` with the
`libStorage` driver manager and is used to connect and manage Isilon NAS
libStorage service registry and is used to connect and manage Isilon NAS
storage. The driver creates logical volumes in directories on the Isilon
cluster. Volumes are exported via NFS and restricted to a single client at a
time. Quotas can also be used to ensure that a volume directory doesn't exceed
Expand Down Expand Up @@ -539,7 +539,7 @@ The Isilon driver is not without its caveats:

### ScaleIO
The ScaleIO driver registers a storage driver named `scaleio` with the
`libStorage` driver manager and is used to connect and manage ScaleIO storage.
libStorage service registry and is used to connect and manage ScaleIO storage.


#### Requirements
Expand Down Expand Up @@ -656,14 +656,54 @@ libstorage:
storagePoolName: storagePoolName
```

## DigitalOcean
Thanks to the efforts of our tremendous community, libStorage also has built-in
support for DigitalOcean!

<a class="headerlink hiddenanchor" name="digitalocean-block-storage"></a>
<a class="headerlink hiddenanchor" name="dobs"></a>

### DO Block Storage
The DigitalOcean Block Storage (DOBS) driver registers a driver named `dobs`
with the libStorage service registry and is used to attach and mount
DigitalOcean block storage devices to DigitalOcean instances.

!!! note
The DigitalOcean Block Storage driver currently only supports operating in
_local only_ mode where the libStorage server must be running on the same
host as the client.

#### Requirements
The DigitalOcean block storage driver has the following requirements:

* Valid DigitalOcean account
* Valid DigitalOcean [access token](https://goo.gl/iKoAec)

#### Configuration
The following example illustrates a minimal configuration for the DigitalOcean
block storage driver:

```yaml
dobs:
token: 123456
region: nyc1
```

!!! note
The standard environment variable for the DigitalOcean access token is
`DIGITALOCEAN_ACCESS_TOKEN`. However, the environment variable mapped to
this driver's `dobs.token` property is `DOBS_TOKEN`. This choice was made
to ensure that the driver must be explicitly configured for access instead
of detecting a default token that may not be intended for the driver.

## Google
libStorage ships with support for Google Compute Engine (GCE) as well.

<a class="headerlink hiddenanchor" name="gce-persistent-disk"></a>

### GCE Persistent Disk
The Google Compute Engine Persistent Disk (GCEPD) driver registers a driver
named `gcepd` with the `libStorage` driver manager and is used to connect and
named `gcepd` with the libStorage service registry and is used to connect and
mount Google Compute Engine (GCE) persistent disks with GCE machine instances.

#### Requirements
Expand Down Expand Up @@ -787,7 +827,7 @@ Microsoft Azure support is included with libStorage as well.

### Azure Unmanaged Disk
The Microsoft Azure Unmanaged Disk (Azure UD) driver registers a driver
named `azureud` with the `libStorage` driver manager and is used to connect and
named `azureud` with the libStorage service registry and is used to connect and
mount Azure unmanaged disks from Azure page blob storage with Azure virtual
machines.

Expand Down Expand Up @@ -899,7 +939,7 @@ libstorage:

## VirtualBox
The VirtualBox driver registers a storage driver named `virtualbox` with the
`libStorage` driver manager and is used by VirtualBox's VMs to connect and
libStorage service registry and is used by VirtualBox's VMs to connect and
manage volumes provided by VirtualBox.

### Prerequisites
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package digitalocean
package dobs

import (
gofigCore "github.com/akutz/gofig"
Expand All @@ -9,7 +9,7 @@ import (

const (
// Name is the name of the driver
Name = "digitalocean"
Name = "dobs"

// InstanceIDFieldRegion is the key used to retrive the region from the
// instance id map
Expand All @@ -20,9 +20,11 @@ const (
InstanceIDFieldName = "name"

// VolumePrefix is the value that every DO volume appears with DigitalOcean
// volumes are are found using disk/by-id, ex:
// /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 See
// https://www.digitalocean.com/community/tutorials/how-to-use-block-storage-on-digitalocean#preparing-volumes-for-use-in-linux
// volumes are are found using disk/by-id, for example:
//
// /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01
//
// Please see https://goo.gl/MwReS6 for more information.
VolumePrefix = "scsi-0DO_Volume_"

// ConfigDOToken is the key for the token in the config file
Expand All @@ -37,11 +39,18 @@ func init() {
}

func registerConfig() {
r := gofigCore.NewRegistration("DigitalOcean")
r.Key(gofig.String, "", "", "",
ConfigDOToken,
"digitaloceanAccessToken",
"DIGITALOCEAN_ACCESS_TOKEN")
r.Key(gofig.String, "", "", "DigitalOcean region", ConfigDORegion)
r := gofigCore.NewRegistration("DigitalOcean Block Storage")
r.Key(
gofig.String,
"",
"",
"The DigitalOcean access token",
ConfigDOToken)
r.Key(
gofig.String,
"",
"",
"The DigitalOcean region",
ConfigDORegion)
gofigCore.Register(r)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !libstorage_storage_executor libstorage_storage_executor_digitalocean
// +build !libstorage_storage_executor libstorage_storage_executor_dobs

package executor

Expand All @@ -11,8 +11,8 @@ import (
gofig "github.com/akutz/gofig/types"
"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/types"
do "github.com/codedellemc/libstorage/drivers/storage/digitalocean"
doUtils "github.com/codedellemc/libstorage/drivers/storage/digitalocean/utils"
do "github.com/codedellemc/libstorage/drivers/storage/dobs"
doUtils "github.com/codedellemc/libstorage/drivers/storage/dobs/utils"
)

var (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package storage

Expand All @@ -18,8 +18,8 @@ import (
"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/types"

do "github.com/codedellemc/libstorage/drivers/storage/digitalocean"
doUtils "github.com/codedellemc/libstorage/drivers/storage/digitalocean/utils"
do "github.com/codedellemc/libstorage/drivers/storage/dobs"
doUtils "github.com/codedellemc/libstorage/drivers/storage/dobs/utils"
)

type driver struct {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package digitalocean
package dobs

import (
"os"
Expand All @@ -17,14 +17,14 @@ import (
apitests "github.com/codedellemc/libstorage/api/tests"
"github.com/codedellemc/libstorage/api/types"
"github.com/codedellemc/libstorage/api/utils"
do "github.com/codedellemc/libstorage/drivers/storage/digitalocean"
doUtils "github.com/codedellemc/libstorage/drivers/storage/digitalocean/utils"
do "github.com/codedellemc/libstorage/drivers/storage/dobs"
doUtils "github.com/codedellemc/libstorage/drivers/storage/dobs/utils"
"github.com/stretchr/testify/assert"
)

var (
configYAML = []byte(`
digitalocean:
dobs:
token: 12345
region: sfo2`)
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package utils

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package utils

Expand All @@ -7,7 +7,7 @@ import (
"net/http"

"github.com/codedellemc/libstorage/api/types"
"github.com/codedellemc/libstorage/drivers/storage/digitalocean"
"github.com/codedellemc/libstorage/drivers/storage/dobs"
)

const (
Expand Down Expand Up @@ -38,10 +38,10 @@ func InstanceID(ctx types.Context) (*types.InstanceID, error) {

return &types.InstanceID{
ID: id,
Driver: digitalocean.Name,
Driver: dobs.Name,
Fields: map[string]string{
digitalocean.InstanceIDFieldRegion: region,
digitalocean.InstanceIDFieldName: name,
dobs.InstanceIDFieldRegion: region,
dobs.InstanceIDFieldName: name,
},
}, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build go1.7
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package utils

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !go1.7
// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean
// +build !libstorage_storage_driver libstorage_storage_driver_dobs

package utils

Expand Down
2 changes: 1 addition & 1 deletion imports/executors/imports_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package executors
import (
// load the storage executors
_ "github.com/codedellemc/libstorage/drivers/storage/azureud/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/digitalocean/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/dobs/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/ebs/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/efs/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/fittedcloud/executor"
Expand Down
4 changes: 2 additions & 2 deletions imports/executors/imports_executor_digitalocean.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// +build libstorage_storage_executor,libstorage_storage_executor_digitalocean
// +build libstorage_storage_executor,libstorage_storage_executor_dobs

package executors

import (
// load the packages
_ "github.com/codedellemc/libstorage/drivers/storage/digitalocean/executor"
_ "github.com/codedellemc/libstorage/drivers/storage/dobs/executor"
)
2 changes: 1 addition & 1 deletion imports/remote/imports_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package remote
import (
// import to load
_ "github.com/codedellemc/libstorage/drivers/storage/azureud/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/digitalocean/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/dobs/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/ebs/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/efs/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/fittedcloud/storage"
Expand Down
4 changes: 2 additions & 2 deletions imports/remote/imports_remote_digitalocean.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// +build libstorage_storage_driver,libstorage_storage_driver_digitalocean
// +build libstorage_storage_driver,libstorage_storage_driver_dobs

package remote

import (
// load the packages
_ "github.com/codedellemc/libstorage/drivers/storage/digitalocean/storage"
_ "github.com/codedellemc/libstorage/drivers/storage/dobs/storage"
)

0 comments on commit e3fd86b

Please sign in to comment.