antigravity-docker-4-blog

The Blockbridge Docker Volume Driver version 4.0 is now available! This update adds native support for compressed and encrypted volume backup to any S3 compatible object store. Backup any application without the need for custom images, application changes or downtime. Instantly restore from backup, with full read/write access, without having to wait for a full volume transfer. Move data between test and production, from private to public clouds, and between cloud providers. Perform backups and recover from disaster scenarios without host software dependencies. Platform agnostic, cloud agnostic, host independent. Read on for more information!

Volume Driver 4.0 Compatibility

CompatibilityDescription
OSAny linux that runs docker
Docker versionAny docker version 1.9+
OrchestrationSwarm, Mesos, Kubernetes, Kontena

No additional host software required. No kernel requirements. No changes to applications or containers.

Volume Driver 4.0 Feature Reference

The Blockbridge volume driver is a full-featured volume plugin for Docker, enabling multi-host access to block storage data volumes. Many functions are available through the native Docker API and command line tools. More advanced functionality is accessible via the API exposed by the Blockbridge Volume Driver and accompanying command lines tools.

The table below presents the base feature list for 4.0 along with interface support guidelines.

Blockbridge FeatureVia Docker APIVia Blockbridge API
Create VolumeYesYes
Inspect VolumeYesYes
List VolumesYesYes
Remove VolumeYesYes
Secure Transport VolumesYesYes
Authenticated VolumesYesYes
Encrypted VolumesYesYes
QoS VolumesYesYes
Create Volume Profile –Yes
Inspect Volume Profile –Yes
List Volume Profiles –Yes
Remove Volume Profiles –Yes
Volume Backup –Yes
Volume RestoreYesYes
Inspect Backup –Yes
List Backups –Yes
Remove Backup –Yes

Backup and Restore Magic

Blockbridge storage software provides application and platform independent mobility. Rather than impose kernel, software or hardware constraints on the host infrastructure, your data is connected to your container via network, and made available to the operating system as block storage using standard protocols. If your application host infrastructure fails, your data survives. If you initiate a backup, and your host fails one second later, the backup will complete.

There are no host memory, network, processor or software requirements to perform volume backup or restore. All data transformations and transfers are processed natively between your storage infrastructure and S3. A key feature of this design is that restore is instantaneous: your data is accessible immediately and faulted in on-demand. No application startup delays!

Workflow Example

Let’s work through a backup and restore workflow for a persistent database application. First, create a volume for the database. We’ll use mongodb in this example:

$ docker volume create --driver blockbridge --name mongo-data
mongo-data

Next, run the mongodb application and use the persistent volume for data:

$ docker run --name mongo -v mongo-data:/data/db -d mongo
1f18d4ea9a361179a04d96c2af17b370ce22024f2d6b695ca036eee40011212b

Now, write some data to the database:

$ docker exec -it mongo mongo
Welcome to the MongoDB shell.
For interactive help, type "help".
> use test_db
switched to db test_db
> db.createCollection("data")
{ "ok" : 1 }
> db.data.insert({"data" : "mydata"})
WriteResult({ "nInserted" : 1 })
> db.data.find()
{ "_id" : ObjectId("584accd51de1285ed8dfdbb7"), "data" : "mydata" }
> exit
bye

So far this looks the same as every other persistent data demo in the world. Let’s move on to do something that’s actually interesting.

Online Volume Backup

Blockbridge volumes natively support backup to any S3 object store, by transparently converting block storage to objects, without application downtime. Backups are thin, compressed and encrypted.

Backup the mongodb database:

$ docker exec blockbridge-volume-driver volume backup mongo-data
== Volume backup initiated for mongo-data with backup id 9f8f2bd4-4987-457d-9617-00ba7d803220

Note: the application is running, and no changes to the application were required to make this happen!

Listing Backups

You can view a list of backups as shown below. Note that enumeration is scoped to a storage profile: the default storage profile is selected if one is not specified on the command line. Also note that you have access to backups created from your bare-metal and virtual infrastructure as well. This isn’t limited to containers!

$ docker exec blockbridge-volume-driver backup ls
Label [3]          ID [4]             User [1]  S3 [2]  Date                    Description                                  
-----------------  ----------------   --------  ------  ----------------------  ---------------------------------------------
mongo-data-backup  9f8f2bd4-4987-...  srust     aws-s3  2016-12-09T15:32+00:00  mongo-data-backup (snap-08fee0ed7cf2) 1.0 GiB

Instant Restore from Backup

Given a fully consistent backup of the application database, we can create a restore volume and immediately access it from a container. All you need is access to the object store where the backup lives from your storage infrastructure. In the case of Amazon S3 or other public object stores, this means you can restore virtually anywhere in the world.

Restore from backup by creating a new volume and specifying its source as ‘from backup’:

$ docker volume create --driver blockbridge --name mongo-data-restore --opt from_backup=mongo-data-backup
mongo-data-restore

Run a new mongo container against the restored data:

$ docker run --name mongo-restore -v mongo-data-restore:/data/db -d mongo
88eccc721d13870b121aa9f23dc4f014bb2e73cf7931b3319466f4cd9ecd095c

Verify the restored data:

$ docker exec -it mongo-restore mongo
Welcome to the MongoDB shell.
For interactive help, type "help".
> use test_db
switched to db test_db
> db.data.find()
{ "_id" : ObjectId("584accd51de1285ed8dfdbb7"), "data" : "mydata" }

Try it!

The Blockbridge volume driver is available on the Docker hub and on github. Detailed instructions and quick start guides are available on github:

https://github.com/blockbridge/blockbridge-docker-volume

https://hub.docker.com/r/blockbridge/volume-driver/

What is Blockbridge?

Blockbridge is Elastic Block Storage for everyone. Run Blockbridge on bare-metal, on a VM, or in a container, in any cloud, on any provider. Access your data directly from any Linux or Windows host as a standard block device, or use it as a Docker volume through the volume plugin in a swarm. Manage your storage via Web UI, cross-platform command-line tools, or REST API. See https://blockbridge.com for more information and to download fully functional trial software, or contact us at info@blockbridge.com with any questions. We’d love to hear from you!