<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>I'm just sayin!</title>
    <description>Random, sometimes shallow thoughts about stuff.</description>
    <link>https://j-griffith.github.io/</link>
    <atom:link href="https://j-griffith.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Thu, 01 Aug 2019 15:12:01 -0600</pubDate>
    <lastBuildDate>Thu, 01 Aug 2019 15:12:01 -0600</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
      <item>
        <title>Cinder - Block Stroage for things other than Nova (Part-2)</title>
        <description>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;

&lt;p&gt;In previous posts we started talking about using Cinder as a Block Storage
provider for consumers other than Nova.  In particular our first example has
been how to use Cinder by itself for Docker.  You can catch the first part of
that here &lt;a href=&quot;/articles/2016-09/cinder-providing-block-storage-for-more-than-just-nova&quot;&gt;Cinder providing block storage for more than just Nova&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So there we walked through how to install the &lt;a href=&quot;https://github.com/j-griffith/cinder-docker-driver/blob/master/README.md&quot;&gt;Cinder Docker Driver&lt;/a&gt; and configure
things in a simple stand-alone setup. In this post we’re going to follow up on
a few things and consume Cinder resources from a Swarm Cluster.&lt;/p&gt;

&lt;p&gt;If you’ve never built a Swarm cluster, it’s &lt;em&gt;super&lt;/em&gt; easy using Docker 1.12.
Even better, if you have an OpenStack Cloud internally, you can check out my
post &lt;a href=&quot;/articles/2016-09/how-to-swarm-on-openstack&quot;&gt;How to Swarm on OpenStack&lt;/a&gt;, or watch the &lt;a href=&quot;https://youtu.be/Dh2BK7xm02o&quot;&gt;Screen Cast&lt;/a&gt; and try
this out for yourself in about 10 minutes or so.&lt;/p&gt;

&lt;h2 id=&quot;a-little-background&quot;&gt;A little Background&lt;/h2&gt;

&lt;p&gt;We’re going to start from the poing where we already have a Swarm Cluster
set up and ready to use.  For simplicity I’m going to use the Swarm
deployed on my OpenStack Cloud. That means I’m using Nova Instances as
my Swarm Nodes, BUT Nova doesn’t know anything about Cinder in this case.&lt;/p&gt;

&lt;p&gt;The whole idea here is how to use Cinder just as Cinder by
itself. This all works the same whether you’re Swarm is on&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Bare Metal&lt;/li&gt;
  &lt;li&gt;vSphere&lt;/li&gt;
  &lt;li&gt;VirtualBox&lt;/li&gt;
  &lt;li&gt;OpenStack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Whoa, hold up!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Did I say use Cinder to provide storage for my Containers running in
vSphere???&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;YES I DID!!  and YES YOU CAN!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The whole point of this post is that we only really &lt;em&gt;need&lt;/em&gt; Cinder.&lt;/p&gt;

&lt;h2 id=&quot;installingconfiguring-the-cinder-docker-driver-on-each-docker-node&quot;&gt;Installing/Configuring the cinder-docker-driver on each Docker Node&lt;/h2&gt;

&lt;p&gt;The following is much the same as we did in part 1 of our post,  we’ll go
through the same steps, but we’re going to do everything through
docker-machine.  You could certainly do this with your own bash, python or
ansible or &lt;em&gt;whatever&lt;/em&gt;, but docker-machine and the command line in my case works
really well.&lt;/p&gt;

