RBD: Report discard is supported

The RBD driver has supported discard (trim/unmap) since [1]. This patch
makes the driver advertise that it does so. Based on how the setting is
implemented, it is safe to hard code the value:

  "Report to clients of Cinder that the backend supports discard
  (aka. trim/unmap). This will not actually change the behavior of
  the backend or the client directly, it will only notify that it
  can be used."

[1] I094163b99d858384584966d65e9d8756c74a0c15

Change-Id: I2f1a4214c3a0561e6df99e8234a9b98f14139264
This commit is contained in:
Alan Bishop 2018-12-07 10:19:15 -05:00
parent 3dea19f0c0
commit c3b96f88e8
2 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,7 @@ define cinder::backend::rbd (
"${name}/rados_connection_retries": value => $rados_connection_retries;
"${name}/rbd_store_chunk_size": value => $rbd_store_chunk_size;
"${name}/rbd_cluster_name": value => $rbd_cluster_name_real;
"${name}/report_discard_supported": value => true;
}
if $manage_volume_type {

View File

@ -42,6 +42,7 @@ describe 'cinder::backend::rbd' do
should contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value(req_params[:rados_connection_interval])
should contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value(req_params[:rados_connection_retries])
should contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value(req_params[:rbd_store_chunk_size])
should contain_cinder_config("#{req_params[:volume_backend_name]}/report_discard_supported").with_value(true)
}
context 'with another RBD backend' do
@ -60,6 +61,7 @@ describe 'cinder::backend::rbd' do
it { should contain_cinder_config("ceph2/rbd_cluster_name").with_value('ceph2') }
it { should contain_cinder_config("ceph2/rbd_pool").with_value('volumes2') }
it { should contain_cinder_config("ceph2/rbd_user").with_value('test2') }
it { should contain_cinder_config("ceph2/report_discard_supported").with_value(true) }
end
context 'rbd backend with additional configuration' do