{"id":1139,"date":"2018-06-29T23:14:08","date_gmt":"2018-06-29T23:14:08","guid":{"rendered":"http:\/\/mohamede.com\/?p=1139"},"modified":"2018-06-29T23:14:08","modified_gmt":"2018-06-29T23:14:08","slug":"migrating-vms-with-attached-rbds","status":"publish","type":"post","link":"https:\/\/mohamede.com\/?p=1139","title":{"rendered":"Migrating VMs with attached RBDs"},"content":{"rendered":"<p>From the title, this is obviously a very common scenario that you may want to do. One thing that we rarely think about though is &#8220;backends&#8221; for the attached volumes when we create volumes.<\/p>\n<p>When you create a volume, the volume is created on a cinder backend and kept attached to this backend until it&#8217;s deleted , or migrated to another backend. The backends are defined in cinder configuration and are provided by your host(s) running the cinder-volume service. To find your backends, run the following command<\/p>\n<pre>cinder get-pools<\/pre>\n<p>When you attach the volume to a VM,\u00a0 the volume keeps its backend. It relies on this backend to do any operations to that volume. This includes migrating the VM from a host to another.<\/p>\n<p>You may run into a scenario where you get this error when trying to migrate a VM with attached RBD<\/p>\n<pre>\u00a0CinderConnectionFailed: Connection to cinder host failed: Unable to establish connection to<\/pre>\n<p>But when you go and check, Cinder is working correctly. You are able to create new volumes and attach them to instances. But a particular VM is unable to migrate. You may find also you&#8217;r unable to snapshot the volume attached to the VM. The thing to check for here is the RBD backend of the volume<\/p>\n<p>You can find this using<\/p>\n<pre>cinder show VOLUME_ID<\/pre>\n<p>this will show you alot of details on the volume including the following attribute<\/p>\n<pre>| os-vol-host-attr:host | HOSTNAME@ceph#RBD |<\/pre>\n<p>HOSTNAME will likely be &#8220;one&#8221; of your controllers. You will need to go and check that cinder-volume service is running correctly on that controller. If it&#8217;s down, you can&#8217;t operate that volume for anything (snapshots, attach\/detach and migrate)<\/p>\n<p>If you&#8217;ve lost your controller forever, or you were testing a new backend that no longer exists, then you might want to migrate the volume from the dead backend. This is detailed in the following manual<\/p>\n<pre>https:\/\/docs.openstack.org\/cinder\/pike\/admin\/blockstorage-volume-migration.html<\/pre>\n<p>Happy VM migrations !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the title, this is obviously a very common scenario that you may want to do. One thing that we rarely think about though is &#8220;backends&#8221; for the attached volumes when we create volumes. When you create a volume, the volume is created on a cinder backend and kept attached to this backend until it&#8217;s<a class=\"read-more \" href=\"https:\/\/mohamede.com\/?p=1139\" title=\"Read More\"> <span class=\"button default\">Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,10],"tags":[],"class_list":["post-1139","post","type-post","status-publish","format-standard","hentry","category-ceph","category-cinder","category-openstack"],"_links":{"self":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts\/1139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1139"}],"version-history":[{"count":0,"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts\/1139\/revisions"}],"wp:attachment":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}