From 5af0209a0681fbc4855922c74a6a7a637d8a63aa Mon Sep 17 00:00:00 2001 From: alop Date: Thu, 2 May 2013 13:47:43 -0700 Subject: [PATCH 1/3] templatizing the default rbd values for ceph. This will allow us to modify them easily in the future --- attributes/default.rb | 5 +++++ templates/default/cinder.conf.erb | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index bad1080..7b56df9 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -106,6 +106,11 @@ default["cinder"]["volume"]["volume_driver"] = "cinder.volume.driver.ISCSIDriver default["cinder"]["volume"]["volume_group"] = "cinder-volumes" default["cinder"]["volume"]["iscsi_helper"] = "tgtadm" +# Ceph/RADOS options +default["cinder"]["rbd_pool"] = "rbd" +default["cinder"]["rbd_user"] = nil +default["cinder"]["rbd_secret_uuid"] = nil + case platform when "fedora", "redhat", "centos" # :pragma-foodcritic: ~FC024 - won't fix this default["cinder"]["platform"] = { diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index d6c05f9..df38d20 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -537,13 +537,13 @@ volume_group=<%= node["cinder"]["volume"]["volume_group"] %> # iscsi_port=3260 #### (IntOpt) The port that the iSCSI daemon is listening on -# rbd_pool=rbd +rbd_pool=<%= node["cinder"]["rbd_pool"] %> #### (StrOpt) the RADOS pool in which rbd volumes are stored -# rbd_user= +rbd_user=<%= node["cinder"]["rbd_user"] %> #### (StrOpt) the RADOS client name for accessing rbd volumes -# rbd_secret_uuid= +rbd_secret_uuid=<%= node["cinder"]["rbd_secret_uuid"] %> #### (StrOpt) the libvirt uuid of the secret for the rbd_uservolumes # volume_tmp_dir= From 23c12d6b830094ca10be83476ea10c47d4ceb65b Mon Sep 17 00:00:00 2001 From: alop Date: Thu, 2 May 2013 13:51:51 -0700 Subject: [PATCH 2/3] added the readme lines for the new options --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c77bfe5..8a038a1 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ Attributes * `cinder["volume"]["volume_group"]` - Name for the VG that will contain exported volumes * `cinder["volume"]["iscsi_helper"]` - ISCSI target user-land tool to use * `cinder["netapp"]["enabled"]` - Enable netapp-specific options +* `cinder["rbd_pool"]` - RADOS Block Device pool to use +* `cinder["rbd_user"]` - User for Cephx Authentication +* `cinder["rbd_secret_uuid"]` - Secret UUID for Cephx Authentication Templates ===== From de6fed1fafc77fe62d7fdce0c5257be7f97705f4 Mon Sep 17 00:00:00 2001 From: alop Date: Thu, 2 May 2013 14:05:50 -0700 Subject: [PATCH 3/3] Only uncomment the rbd options if the volume_driver is cinder.volume.driver.RBDDriver --- templates/default/cinder.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index df38d20..fe1cb58 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -536,7 +536,7 @@ volume_group=<%= node["cinder"]["volume"]["volume_group"] %> # iscsi_port=3260 #### (IntOpt) The port that the iSCSI daemon is listening on - +<% if node["cinder"]["volume"]["volume_driver"] == 'cinder.volume.driver.RBDDriver' %> rbd_pool=<%= node["cinder"]["rbd_pool"] %> #### (StrOpt) the RADOS pool in which rbd volumes are stored @@ -545,7 +545,7 @@ rbd_user=<%= node["cinder"]["rbd_user"] %> rbd_secret_uuid=<%= node["cinder"]["rbd_secret_uuid"] %> #### (StrOpt) the libvirt uuid of the secret for the rbd_uservolumes - +<% end %> # volume_tmp_dir= #### (StrOpt) where to store temporary image files if the volume driver #### does not write them directly to the volume