&lt;h4 id=&quot;firs-well-use-curl-to-fetch-and-run-the-install-script-for-the-plugin&quot;&gt;Firs we’ll use curl to fetch and run the install script for the Plugin&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for each in $(docker-machine ls -q); do; docker-machine ssh $each &quot;curl -sSl https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | sudo sh -&quot;; done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Remember, we’re manually creating conf files because of the HostUUID issue.  Since we’re using OpenStack Instances
here, might as well use their UUID’s for this.  I’ve created the files I need,
they’re all the same with the exception of the &lt;code class=&quot;highlighter-rouge&quot;&gt;HostUUID:&lt;/code&gt; entry:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for each in 1 2 3 4; do; docker-machine scp cdd.config.swarm-$each.json swarm-$each:~/config.json; done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, just move the files into the default cinder dockerdriver directory using sudo…&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for each in $(docker-machine ls -q); do; docker-machine ssh $each &quot;sudo cp ~/config.json /var/lib/cinder/dockerdriver/config.json&quot;; done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start the plugin daemon on each Node&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for each in $(docker-machine ls -q); do; docker-machine ssh $each &quot;sudo service cinder-docker-driver start&quot;; done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Verify the services all started up ok…&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ for each in $(docker-machine ls -q); do; docker-machine ssh $each &quot;sudo service cinder-docker-driver status&quot;; done
● cinder-docker-driver.service - &quot;Cinder Docker Plugin daemon&quot;
   Loaded: loaded (/etc/systemd/system/cinder-docker-driver.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2016-09-13 23:12:52 UTC; 8s ago
 Main PID: 26875 (cinder-docker-d)
    Tasks: 5
   Memory: 1.2M
      CPU: 11ms
   CGroup: /system.slice/cinder-docker-driver.service
           └─26875 /usr/bin/cinder-docker-driver &amp;amp;

Sep 13 23:12:52 swarm-1 systemd[1]: Started &quot;Cinder Docker Plugin daemon&quot;.
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Using config file: /var/lib/cinder/dockerdriver/config.json&quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set InitiatorIFace to: default&quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set node InitiatorIP to: &quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set DefaultVolSz to: 1 GiB&quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set Endpoint to: http://172.16.140.243:5000/v2.0&quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set Username to: jdg&quot;
Sep 13 23:12:52 swarm-1 cinder-docker-driver[26875]: time=&quot;2016-09-13T23:12:52Z&quot; level=info msg=&quot;Set TenantID to: 3dce5dd10b414ac1b942aba8ce8558e7&quot;
......
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Easy enough… we’ve now succesfully added/configured the Cinder Plugin to each
of our Swarm nodes.  We’re ready to deploy Swarm services and consume our
Cinder storage.&lt;/p&gt;

&lt;h2 id=&quot;our-first-swarm-service-that-consumes-cinder&quot;&gt;Our first Swarm Service that Consumes Cinder&lt;/h2&gt;

&lt;p&gt;The first thing we’ll do now is set our env back to our Swarm Manager Node, and
create a Swarm network to use.  I just use the basic overlay driver, this
network is really important.  We’ll specify this in our services and it will do
things like enable the containers to communicate across nodes, and also do
things like allow us to access a running container from any one of the Swarm
Nodes IP addresses (regardless of where the Container is actually running).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ eval $(docker-machine env swarm-1)
$ docker network create --driver overlay swarm-net
93huy770ajjyvk87hc3kmdabr

$ docker network list
NETWORK ID          NAME                DRIVER              SCOPE
4bc75c8415f5        bridge              bridge              local
a4b3019e592a        docker_gwbridge     bridge              local
4fce4f1ddbe0        host                host                local
0by3ei97kci5        ingress             overlay             swarm
afafb56eb377        none                null                local
93huy770ajjy        swarm-net           overlay             swarm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So you’ll notice we did a ```docker network list`` there, we want to make sure
we have a network we can use with the SCOPE==swarm.&lt;/p&gt;

&lt;p&gt;At this point we’re going to build an “app”, albeit a very simple app.  Our app
is going to consist of:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;A redis service (that persists data to a Cinder Volume)&lt;/li&gt;
  &lt;li&gt;A web service that takes input via a simple web-page and stores the info to
our Redis service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The app is a modified version of the Moby-Counter app you’ve probably seen.
One thing about Docker is that “counting” apps seem to be THE DEFACTO example,
so why break with tradition here.&lt;/p&gt;

&lt;h3 id=&quot;start-our-redis-service&quot;&gt;Start our Redis Service&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker service create --name redis --network swarm-net --mount
type=volume,src=redis-1,dst=/data,volume-driver=cinder -p 6379:6379 redis
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So that’s pretty simple, the syntax for service as it relates to Volumes is a
little different, but it makes sense once you kinda walk through it.&lt;/p&gt;

&lt;p&gt;We want to “mount” something to the container when it starts up
&lt;code class=&quot;highlighter-rouge&quot;&gt;--mount&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That thing we want to mount is a “volume”
&lt;code class=&quot;highlighter-rouge&quot;&gt;type=volume&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;src=redis-1&lt;/code&gt;  Name of the src volume to create, or just use one if
it already exists.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;dst=/data&lt;/code&gt;  That’s where we’re going to mount the src volume in our
container.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;volume-driver=cinder&lt;/code&gt;  Tells the Docker Volume API &lt;em&gt;which&lt;/em&gt; Volume
Plugin/Service to use.&lt;/p&gt;

&lt;p&gt;That’s all ther is to it.  Swarm will figure out where to place the Container
(since we’re not giving it any constraints anywhere one of the Swarm nodes is
fair game), And it will communicate with the Cinder Plugin Daemon ON the Node
that it places the Container.&lt;/p&gt;

&lt;p&gt;The Plugin takes care of all the details:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check if Volume already exists&lt;/li&gt;
  &lt;li&gt;Create it if it doesn’t&lt;/li&gt;
  &lt;li&gt;Perform an iSCSI attach to the Swarm Node&lt;/li&gt;
  &lt;li&gt;Format the volume (only if it’s a new Volume that it created)&lt;/li&gt;
  &lt;li&gt;Mount the volume on the Swarm Node&lt;/li&gt;
  &lt;li&gt;Pass the Mount point into the Container.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now… if that Container “fails” for some reason, it will be restarted on
another node.  In that case the above steps are repeated on the new Node.  So,
you may have lost a node, or your container died, but your storage and
“important” data are now efficiently portable across your Swarm Nodes!!!&lt;/p&gt;

&lt;h3 id=&quot;start-up-our-web-server&quot;&gt;Start up our web server&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker service create --name web --network swarm-net -p 80:80 \
jgriffith/jgriffith-webbase
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s all there is to it, now you should be able to do &lt;code class=&quot;highlighter-rouge&quot;&gt;docker service
list&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;docker service ps &amp;lt;service-id&amp;gt;&lt;/code&gt; to get details about where
your service is running and it’s status.&lt;/p&gt;

&lt;h2 id=&quot;put-it-all-together-and-demo-in-a-video&quot;&gt;Put it all together and demo in a video&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=XnGfmDQMABs&quot;&gt;Screencast demo&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 13 Sep 2016 00:00:00 -0600</pubDate>
        <link>https://j-griffith.github.io/articles/2016-09/cinder-providing-block-storage-for-more-than-just-nova-part-2</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2016-09/cinder-providing-block-storage-for-more-than-just-nova-part-2</guid>
        
        
      </item>
    
      <item>
        <title>Cinder - Block Storage for things other than Nova</title>
        <description>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;

&lt;h1 id=&quot;cinder-as-storage-for-docker-part-1-of-2&quot;&gt;Cinder as storage for Docker (part 1 of 2)&lt;/h1&gt;

&lt;p&gt;A lot of you may be familiar with Cinder, the OpenStack Block Storage project that’s been around for quite a while now.  If you’re not, you should take a look at the series of blog posts my friend &lt;a href=&quot;https://cloudarchitectmusings.com/&quot;&gt;Ken Hui&lt;/a&gt; at Rackspace put together, &lt;a href=&quot;http://blog.rackspace.com/laying-cinder-block-volumes-in-openstack-part-1-the-basics&quot;&gt;Laying Cinder Block&lt;/a&gt;.  That’s a more detailed version of the presentation he and I gave at the Summit in Atlanta a couple years back.&lt;/p&gt;

&lt;p&gt;The context most think of when they consider Cinder is always “Block Storage for Nova Instances”.  The fact is however that it’s pretty useful outside of the traditional Nova context.  You can use Cinder as a powerful “Block Storage as a Service” resource for a number of use cases and environments.  Myself and a few other have been doing this for a number of years now, mostly with Bare Metal systems in our labs.&lt;/p&gt;

&lt;p&gt;Given that Containers are the hottest thing since sliced bread these days, I thought it would be fun to post a little how to on how to use Cinder by itself with Containers.  For those of you that saw my presentation at the OpenStack Summit in Austin last spring, here’s what I was trying to show you on stage when I lost my wifi connection.&lt;/p&gt;

&lt;p&gt;On that note, here’s part 1 of a 2 part posting about using Cinder a little bit differently than you may have been doing previously.  For those that were at OpenStack Days East this is a follow up to the presentation I gave there, those &lt;a href=&quot;http://www.slideshare.net/jgriffith8/consuming-cinder-from-docker-65993634&quot;&gt;slides&lt;/a&gt; are also available for those that missed it.&lt;/p&gt;

&lt;h2 id=&quot;a-neat-use-case-that-works-for-me&quot;&gt;A neat use case that works for me&lt;/h2&gt;

&lt;p&gt;So one pattern that I’ve found myself using more and more that’s kind of interesting is that my development is a bit mixed.  Some times I’m doing things on an OpenStack Instance, other times on a workstation or bare metal server, and more recently working in Containers (ok, and sometimes public cloud… but we’ll let the one slide for now).&lt;/p&gt;

&lt;p&gt;What I found was that I could use my Cinder deployment (by itself, or as part of a full OpenStack deployment) to manage my storage needs across all three models fairly easily.  Even better, I could start working on something in one environment, and easily take my data with me to another.  I’ve now dones this with some build images and data base files not just from my workstation to a Nova Instance, but also now to Docker Containers.  As I change my app to run in various environments I just unplug the storage and plug it back in where I want it.  Kinda cool right?&lt;/p&gt;

&lt;h2 id=&quot;cinder-doesnt-know-or-care-whos-consuming-it-mostly&quot;&gt;Cinder doesn’t know or care who’s consuming it (mostly)&lt;/h2&gt;

&lt;p&gt;The biggest point of all of this is that for the most part, Cinder doesn’t know (or care) who or what is calling it’s API or even really what they’re doing with the resources.  It’s mostly just a control plane to bridge the differences between various backend storage devices.  What a caller chooses to do with those resources is up to them, and it doesn’t really matter if that’s a person using the respponse data to type in info on a cmd line, an automation script on a bare metal server, or in our case today a Docker Volume Plugin.&lt;/p&gt;

&lt;p&gt;I will reluctantly point out that over the years there have been some things that have crept into the code that make Cinder a bit more Nova aware (which is unfortunate) but it’s still pretty easy to work around.  Most of it is just things like requiring Instance UUID’s for attach (that’s a failry generic thing though) and also there are some backends that have snuck in some &lt;em&gt;features&lt;/em&gt; that use Nova to help them out.  In this case today I’m focused on just using the LVM driver and iSCSI connectivity.  This also works for other iSCSI based backends including SolidFire and others.&lt;/p&gt;

&lt;h2 id=&quot;a-cinder-plugin-for-docker&quot;&gt;A Cinder plugin for Docker&lt;/h2&gt;

&lt;p&gt;Containers are hot, no doubt about it.  They’re useful, the provide some pretty awesome flexibility in terms of not only development, but more importantly are fanstastic when it comes to deployment.  So, while I’ve been using Cinder against my Bare Metal systems and OpenStack Cloud for a while, last fall I started doing more and more with Containers, so I decided it would be worthwhile to write a &lt;a href=&quot;https://github.com/j-griffith/cinder-docker-driver&quot;&gt;Cinder Plugin for Docker&lt;/a&gt; that would allow me to use Cinder directly.&lt;/p&gt;

&lt;h3 id=&quot;yes-this-has-been-done-before&quot;&gt;Yes, this has been done before&lt;/h3&gt;

&lt;p&gt;So the first thing people pointed out was that “you can do this already”.  Yup, that’s true (ish), there are a number of offerings in the Container space that have created plugins for Docker that run on top of and consume Cinder.  Some fo them even work (some of them don’t).  None of them have much involvement from the Cinder community, and none of them are completely Cinder focused.&lt;/p&gt;

&lt;p&gt;Anyway, that’s all great, if you use one of those (or choose to use one in the future) good for you!  That’s awesome, but if you are looking for something that is “just” Cinder and is not maintained by a storage vendor maybe this will be of interest to you.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure&lt;/em&gt; Yes, I work for SolidFire/Netapp.  There’s no underlying interest here for me though other than Cinder and cool tech.  If you know me from the community I’m pretty good at keeping company and community interests seperate.  I’m also fortunate enough to work for some great folks that &lt;em&gt;get it&lt;/em&gt; and understand the importance.&lt;/p&gt;

&lt;h3 id=&quot;docker-volume-plugins&quot;&gt;Docker Volume Plugins&lt;/h3&gt;

&lt;p&gt;Docker started offering a Volume API a few releases back, it’s actually really pretty simple.  You can read up on it a bit &lt;a href=&quot;https://docs.docker.com/engine/extend/plugins_volume/&quot;&gt;here&lt;/a&gt; if you’re interested.&lt;/p&gt;

&lt;p&gt;The key here is that it’s pretty simple, and that’s a good… no that’s a &lt;em&gt;GREAT&lt;/em&gt; thing.  You’ll notice if you poke around on that link that there are quite a few volume plugins available.  You also might notice that several of the devices listed out there also have Cinder plugins/drivers.&lt;/p&gt;

&lt;h2 id=&quot;the-cinder-plugin&quot;&gt;The Cinder plugin&lt;/h2&gt;
&lt;p&gt;All of the plugins are pretty similar in how they work, the majority of us choose to use golang and the now official Docker Plugins Helper module.  Between that and the awesome &lt;a href=&quot;https://github.com/rackspace/gophercloud&quot;&gt;Gophercloud&lt;/a&gt; golang bindings for OpenStack started by RackSpace, creating the plugin was pretty easy.  The only effort here was the addition of some code to do the attach/detach of the Cinder volumes, even that though is still pretty trivial.  I just added some open-iscsi wrappers to the plugin and voila.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;warning&lt;/em&gt; I’ve only implemented iSCSI.. because; well it’s my favorite.  Those that offer other options are more than welcome to submit PR’s if they’re interested.&lt;/p&gt;

&lt;p&gt;Here are some of the reasons for creating this plugin rather than just pointing to and using someone elses:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;I happen to consider myself a bit of a Cinder expert&lt;/li&gt;
  &lt;li&gt;Vendor agnostic (my Github repo is mine)&lt;/li&gt;
  &lt;li&gt;I’m focused on just Cinder that’s it (other variants have other motivations)&lt;/li&gt;
  &lt;li&gt;Licenesed under the Unlicense so you don’t have to be afraid to contribute, sign a EULA etc.  (but please don’t start submitting stuff with copyright headers etc)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;lets-get-started&quot;&gt;Let’s get started&lt;/h3&gt;
&lt;h5 id=&quot;pre-requisites&quot;&gt;Pre Requisites&lt;/h5&gt;

&lt;p&gt;For Ubuntu:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install open-iscsi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For RHEL variants:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo yum install iscsi-initiator-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course make sure you have Docker installed, I recommend 1.12 at this point.&lt;/p&gt;

&lt;p&gt;Currently the plugin is a simple daemon written in Golang.  You’ll need to isntall it on your Docker Node(s), edit a simple config file to point it to your Cinder Endpoint and fire it up.  I’ve recently created a systemd init service for this that the install script will create and set everything up for you.  So all you have to do is use curl, or wget and pull down the install script and run it as root (or with sudo)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh \
| sudo sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next we just set up a minimal config file so we can talk to our Cinder Endpoint (standard OpenStack stuff here), we’ll just create a json file with the needed credential info &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/lib/cinder/dockerdriver/config.json&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    {
        &quot;HostUUID&quot;: &quot;82ee38eb-821b-42d0-8c61-c4974d0c8536&quot;,
        &quot;Endpoint&quot;: &quot;http://172.16.140.243:5000/v2.0&quot;,
        &quot;Username&quot;: &quot;jdg&quot;,
        &quot;Password&quot;: &quot;NotMyPassword&quot;,
        &quot;TenantID&quot;: &quot;3dce5dd10b414ac1b942aba8ce8558e7&quot;
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now, if you’ve used the install script you can just start the service:
&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo service cinder-docker-driver restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Verify everything came up properly:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo service cinder-docker-driver status
● cinder-docker-driver.service - &quot;Cinder Docker Plugin daemon&quot;
   Loaded: loaded (/etc/systemd/system/cinder-docker-driver.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2016-09-08 23:44:06 UTC; 29min ago
 Main PID: 13917 (cinder-docker-d)
    Tasks: 6
   Memory: 5.3M
      CPU: 290ms
   CGroup: /system.slice/cinder-docker-driver.service
           └─13917 /usr/bin/cinder-docker-driver &amp;amp;

Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;getVolByName: `cvol-4`&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;querying volume: {Attachments:[] AvailabilityZone:nova Bootable:false ConsistencyGroupID: CreatedAt:2016-09-08T23:46:13.000000 Description:Docker volume. Encrypted:false Name:cvol-4 VolumeType:lvmdriver-1 ReplicationDriverData: ReplicationE
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;Found Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=info msg=&quot;Remove/Delete Volume: cvol-4&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;getVolByName: `cvol-4`&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;querying volume: {Attachments:[] AvailabilityZone:nova Bootable:false ConsistencyGroupID: CreatedAt:2016-09-08T23:46:13.000000 Description:Docker volume. Encrypted:false Name:cvol-4 VolumeType:lvmdriver-1 ReplicationDriverData: ReplicationE
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;Found Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;Remove/Delete Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:46:59Z&quot; level=debug msg=&quot;Response from Delete: {ErrResult:{Result:{Body:&amp;lt;nil&amp;gt; Header:map[] Err:&amp;lt;nil&amp;gt;}}}\n&quot;
Sep 08 23:47:07 box-1 cinder-docker-driver[13917]: time=&quot;2016-09-08T23:47:07Z&quot; level=info msg=&quot;List volumes: &quot;
lines 1-20/20 (END)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then you can use journalctl to filter out the relative entries in syslog:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@box-1:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;journalctl &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; cinder-docker-driver
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; Logs begin at Thu 2016-09-08 20:52:15 UTC. &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;getVolByName: &lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;cvol-4&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;querying volume: {Attachments:[] AvailabilityZone:nova Bootable:false ConsistencyGroupID: CreatedAt:2016-09-08T23:46:13.000000 Description:Docker volume. Encrypted:false Name:cvol-4 VolumeType:lvmdriver-1 ReplicationDriverData: ReplicationExtendedStatus: ReplicationStatus:disabled SnapshotID: SourceVolID: Status:available TenantID:979ddb6183834b9993954ca6de518c5a Metadata:map[readonly:False] Multiattach:false ID:677a821b-e33b-44b5-8fb3-38315e832216 Size:1 UserID:e763fc47a2854b15a9f6b85aea2ae3f1}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Found Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;info &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Remove/Delete Volume: cvol-4&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;getVolByName: &lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;cvol-4&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;querying volume: {Attachments:[] AvailabilityZone:nova Bootable:false ConsistencyGroupID: CreatedAt:2016-09-08T23:46:13.000000 Description:Docker volume. Encrypted:false Name:cvol-4 VolumeType:lvmdriver-1 ReplicationDriverData: ReplicationExtendedStatus: ReplicationStatus:disabled SnapshotID: SourceVolID: Status:available TenantID:979ddb6183834b9993954ca6de518c5a Metadata:map[readonly:False] Multiattach:false ID:677a821b-e33b-44b5-8fb3-38315e832216 Size:1 UserID:e763fc47a2854b15a9f6b85aea2ae3f1}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Found Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Remove/Delete Volume ID: 677a821b-e33b-44b5-8fb3-38315e832216&quot;&lt;/span&gt;
Sep 08 23:46:59 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:46:59Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;debug &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Response from Delete: {ErrResult:{Result:{Body:&amp;lt;nil&amp;gt; Header:map[] Err:&amp;lt;nil&amp;gt;}}}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
Sep 08 23:47:07 box-1 cinder-docker-driver[13917]: &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2016-09-08T23:47:07Z&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;info &lt;span class=&quot;nv&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;List volumes: &quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s about it, the plugin should get picked up by your Docker Daemon and be ready to accept requests.  Couple of things to look out for:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;You have to use V2.0 as your endpoint for now, GopherCloud chose to implement extensions (like Attach) as versioned items instead of extensions which is what they currently are.   Discovery works as long as it ends up being V2.0, but V1 or V3 won’t work.  Microversioning support is going to create some consumer issues here I think but we’ll cross that bridge when we come to it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you get weird error messages on startup about username and/or TenantID it’s almost always an issue with your TenantID so start there&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It never hurts to restart the Docker Daemon on your node after you install the Plugin just to be safe&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We expect/look for the config.json file in /var/lib/cinder/dockerdriver/ but you can specifiy this with the –config flag.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;using-the-plugin-via-docker&quot;&gt;Using the Plugin via Docker&lt;/h4&gt;

&lt;p&gt;So that’s about it as far as install and setup.  Now you can access your Cinder service from the Docker volume API.  This means you can do things like use the Docker Volumes CLI to do things, as well as add Volume arguments to your Docker run commands and even your compose file.&lt;/p&gt;

&lt;h5 id=&quot;docker-volume-cli&quot;&gt;Docker Volume CLI&lt;/h5&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker volume --help

Usage:     docker volume COMMAND

Manage Docker volumes

Options:
      --help   Print usage

Commands:
  create      Create a volume
  inspect     Display detailed information on one or more volumes
  ls          List volumes
  rm          Remove one or more volumes

Run 'docker volume COMMAND --help' for more information on a command.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let’s look at a simple create example:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker volume create -d cinder -o size=1 --name demovol

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now list using Dockers API:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker volume ls
DRIVER              VOLUME NAME
cinder              demovol
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cool.. how about checking with Cinder:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cinder list

+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
| ID                                   | Status    | Name    | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
| 21a42614-c381-4bbc-b1d0-8498014f2d65 | available | demovol | 1    | lvmdriver-1 | false    |             |
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I know, I know.. big deal, we can create a volume.&lt;/p&gt;

&lt;p&gt;Let’s try something a little more interesting; let’s spin up a container and specify a volume to be created at the same time, we can do this using the Docker Run command, or via a Dockerfile.&lt;/p&gt;

&lt;h5 id=&quot;docker-run-command&quot;&gt;Docker Run command&lt;/h5&gt;

&lt;p&gt;Syntax to add a persistent storage volume to your conatiner at launch.  Notice that the Plugin will first check to see if the Volume already exists or not, if it does NOT it will create it for you using the info provided or defaults, if it does exist it will just do the attach and mount for you.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker run -v demovol-2:/Data --volume-driver=cinder -i -t ubuntu /bin/bash
$ cinder list

+--------------------------------------+-----------+-----------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name      | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+-----------+-----------+------+-------------+----------+--------------------------------------+
| 08c0c2af-4f91-4488-82a7-96bd020e8c00 | in-use    | demovol-2 | 1    | lvmdriver-1 | false    | 969bd5f5-64e3-433e-a248-04c3f7899a45 |
| 21a42614-c381-4bbc-b1d0-8498014f2d65 | available | demovol   | 1    | lvmdriver-1 | false    |                                      |
+--------------------------------------+-----------+-----------+------+-------------+----------+--------------------------------------+
$

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So now you’ll have Cinder volume (demovol-2) mounted and formatted with ext4 at /Data inside your container.&lt;/p&gt;

&lt;h5 id=&quot;docker-compose&quot;&gt;docker-compose&lt;/h5&gt;

&lt;p&gt;I like compose, automation is bestest….&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;web:
  environment:
    - &quot;reschedule:on-node-failure&quot;
    - &quot;constraint:node!=swarm-master&quot;
  image: jgriffith/jgriffith-webbase
  ports:
     - &quot;80:80&quot;
  links:
    - &quot;redis:redis&quot;
redis:
  environment:
    - &quot;reschedule:on-node-failure&quot;
  image: redis
  volumes:
    - &quot;demovol:/data&quot;
  volume_driver: cinder
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So these are pretty trivial examples, but it’s pretty easy to extend these examples into more &lt;em&gt;complex&lt;/em&gt; builds.  I’ve been using this setup for a while now to host a number of things ranging from a &lt;a href=&quot;https://github.com/vmware/harbor&quot;&gt;Harbor Docker Registry&lt;/a&gt; (images and DB backed by seperate cinder-volumes and running on a Nova Instance).  Other simple things are backing for a Redis store that I use as a simple message queue for a CI system I run, and another application I have where I’m running a Redis DB container that is persisting it’s data to a Cinder volume.  There’s quite a few things in my lab using Cinder now, some of those things are Nova Instances, but more and more of them lately are something else.&lt;/p&gt;

&lt;p&gt;The key take away here however is that Cinder is a lot more flexible than people might think.  It doesn’t have any real hard dependencies on Nova, Glance etc. It’s just about managing a pool of storage via the control plane and it leaves it up to the consumer to connect it however/wherever it wants.&lt;/p&gt;

&lt;p&gt;I’d love to hear your feedback, and try and answer any questions you might have.  Thanks for reading!&lt;/p&gt;

&lt;h2 id=&quot;next-time&quot;&gt;Next time&lt;/h2&gt;

&lt;p&gt;You can also use this with Swarm, coming up next we’ll go through how you can quickly and easily deploy a Swarm cluster on your OpenStack cloud and use the Cinder driver to keep persistent data in your Swarm Cluster and automatically move the volume across nodes in failover scenarios.  In the meantime, if you’re interested check it out, feel free to suggest improvements, raise issues or submit PRs.&lt;/p&gt;

&lt;p&gt;Before you ask… Kubernetes is very different.  It doesn’t actually use Docker’s Volume API, and with the exception of some experimental code in the different Cloud Provider drivers it also doesn’t do things like dynamic provisioning (create volumes).  It’s a completely different animal, and does things it’s own way.  TLDR if you’re using Kubernetes, this doesn’t really buy you anything.&lt;/p&gt;

&lt;p&gt;If you want more info on why this, and not some of the existing projects (including Kuryr) I’m happy to provide my opinions…  Thanks!!&lt;/p&gt;
</description>
        <pubDate>Wed, 07 Sep 2016 00:00:00 -0600</pubDate>
        <link>https://j-griffith.github.io/articles/2016-09/cinder-providing-block-storage-for-more-than-just-nova</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2016-09/cinder-providing-block-storage-for-more-than-just-nova</guid>
        
        
      </item>
    
      <item>
        <title>How to Swarm on OpenStack</title>
        <description>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;

&lt;h1 id=&quot;building-a-swarm-cluster-on-your-openstack-cloud&quot;&gt;Building a SWARM Cluster on your OpenStack Cloud&lt;/h1&gt;

&lt;p&gt;Also available as a screen-cast with some narrative &lt;a href=&quot;https://youtu.be/Dh2BK7xm02o&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;provisioning-instances-with-docker-machine&quot;&gt;Provisioning Instances with docker-machine&lt;/h2&gt;
&lt;p&gt;Start with an env file (rather than deal with a bunch of cmd line args)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export OS_FLAVOR_ID=6
export OS_DOMAIN_NAME=Default
export OS_IMAGE_ID=d5c276bc-cb70-42c4-9291-96f40a03a74c
export OS_SSH_USER=ubuntu
export OS_KEYPAIR_NAME=swarm
export OS_PRIVATE_KEY_FILE=$HOME/.ssh/id_rsa
export OS_SSH_USER=ubuntu
export OS_TENANT_ID=$OS_PROJECT_ID
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;source dmachine.env&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ source dmachine.env
$ for each in 1 2 3 4; do; docker-machine create -d openstack swarm-$each &amp;amp;; done
Running pre-create checks...
Creating machine...
Running pre-create checks...
Creating machine...
Running pre-create checks...
Creating machine...
Running pre-create checks...
Creating machine...
(swarm-2) Creating machine...
(swarm-1) Creating machine...
(swarm-3) Creating machine...
(swarm-4) Creating machine...

.......

Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this
virtual machine, run: docker-machine env swarm-4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$  docker-machine ls
NAME      ACTIVE   DRIVER      STATE     URL                         SWARM   DOCKER    ERRORS
swarm-1   -        openstack   Running   tcp://172.16.140.107:2376           v1.12.1
swarm-2   -        openstack   Running   tcp://172.16.140.106:2376           v1.12.1
swarm-3   -        openstack   Running   tcp://172.16.140.105:2376           v1.12.1
swarm-4   -        openstack   Running   tcp://172.16.140.108:2376           v1.12.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;initialize-a-swarm-cluster&quot;&gt;Initialize a SWARM Cluster&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ eval $(docker-machine env swarm-1)
$ docker swarm init --advertise-addr 172.16.140.107 --listen-addr 172.16.140.107:2377
Swarm initialized: current node (3x8vxeuhnh9mb83hzenudyl70) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join \
        --token
        SWMTKN-1-51ms3ga9iazxhn8ohh5n6whupxcch1bfdhmkvhnzq5hpzruwup-24hs62n9ih9w0bivvnlyr4k3m
        \
            172.16.140.144:2377

            To add a manager to this swarm, run 'docker swarm join-token
            manager' and follow the instructions.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Join each of our nodes as workers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repeat the following for each Swarm Node (swarm-&amp;lt;2-4&amp;gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ eval $(docker-machine env swarm-2)
$ docker swarm join \
    --token
    SWMTKN-1-51ms3ga9iazxhn8ohh5n6whupxcch1bfdhmkvhnzq5hpzruwup-24hs62n9ih9w0bivvnlyr4k3m
    \
        172.16.140.144:2377

        To add a manager to this swarm, run 'docker swarm join-token
        manager' and follow the instructions.
This node joined a swarm as a worker.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;THAT’S IT!!!&lt;/em&gt;  You’ve now got a basic Swarm Cluster depoloyed no your OpenStack Cloud!!&lt;/p&gt;
</description>
        <pubDate>Thu, 01 Sep 2016 00:00:00 -0600</pubDate>
        <link>https://j-griffith.github.io/articles/2016-09/how-to-swarm-on-openstack</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2016-09/how-to-swarm-on-openstack</guid>
        
        
      </item>
    
      <item>
        <title>OpenStack Cinders reference implementation</title>
        <description>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;

&lt;p&gt;As many are fully aware, over the years I’ve had pretty strong opinions about good and bad things in the OpenStack Cinder project.  Let’s be clear, most of the “bad” are criticisms against myself and how things evolved than they are about the project or the people contributing to it.&lt;/p&gt;

&lt;p&gt;Lately there’s been a resurgence of the “LVM as a reference implementation” discussion due to a comment I made on twitter about one off vendor features being in the Cinder API.  This created quite the buzz, ranging from “LVM sucks” to “Criticism doesn’t help the project”.  All of that aside, I wanted to point a few things out for people to think about on this topic.&lt;/p&gt;

&lt;p&gt;First, keep in mind the purpose of a “reference” implementation.  The WHOLE point of a reference implementation is to provide a reference for people to use in development.  LVM has been the reference because it most closely fits the model that other backend-devices use.  In particular iSCSI targets attached to LVM volumes, in my opinion provides a really flexible and dynamic transport/connect mechanism in a cloud environment.  Some argue that things like NFS are better.. and maybe in some cases that’s true, but the original design and architecture in OpenStack was to provide Block Storage, so in that context iSCSI was a pretty cheap and flexible way to go about it.  I’d also point out that iSCSI and networking in general have come a VERY long way in the last 5+ years!  This isn’t your old iSCSI where people were trying to attach storage over a 1G WAN and shockingly had “issues”.&lt;/p&gt;

&lt;p&gt;So, what’s wrong with LVM?  Well, if you ask me the only thing wrong with it is that the OpenStack community only has a very few people that are really interested in paying any attention to it.  There was a comment last week to the effect that “using LVM as a reference implementation makes me sad”, my response was “why”?  There seems to be a misconception that there are things LVM can’t do that other OSS products can (in a Cinder context), but I’ve yet to figure out what those things are?  If you look at the code on Github and do a check between features in LVM and features in other OSS drivers you won’t find “missing” API calls.  Of course, have fun trying to figure out the structure with the whole feature-class thing going on in the base driver to link things together and figure out what’s actually real and what’s not (I’ll save that whole topic for another day… or just keep it between me and the Cinder community).
  The point is, this statement that “LVM is bad because it can’t do things” is just plain false.  There’s no Cinder API feature that it’s not capable of, the only exception to this is some of the custom one-off API calls that have been added specifically for one or two proprietary vendors that nobody was creative enough, or spent the time or effort on to implement in the LVM driver.  We used to have a &lt;em&gt;rule&lt;/em&gt; that if you wanted to add a new feature or API call to Cinder, you had to FIRST implement it in the LVM driver.  Over time however Cinder grew, and folks decided this wasn’t such a big deal, and there should be exceptions.  So some vendors were allowed to add their own custom things.  The result, API calls in Cinder that may or may not work, and nobody EVER spending the time to go back and implement them in the Reference/LVM driver.  What’s also very telling here for me is to point out that these features that I was complaining about are NOT available in the other Open Source drivers either, Ceph included.  I’d also continue to assert as I have that the ONLY thing lacking with the LVM driver is interest from developers and the perpetual off-handed comments by people who don’t actually even know anything about how LVM works or the things that can be done with it.  Rather than say “LVM sucks”, maybe you should educate yourself on LVM a bit more and write some cinder/volume/drivers/lvm.py code.  I’ll admit, it requires a bit more effort than some other backends, and you certainly have to be creative.. but that’s the fun part.&lt;/p&gt;

&lt;p&gt;That brings me to my next point.  There’s been a few snarky comments about Ceph as the reference implementation.  Even better, there’s been some suggestions that “Vendors are thwarting this”, I find this almost as hilarious as I find it sad.  I’ve actually proposed the topic to a number of folks over the years, including at the Summit in Paris on a public panel with Sage Weil (creator and overall Ceph GURU).  The overwhelming response was “probably not a good idea”.  The reason for most folks that had that opinion was because Ceph is VERY different than any other storage backend.  In terms of a reference, it doesn’t necessarily help other technologies (iSCSI being predominant) .  Now, let me also say it again publicly and very clearly, I think Ceph is AWESOME, as do a lot of people deploying OpenStack.  It is not however the ONLY option.  If we wanted to deliver a product instead of a framework then yes, that might be what we’d want to consider.  The fact is though, we (OpenStack) are pretty explicit that we are NOT delivering a product, but we ARE building a framework.  I’d also point out that there are a lot of use cases out there, and there is no one product/backend that meets all of them.  There are very few large deployments these days that only have a single backend for Cinder.  Yes, I know there are exceptions here, but I’m saying “majority”.&lt;/p&gt;

&lt;p&gt;So where are we now?  Well, given where we are now maybe we should revisit this.  Here’s why; it turns out that earlier on a number of vendors didn’t follow the reference implementation anyway.  They either didn’t understand how it worked, didn’t care or didn’t like it.  So a number of the methods in the internal API do “different” things (or nothing) depending on the driver.  The problem with this is that then, a new developer comes along and wants to implement a driver.  They happen to notice Vendor-X’s driver does things a certain way that seems to align with their product so they use it as a template.  Now we have another driver that’s diverged.  Then the next developer comes along… he/she ends up taking some pieces from one driver, combined with some pieces from another driver that somebody in IRC worked on and pointed to in order to answer some questions.  What you end up with is inconsistency across all the drivers and a very tangled mess.  Remember what I said about criticism earlier?  Well, this is something that I criticize myself for.  As the person that started Cinder and the PTL for the first few years I should have caught these disparities in reviews and made sure they were fixed up.  I also should’ve made the reference cleaner and more clear so that there wouldn’t be questions about it.  I also should’ve continued my objections via -2’s for adding API methods that were NOT in the reference implementation.  Lessons learned, and that’s where the comments I’ve made on twitter came from over the past week.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I’m all for revisiting the topic of Cinder’s reference implementation, BUT do me a favor; if you’re going to participate please do some homework.  Make sure you at least have a general idea of what the capabilities, use cases and problems we’re trying to solve are.  Also, ask the question, are we “building a reference, or a default”, because they’re not necessarily the same thing.&lt;/strong&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 12 Feb 2016 00:00:00 -0700</pubDate>
        <link>https://j-griffith.github.io/articles/2016-02/openstack-cinders-reference-implementation</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2016-02/openstack-cinders-reference-implementation</guid>
        
        
      </item>
    
      <item>
        <title>Volume attach code flow in Cinder</title>
        <description>&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;header class=&quot;entry-header&quot; style=&quot;box-sizing: border-box; color: #444444; font-family: Merriweather, Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 30px;&quot;&gt;&lt;h1 class=&quot;entry-title&quot; style=&quot;border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-size: 2.61111em; font-style: inherit; font-weight: inherit; line-height: 1.26383em; margin: 30px 0px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;OpenStack Cinder – Volume Attach&amp;nbsp;flow&lt;/h1&gt;&lt;/header&gt;&lt;br /&gt;&lt;div class=&quot;entry-content&quot; style=&quot;border: 0px; box-sizing: border-box; font-family: Merriweather, Georgia, 'Times New Roman', serif; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h2 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Intro&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Something that comes up fairly often in IRC, is “how does attach work”? &amp;nbsp;From a Cinder perspective the code path is fairly simple, but it seems to throw people for a loop. &amp;nbsp;So, I figured why not take a look at the reference implementation and walk through the steps of volume attach from the Cinder side.&lt;/div&gt;&lt;h2 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Our Reference&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The Cinder project includes a reference driver, so we’ll use that as our reference here to walk through the code. &amp;nbsp;The reference driver is built in Cinder using a combination of LVM and iSCSI targets (tgt-adm or LIO most commonly). &amp;nbsp;As with everything in OpenStack you have choices, we’re just going to focus on the default options here, thick provisioned LVM and TgtAdm for the iSCSI component. &amp;nbsp;We’re also using the default libvirt/KVM config on our Nova side.&lt;/div&gt;&lt;h2 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;A few high level details&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;It’s important to understand that most of the work with respect to attaching a volume is done on the Nova side. &amp;nbsp;Cinder is mostly just responsible for providing a volumes information to Nova so that it can make an iSCSI attach on the Compute Node.&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The communication path between Nova and Cinder is done via the cinderclient, the same cinderclient a command line user accesses; however Nova uses a special policy that allows it to access some details about a volume that regular users can’t, as well as a few calls you might not have seen before.&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;So what we’re going to do is look at an OpenStack deployment that has a volume ready to go (available) and an Instance that’s up and ready. &amp;nbsp;We’ll focus on the calls from Nova to Cinder and Cinders response. &amp;nbsp;In a follow up post we’ll dig into what’s happening on the Nova side.&lt;/div&gt;&lt;h2 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Process flow&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;As I mentioned, things on the Cinder side are rather simple. &amp;nbsp;The attach process is just&amp;nbsp;three&amp;nbsp;calls to Cinder:&lt;/div&gt;&lt;ol style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin: 0px 0px 30px 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;reserve_volume&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;intialize_connection&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;attach&lt;/li&gt;&lt;/ol&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;reserve_volume(self, context, volume)&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;context: security/policy info for the request&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;volume: reference object of the volume being requested for reserve&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Probably the most simple call&amp;nbsp;in to Cinder. &amp;nbsp;This method simply checks that the specified volume is in an “available” state and can be attached. &amp;nbsp;Any other state results in an Error response notifying Nova that the volume is NOT available. &amp;nbsp;The only valid state for this call to succeed is “available”.&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;If the volume is in fact available, we immediately issue an update to the Cinder database and mark the status of the volume to “attaching” thereby reserving the volume so that it won’t be used by another API call anywhere else.&lt;/div&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;initialize_connection(self, context, volume, connector)&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;context: security/policy info for the request&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;volume: reference object of the volume being requested for reserve&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;connector: information about the initiator if needed (ie targets that use access groups etc)&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;This is the only Cinder API method that really has any significant work to do, and it’s the only one that really has any real interaction with the storage backend or driver. &amp;nbsp;This method is responsible for building and returning all of the info needed by Nova to actually attach the specified volume. &amp;nbsp;This method returns vital information to the caller (Nova) that includes things like CHAP credentials, iqn and lun information. &amp;nbsp;An example response is shown here:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{‘driver_volume_type': ‘iscsi’,&lt;/span&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; ‘data': {‘auth_password': ‘YZ2Hceyh7VySh5HY’,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘target_discovered': False,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘encrypted': False,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘qos_specs': None,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘target_iqn': ‘iqn.2010-10.org.openstack:volume-8b1ec3fe-8c5&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘target_portal': ‘11.0.0.8:3260′,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘volume_id': ‘8b1ec3fe-8c57-45ca-a1cf-a481bfc8fce2′,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘target_lun': 1,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘access_mode': ‘rw’,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘auth_username': ‘nE9PY8juynmmZ95F7Xb7′,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ‘auth_method': ‘CHAP’}}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;In the process of building this data structure, the Cinder manager makes a number of direct calls to the driver. &amp;nbsp;The manager itself has a single initialize_connection call of it's own, but ties together a number of driver calls from within that method. &amp;nbsp;&lt;span style=&quot;font-family: inherit; font-style: inherit; font-weight: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;driver.validate_connector&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-weight: normal;&quot;&gt; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;line-height: 1.2913em;&quot;&gt;Simply verifies that the initiator data is included in the passed in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 24.1731357574463px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-style: inherit; line-height: 24.1731357574463px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-style: inherit; line-height: 1.2913em;&quot;&gt;connector (there are some drivers that utilize pieces of this connector&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data, but in the case of the reference, it just verifies it's there).&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;driver.create_export&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-weight: normal; line-height: 1.2913em;&quot;&gt;This is the target specific, persistent data associated with a volume.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; This method is responsible for building an actual iSCSI target, and&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; providing the &quot;location&quot; and &quot;auth&quot; information which will be used to&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; form the response data in the parent request.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We call this infor the model_update and it's used to update vital target&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; information associated with the volume in the Cinder database.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;driver.intialize_connection&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff6600; line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-weight: normal; line-height: 1.2913em;&quot;&gt;Now that we've actually built a target and persisted the important&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bits of information associated with it, we're ready to actually assign&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the target to a volume and form the needed info to pass back out&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to our caller. &amp;nbsp;This is where we finally put everything together and&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; form the example data structure response shown earlier.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-weight: normal; line-height: 1.2913em;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; This method is sort of deceptive, it does a whole lot of formatting&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; of the data we've put together in the create_export call, but it doesn't&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; really offer any new info. &amp;nbsp;It's completely dependent on the information&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; that was gathered in the create_export call and put into the database. &amp;nbsp;At&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this point, all we're doing is taking all the various entries from the database&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and putting it together into the desired format/structure.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 1.2913em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The key method call for updating and obtaining all of this info was&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; done by the create_export call. &amp;nbsp;This formatted data is then passed&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; back up to the API and returned as the response back out to Nova.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 1.2913em;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 1.2913em;&quot;&gt;At this point Nova can use the returned info and actually make the iSCSI attach on the compute node, and then pass the volume into the requested Instance. &amp;nbsp;If there are no errors, the volume is now actually attached to the Instance as a /dev/vdX device and ready for use. &amp;nbsp;Remember however there was still one Cinder call left in our list: &amp;nbsp;attach.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;line-height: 1.2913em;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;attach(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;self, context, volume,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600; font-style: inherit; font-weight: inherit;&quot;&gt;instance_uuid, host_name,&lt;br /&gt;mount_point, mode)&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;context: security/policy info for the request&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;volume: reference object of the volume being requested for reserve&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;instance_uuid: UUID of the Nova instance we've attached to&lt;br /&gt;host_name: N/A for the reference driver&lt;br /&gt;mount_point: device mount point on the instance (/dev/vdb)&lt;br /&gt;mode: The attach mode of the Volume (rw, ro etc)&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;This is another method that falls into a category I call &quot;update methods&quot;. &amp;nbsp;It's purpose is to notify Cinder to update the status of the volume to &quot;in-use&quot; (attached) and to populate the database with the provided information regarding &quot;where&quot; it's attached to. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;This also provides a mechanism to send notifications and updates back to the driver. &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description>
        <pubDate>Thu, 16 Jul 2015 10:00:00 -0600</pubDate>
        <link>https://j-griffith.github.io/articles/2015-07/volume-attach-code-flow-in-cinder</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2015-07/volume-attach-code-flow-in-cinder</guid>
        
        
      </item>
    
      <item>
        <title>OpenStack Live Migration With Cinder Backed Instances</title>
        <description>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;

&lt;p&gt;Over the last several weeks I keep getting questions about Live Migration, does it work, how do you configure it, what are the requirements to use it and so on.  To be honest up until recently I hadn’t actually dove into Live Migration so I tried it out (and failed), then started asking around and resorting to Google Searches.  The good thing is, there’s TONS of information out there, problem is, there’s TONS of information out there.  The bad thing here is the info isn’t all that consistent.  Like many things there’s always more than one way to achieve an end result, Live Migration is really no different.  So I thought I’d try and write up what worked for me and in my opinion was the simplest method to use.&lt;/p&gt;

&lt;p&gt;First off, for those that aren’t familiar; Live Migration of OpenStack Instances is the process of migrating an OpenStack Instance from one Compute Node to another with little or no downtime.  The docs page has a good description here: &lt;a href=&quot;http://docs.openstack.org/admin-guide-cloud/content/section_configuring-compute-migrations.html&quot;&gt;OpenStack Admin-Guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the big misconceptions about Live Migration is that if you’re Instances aren’t stored on a Shared FS or a Shared backend device like CEPH you can’t do Live-Migration.  That’s not true at all, in fact notice the doc has an entry specifically for Volume-Backed Instances.  So let’s take a look at how to create a Volume-Backed Instance using Juno and migrate it from one Compute Host to another.&lt;/p&gt;

&lt;p&gt;First, my config; I’ve set up a multi-node deployment using devstack stable/juno.  I went ahead and configured Cinder to run multiple backends, in my case SolidFire and LVM because I wanted to test both and make sure everything worked properly.  For info on Cinder Multi-Backend checkout the wiki here: &lt;a href=&quot;https://wiki.openstack.org/wiki/Cinder-multi-backend&quot;&gt;Cinder multi-backend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I chose to specify ssh as my connection method for live-migration.  There are of course other ways to do this by configuring libvirt and qemu, which you can check out here: &lt;a href=&quot;https://libvirt.org/uri.html&quot;&gt;libvirt config&lt;/a&gt; but rather than do any of that I just wanted to put a simple entry in my nova.conf file and use ssh.  Here’s the libvirt section of my nova.conf:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[libvirt]
inject_partition = -2
use_usb_tablet = False
cpu_mode = none
virt_type = kvm
live_migration_uri = qemu+ssh://root@%s/system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice I’m using root here in my connection.  I’ve used “regular” accounts with sudo permissions before to do remote connections to libvirt, but there’s something about the process from Nova that the Key Verification will fail for any user other than ‘root’.  If anybody knows how to fix this up let me know, It’d be great to learn what I’m missing here.  For those that are interested in more detail, my nova.conf other than the entry here is just the defaults from devstack.  Here’s a link to my nova.conf on the controller/compute: /etc/nova/nova.conf.  I’ve also added a link to my devstack local.conf; in this setup I actually started with a SolidFire deployment and manually updated cinder.conf to do multi-backend with LVM and added the default volume-type: devstack local.conf&lt;/p&gt;

&lt;p&gt;So since we’re using ssh and root, you’ve probably guessed we’re going to need to setup ssh keys between our compute nodes.  I went ahead and setup root keys on each of the compute nodes, and installed each machines key on all of the nodes just doing a simple ssh-copy-id.  You may want to get a bit more sophisticated, distribute a key and modify /root/.ssh/config to include entries for each of the compute nodes.  Something like this should do the trick:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Host fluffy-compute
HostName fluffy-compute
User root
IdentityFile ~/.ssh/live-migrationkey.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Verify you can ssh as root to-&amp;gt;from each of the Compute nodes, restart Nova Compute services and you &lt;em&gt;should&lt;/em&gt; be ready to go.  Notice there I said &lt;em&gt;should&lt;/em&gt;, what i found out was things didn’t work.  I’d get an error message stating that I couldn’t do live migration because I wasn’t using shared storage… huh?  What’s up with that?&lt;/p&gt;

&lt;p&gt;So it turns out there was a bug introduced during the Juno development cycle.  You can check out the bug on LaunchPad here:&lt;a href=&quot;https://bugs.launchpad.net/nova/+bug/1392773&quot;&gt;LP-Bug&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fortunately there’s a proposal up for master already that can be pulled down (and hopefully will merge soon), but I was running Juno, so I put together a quick backport to try out.  Note this path isn’t quite complete, needs some method signature updates for the other hypervisors in OpenStack and of course Unit Tests.  Anyway, you can check out what I started via this &lt;a href=&quot;https://gist.github.com/j-griffith/5e9be4e6548a03697dc5&quot;&gt;gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I went ahead an applied the Juno patch from the gist above, restarted all of my Nova services and tried again.  Here’s how things go:&lt;/p&gt;

&lt;p&gt;First, grab the image-id you want to use and create a Cinder Volume with it…&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID                                   | Name                            | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 40520350-25c7-4786-9586-5430d52d7663 | RedHat 6.5 Server               | ACTIVE |        |
| 8a69ae88-a729-4d68-a7e6-25048b1cf885 | RedHat 7.0 Server               | ACTIVE |        |
| afaa2feb-3a58-4e72-bebd-38f66bd0b611 | Ubuntu 14.04 Server             | ACTIVE |        |
| 28b77f27-a922-4627-8b1d-f0df627be907 | cirros-0.3.2-x86_64-uec         | ACTIVE |        |
| 63c173cd-3f5a-49ff-89ab-8c90a1701808 | cirros-0.3.2-x86_64-uec-kernel  | ACTIVE |        |
| e3aa2ab0-383c-4f75-bdc0-dbee86645ad5 | cirros-0.3.2-x86_64-uec-ramdisk | ACTIVE |        |
+--------------------------------------+---------------------------------+--------+--------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$ cinder create --image-id \
afaa2feb-3a58-4e72-bebd-38f66bd0b611 --display-name trusty-volume 10
+---------------------------------------+--------------------------------------+
| Property                              | Value |
+---------------------------------------+--------------------------------------+
| attachments                           | []                                   |
| availability_zone                     | nova                                 |
| bootable                              | false                                |
| consistencygroup_id                   | None                                 |
| created_at                            | 2014-12-08T17:34:50.000000           |
| description                           | None                                 |
| encrypted                             | False                                |
| id                                    | 6419112b-bf40-4994-809f-12dce25f5f1f |
| metadata                              | {}                                   |
| name                                  | trusty-volume                        |
| os-vol-host-attr:host                 | None                                 |
| os-vol-mig-status-attr:migstat        | None                                 |
| os-vol-mig-status-attr:name_id        | None                                 |
| os-vol-tenant-attr:tenant_id          | 56dc791650074cc9a2858bd5053a7116     |
| os-volume-replication:driver_data     | None                                 |
| os-volume-replication:extended_status | None                                 |
| replication_status                    | disabled                             |
| size                                  | 10                                   |
| snapshot_id                           | None                                 |
| source_volid                          | None                                 |
| status                                | creating                             |
| user_id                               | 3dcc1572d7594a4eb6b043b819e415de     |
| volume_type                           | solidfire                            |
+---------------------------------------+--------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$cinder list
+--------------------------------------+-----------+---------------+------+-------------+----------+-------------+
| ID                                   | Status    | Name          | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------------+------+-------------+----------+-------------+
| 6419112b-bf40-4994-809f-12dce25f5f1f | available | trusty-volume | 10   | solidfire   | true     |             |
+--------------------------------------+-----------+---------------+------+-------------+----------+-------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$ nova boot --flavor 2 --block-device-mapping \
vda=6419112b-bf40-4994-809f-12dce25f5f1f --key-name fluffycloud trusty-migrate
+--------------------------------------+--------------------------------------------------+
| Property                             | Value                                            |
+--------------------------------------+--------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                           |
| OS-EXT-AZ:availability_zone          | nova                                             |
| OS-EXT-SRV-ATTR:host                 | -                                                |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000002                                |
| OS-EXT-STS:power_state               | 0                                                |
| OS-EXT-STS:task_state                | scheduling                                       |
| OS-EXT-STS:vm_state                  | building                                         |
| OS-SRV-USG:launched_at               | -                                                |
| OS-SRV-USG:terminated_at             | -                                                |
| accessIPv4                           |                                                  |
| accessIPv6                           |                                                  |
| adminPass                            | rKL9sfs2vPs4                                     |
| config_drive                         |                                                  |
| created                              | 2014-12-08T17:41:39Z                             |
| flavor                               | m1.small (2)                                     |
| hostId                               |                                                  |
| id                                   | 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904             |
| image                                | Attempt to boot from volume - no image supplied  |
| key_name                             | fluffycloud                                      |
| metadata                             | {}                                               |
| name                                 | trusty-migrate                                   |
| os-extended-volumes:volumes_attached | [{6419112b-bf40-4994-809f-12dce25f5f1f&amp;amp;quot;}]   |
| progress                             | 0                                                |
| security_groups                      | default                                          |
| status                               | BUILD                                            |
| tenant_id                            | 56dc791650074cc9a2858bd5053a7116                 |
| updated                              | 2014-12-08T17:41:39Z                             |
| user_id                              | 3dcc1572d7594a4eb6b043b819e415de                 |
+--------------------------------------+--------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$ nova list
+--------------------------------------+----------------+--------+------------+-------------+------------------+
| ID                                   | Name           | Status | Task State | Power State | Networks         |
+--------------------------------------+----------------+--------+------------+-------------+------------------+
| 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904 | trusty-migrate | ACTIVE | -          | Running     | private=10.1.0.2 |
+--------------------------------------+----------------+--------+------------+-------------+------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ubuntu@fluffy-master:~$ nova show 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904
+--------------------------------------+----------------------------------------------------------+
| Property                             | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-SRV-ATTR:host                 | fluffy-compute                                           |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | fluffy-compute                                           |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000002                                        |
| OS-EXT-STS:power_state               | 1                                                        |
| OS-EXT-STS:task_state                | -                                                        |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2014-12-08T17:41:47.000000                               |
| OS-SRV-USG:terminated_at             | -                                                        |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| config_drive                         |                                                          |
| created                              | 2014-12-08T17:41:39Z                                     |
| flavor                               | m1.small (2)                                             |
| hostId                               | 48adbabbab9babab4c8948d3478e9d2fae8ffb407bab1ca21a843981 |
| id                                   | 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904                     |
| image                                | Attempt to boot from volume - no image supplied          |
| key_name                             | fluffycloud                                              |
| metadata                             | {}                                                       |
| name                                 | trusty-migrate                                           |
| os-extended-volumes:volumes_attached | [{6419112b-bf40-4994-809f-12dce25f5f1f;}]                |
| private network                      | 10.1.0.2                                                 |
| progress                             | 0                                                        |
| security_groups                      | default                                                  |
| status                               | ACTIVE                                                   |
| tenant_id                            | 56dc791650074cc9a2858bd5053a7116                         |
| updated                              | 2014-12-08T17:41:47Z                                     |
| user_id                              | 3dcc1572d7594a4eb6b043b819e415de                         |
+--------------------------------------+----------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    ubuntu@fluffy-master:~$ubuntu@fluffy-master:~$ nova live-migration \
	9afb79e1-f07a-4c98-9d6c-9ce66dcbf904
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    ubuntu@fluffy-master:~$ nova list
    +--------------------------------------+----------------+-----------+------------+-------------+------------------+
    | ID | Name | Status | Task State | Power State | Networks |
    +--------------------------------------+----------------+-----------+------------+-------------+------------------+
    | 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904 | trusty-migrate | MIGRATING | migrating | Running | private=10.1.0.2 |
    +--------------------------------------+----------------+-----------+------------+-------------+------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    ubuntu@fluffy-master:~$nova list
    +--------------------------------------+----------------+--------+------------+-------------+------------------+
    | ID | Name | Status | Task State | Power State | Networks |
    +--------------------------------------+----------------+--------+------------+-------------+------------------+
    | 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904 | trusty-migrate | ACTIVE | - | Running | private=10.1.0.2 |
    +--------------------------------------+----------------+--------+------------+-------------+------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    ubuntu@fluffy-master:~$ nova show 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904
    +--------------------------------------+----------------------------------------------------------+
    | Property                             | Value                                                    |
    +--------------------------------------+----------------------------------------------------------+
    | OS-DCF:diskConfig                    | MANUAL                                                   |
    | OS-EXT-AZ:availability_zone          | nova                                                     |
    | OS-EXT-SRV-ATTR:host                 | fluffy-master                                            |
    | OS-EXT-SRV-ATTR:hypervisor_hostname  | fluffy-master                                            |
    | OS-EXT-SRV-ATTR:instance_name        | instance-00000002                                        |
    | OS-EXT-STS:power_state               | 1                                                        |
    | OS-EXT-STS:task_state                | -                                                        |
    | OS-EXT-STS:vm_state                  | active                                                   |
    | OS-SRV-USG:launched_at               | 2014-12-08T17:41:47.000000                               |
    | OS-SRV-USG:terminated_at             | -                                                        |
    | accessIPv4                           |                                                          |
    | accessIPv6                           |                                                          |
    | config_drive                         |                                                          |
    | created                              | 2014-12-08T17:41:39Z                                     |
    | flavor                               | m1.small (2)                                             |
    | hostId                               | 97a1a99eaf8e1fab2ea7cb0be641ff55f2da5df4e68d0ecb62293e00 |
    | id                                   | 9afb79e1-f07a-4c98-9d6c-9ce66dcbf904                     |
    | image                                | Attempt to boot from volume - no image supplied          |
    | key_name                             | fluffycloud                                              |
    | metadata                             | {}                                                       |
    | name                                 | trusty-migrate                                           |
    | os-extended-volumes:volumes_attached | [{6419112b-bf40-4994-809f-12dce25f5f1f}]                 |
    | private network                      | 10.1.0.2                                                 |
    | progress                             | 0                                                        |
    | security_groups                      | default                                                  |
    | status                               | ACTIVE                                                   |
    | tenant_id                            | 56dc791650074cc9a2858bd5053a7116                         |
    | updated                              | 2014-12-08T17:41:47Z                                     |
    | user_id                              | 3dcc1572d7594a4eb6b043b819e415de                         |
    +--------------------------------------+----------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pretty cool eh?  As always feedback is more than welcome.  Also, if you have specific OpenStack / Cinder related topics you might want to see more about, drop me a line or post a comment.&lt;/p&gt;

&lt;p&gt;Thanks!!!&lt;/p&gt;

</description>
        <pubDate>Mon, 08 Dec 2014 00:00:00 -0700</pubDate>
        <link>https://j-griffith.github.io/articles/2014-12/openstack-live-migration-with-cinder-backed-instances</link>
        <guid isPermaLink="true">https://j-griffith.github.io/articles/2014-12/openstack-live-migration-with-cinder-backed-instances</guid>
        
        
      </item>
    
  </channel>
</rss>
