{"id":1061,"date":"2015-05-25T22:21:16","date_gmt":"2015-05-26T02:21:16","guid":{"rendered":"http:\/\/blog.domb.net\/?p=1061"},"modified":"2015-05-25T22:34:05","modified_gmt":"2015-05-26T02:34:05","slug":"ceph-for-cinder-and-glance-in-openstack-juno-part-4-building-the-ceph-cluster","status":"publish","type":"post","link":"https:\/\/blog.domb.net\/?p=1061","title":{"rendered":"Ceph for Cinder and Glance in OpenStack Juno Part 4 \u2013 Building the Ceph Cluster"},"content":{"rendered":"<p><strong>Part 4<\/strong> of the post series is going to walk you through how to transform a qcow2 image into raw via rbd. All credits for this post go to Sebastian Han who wrote this <a href=\"http:\/\/www.sebastien-han.fr\/blog\/2014\/11\/11\/openstack-glance-import-images-and-convert-them-directly-in-ceph\/\">OpenStack Glance: Import Images and Convert Them Directly in Ceph<\/a><\/a>. <\/p>\n<p>Make sure you set<br \/>\n<strong>rbd default format = 2 <\/strong><br \/>\nin the ceph.conf client section<\/p>\n<p>1. Download the image, transform it, and upload it into glance.<\/p>\n<pre>\r\n[root@controller ~(keystone_admin)]# wget http:\/\/download.cirros-cloud.net\/0.3.4\/cirros-0.3.4-x86_64-disk.img\r\n[root@controller ~(keystone_admin)]# rbd -p images --image-format 2 import cirros-0.3.4-x86_64-disk.img $(uuidgen)\r\n[root@controller ~(keystone_admin)]# rbd -p images ls\r\n[root@controller ~(keystone_admin)]# rbd -p images info 949f0f10-b889-4185-8ff0-1539667232c4\r\n[root@controller ~(keystone_admin)]# qemu-img convert -O raw rbd:images\/949f0f10-b889-4185-8ff0-1539667232c4 rbd:images\/$(uuidgen)\r\n[root@controller ~(keystone_admin)]# rbd -p images ls\r\n[root@controller ~(keystone_admin)]# qemu-img info rbd:\/images\/0f5b8064-4db3-4730-bed5-d5d1ee99df88\r\n[root@controller ~(keystone_admin)]# rbd -p images ls\r\n[root@controller ~(keystone_admin)]# qemu-img info rbd:images\/0f5b8064-4db3-4730-bed5-d5d1ee99df88\r\n[root@controller ~(keystone_admin)]# rbd -p images rm 949f0f10-b889-4185-8ff0-1539667232c4\r\n[root@controller ~(keystone_admin)]# rbd --pool images snap create --snap snap 0f5b8064-4db3-4730-bed5-d5d1ee99df88\r\n[root@controller ~(keystone_admin)]# rbd --pool images snap protect --image 0f5b8064-4db3-4730-bed5-d5d1ee99df88 --snap snap\r\n[root@controller ~(keystone_admin)]# rbd -p images snap ls 0f5b8064-4db3-4730-bed5-d5d1ee99df88\r\n[root@controller ~(keystone_admin)]# glance image-create --id 0f5b8064-4db3-4730-bed5-d5d1ee99df88 --name CirrosImport --store rbd --disk-format raw --container-format bare --location rbd:\/\/$(ceph fsid)\/images\/0f5b8064-4db3-4730-bed5-d5d1ee99df88\/snap\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Part 4 of the post series is going to walk you through how to transform a qcow2 image into raw via rbd. All credits for this post go to Sebastian Han who wrote this OpenStack Glance: Import Images and Convert Them Directly in Ceph. Make sure you set rbd default format = 2 in the&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[3,36],"tags":[39],"class_list":["post-1061","post","type-post","status-publish","format-standard","hentry","category-linux","category-openstack","tag-glance-raw-qcow"],"_links":{"self":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1061"}],"version-history":[{"count":5,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1061\/revisions"}],"predecessor-version":[{"id":1066,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/1061\/revisions\/1066"}],"wp:attachment":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}