diff --git a/.docs/user-guide/storage-providers.md b/.docs/user-guide/storage-providers.md index 63059ab4..1dd41639 100644 --- a/.docs/user-guide/storage-providers.md +++ b/.docs/user-guide/storage-providers.md @@ -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 @@ -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 @@ -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. @@ -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 @@ -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 @@ -656,6 +656,46 @@ libstorage: storagePoolName: storagePoolName ``` +## DigitalOcean +Thanks to the efforts of our tremendous community, libStorage also has built-in +support for DigitalOcean! + + + + +### 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. @@ -663,7 +703,7 @@ libStorage ships with support for Google Compute Engine (GCE) as well. ### 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 @@ -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. @@ -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 diff --git a/drivers/storage/digitalocean/digitalocean.go b/drivers/storage/dobs/dobs.go similarity index 62% rename from drivers/storage/digitalocean/digitalocean.go rename to drivers/storage/dobs/dobs.go index 2e15f1ef..79a95435 100644 --- a/drivers/storage/digitalocean/digitalocean.go +++ b/drivers/storage/dobs/dobs.go @@ -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" @@ -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 @@ -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 @@ -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) } diff --git a/drivers/storage/digitalocean/executor/digitalocean_executor.go b/drivers/storage/dobs/executor/dobs_executor.go similarity index 92% rename from drivers/storage/digitalocean/executor/digitalocean_executor.go rename to drivers/storage/dobs/executor/dobs_executor.go index 5c772a65..456afb93 100644 --- a/drivers/storage/digitalocean/executor/digitalocean_executor.go +++ b/drivers/storage/dobs/executor/dobs_executor.go @@ -1,4 +1,4 @@ -// +build !libstorage_storage_executor libstorage_storage_executor_digitalocean +// +build !libstorage_storage_executor libstorage_storage_executor_dobs package executor @@ -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 ( diff --git a/drivers/storage/digitalocean/storage/digitalocean_storage.go b/drivers/storage/dobs/storage/dobs_storage.go similarity index 98% rename from drivers/storage/digitalocean/storage/digitalocean_storage.go rename to drivers/storage/dobs/storage/dobs_storage.go index 711903dd..02183960 100644 --- a/drivers/storage/digitalocean/storage/digitalocean_storage.go +++ b/drivers/storage/dobs/storage/dobs_storage.go @@ -1,4 +1,4 @@ -// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean +// +build !libstorage_storage_driver libstorage_storage_driver_dobs package storage @@ -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 { diff --git a/drivers/storage/digitalocean/tests/README.md b/drivers/storage/dobs/tests/README.md similarity index 100% rename from drivers/storage/digitalocean/tests/README.md rename to drivers/storage/dobs/tests/README.md diff --git a/drivers/storage/digitalocean/tests/coverage.mk b/drivers/storage/dobs/tests/coverage.mk similarity index 100% rename from drivers/storage/digitalocean/tests/coverage.mk rename to drivers/storage/dobs/tests/coverage.mk diff --git a/drivers/storage/digitalocean/tests/digitalocean_test.go b/drivers/storage/dobs/tests/dobs_test.go similarity index 97% rename from drivers/storage/digitalocean/tests/digitalocean_test.go rename to drivers/storage/dobs/tests/dobs_test.go index 0c335db0..a814449e 100644 --- a/drivers/storage/digitalocean/tests/digitalocean_test.go +++ b/drivers/storage/dobs/tests/dobs_test.go @@ -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" @@ -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`) ) diff --git a/drivers/storage/digitalocean/tests/terraform/.gitignore b/drivers/storage/dobs/tests/terraform/.gitignore similarity index 100% rename from drivers/storage/digitalocean/tests/terraform/.gitignore rename to drivers/storage/dobs/tests/terraform/.gitignore diff --git a/drivers/storage/digitalocean/tests/terraform/main.tf b/drivers/storage/dobs/tests/terraform/main.tf similarity index 100% rename from drivers/storage/digitalocean/tests/terraform/main.tf rename to drivers/storage/dobs/tests/terraform/main.tf diff --git a/drivers/storage/digitalocean/tests/terraform/templates/cloudinit.tpl b/drivers/storage/dobs/tests/terraform/templates/cloudinit.tpl similarity index 100% rename from drivers/storage/digitalocean/tests/terraform/templates/cloudinit.tpl rename to drivers/storage/dobs/tests/terraform/templates/cloudinit.tpl diff --git a/drivers/storage/digitalocean/tests/terraform/variables.tf b/drivers/storage/dobs/tests/terraform/variables.tf similarity index 100% rename from drivers/storage/digitalocean/tests/terraform/variables.tf rename to drivers/storage/dobs/tests/terraform/variables.tf diff --git a/drivers/storage/digitalocean/tests/test-env-down.sh b/drivers/storage/dobs/tests/test-env-down.sh similarity index 100% rename from drivers/storage/digitalocean/tests/test-env-down.sh rename to drivers/storage/dobs/tests/test-env-down.sh diff --git a/drivers/storage/digitalocean/tests/test-env-up.sh b/drivers/storage/dobs/tests/test-env-up.sh similarity index 100% rename from drivers/storage/digitalocean/tests/test-env-up.sh rename to drivers/storage/dobs/tests/test-env-up.sh diff --git a/drivers/storage/digitalocean/utils/client.go b/drivers/storage/dobs/utils/client.go similarity index 97% rename from drivers/storage/digitalocean/utils/client.go rename to drivers/storage/dobs/utils/client.go index cdd2a6da..6d6ff48b 100644 --- a/drivers/storage/digitalocean/utils/client.go +++ b/drivers/storage/dobs/utils/client.go @@ -1,4 +1,4 @@ -// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean +// +build !libstorage_storage_driver libstorage_storage_driver_dobs package utils diff --git a/drivers/storage/digitalocean/utils/instance.go b/drivers/storage/dobs/utils/instance.go similarity index 87% rename from drivers/storage/digitalocean/utils/instance.go rename to drivers/storage/dobs/utils/instance.go index 562f6d30..87117279 100644 --- a/drivers/storage/digitalocean/utils/instance.go +++ b/drivers/storage/dobs/utils/instance.go @@ -1,4 +1,4 @@ -// +build !libstorage_storage_driver libstorage_storage_driver_digitalocean +// +build !libstorage_storage_driver libstorage_storage_driver_dobs package utils @@ -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 ( @@ -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 } diff --git a/drivers/storage/digitalocean/utils/utils_go1.7.go b/drivers/storage/dobs/utils/utils_go1.7.go similarity index 97% rename from drivers/storage/digitalocean/utils/utils_go1.7.go rename to drivers/storage/dobs/utils/utils_go1.7.go index c536148d..fc5e7167 100644 --- a/drivers/storage/digitalocean/utils/utils_go1.7.go +++ b/drivers/storage/dobs/utils/utils_go1.7.go @@ -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 diff --git a/drivers/storage/digitalocean/utils/utils_pre_go17.go b/drivers/storage/dobs/utils/utils_pre_go17.go similarity index 97% rename from drivers/storage/digitalocean/utils/utils_pre_go17.go rename to drivers/storage/dobs/utils/utils_pre_go17.go index 0c9abfe8..a2acbea1 100644 --- a/drivers/storage/digitalocean/utils/utils_pre_go17.go +++ b/drivers/storage/dobs/utils/utils_pre_go17.go @@ -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 diff --git a/imports/executors/imports_executor.go b/imports/executors/imports_executor.go index 672127b1..47aee3d8 100644 --- a/imports/executors/imports_executor.go +++ b/imports/executors/imports_executor.go @@ -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" diff --git a/imports/executors/imports_executor_digitalocean.go b/imports/executors/imports_executor_digitalocean.go index d2fa9919..d294da9a 100644 --- a/imports/executors/imports_executor_digitalocean.go +++ b/imports/executors/imports_executor_digitalocean.go @@ -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" ) diff --git a/imports/remote/imports_remote.go b/imports/remote/imports_remote.go index 06593e18..24b547a2 100644 --- a/imports/remote/imports_remote.go +++ b/imports/remote/imports_remote.go @@ -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" diff --git a/imports/remote/imports_remote_digitalocean.go b/imports/remote/imports_remote_digitalocean.go index 9f9e454c..197a2460 100644 --- a/imports/remote/imports_remote_digitalocean.go +++ b/imports/remote/imports_remote_digitalocean.go @@ -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" )