Merge "Add Ceph BlueStore Compression support"
This commit is contained in:
commit
c8ceb21bf9
|
@ -55,3 +55,69 @@ options:
|
||||||
override YAML files in the service's policy.d directory. The resource
|
override YAML files in the service's policy.d directory. The resource
|
||||||
file should be a ZIP file containing at least one yaml file with a .yaml
|
file should be a ZIP file containing at least one yaml file with a .yaml
|
||||||
or .yml extension. If False then remove the overrides.
|
or .yml extension. If False then remove the overrides.
|
||||||
|
bluestore-compression-algorithm:
|
||||||
|
type: string
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Compressor to use (if any) for pools requested by this charm.
|
||||||
|
.
|
||||||
|
NOTE: The ceph-osd charm sets a global default for this value (defaults
|
||||||
|
to 'lz4' unless configured by the end user) which will be used unless
|
||||||
|
specified for individual pools.
|
||||||
|
bluestore-compression-mode:
|
||||||
|
type: string
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Policy for using compression on pools requested by this charm.
|
||||||
|
.
|
||||||
|
'none' means never use compression.
|
||||||
|
'passive' means use compression when clients hint that data is
|
||||||
|
compressible.
|
||||||
|
'aggressive' means use compression unless clients hint that
|
||||||
|
data is not compressible.
|
||||||
|
'force' means use compression under all circumstances even if the clients
|
||||||
|
hint that the data is not compressible.
|
||||||
|
bluestore-compression-required-ratio:
|
||||||
|
type: float
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
The ratio of the size of the data chunk after compression relative to the
|
||||||
|
original size must be at least this small in order to store the
|
||||||
|
compressed version on pools requested by this charm.
|
||||||
|
bluestore-compression-min-blob-size:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Chunks smaller than this are never compressed on pools requested by
|
||||||
|
this charm.
|
||||||
|
bluestore-compression-min-blob-size-hdd:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Value of bluestore compression min blob size for rotational media on
|
||||||
|
pools requested by this charm.
|
||||||
|
bluestore-compression-min-blob-size-ssd:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Value of bluestore compression min blob size for solid state media on
|
||||||
|
pools requested by this charm.
|
||||||
|
bluestore-compression-max-blob-size:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Chunks larger than this are broken into smaller blobs sizing bluestore
|
||||||
|
compression max blob size before being compressed on pools requested by
|
||||||
|
this charm.
|
||||||
|
bluestore-compression-max-blob-size-hdd:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Value of bluestore compression max blob size for rotational media on
|
||||||
|
pools requested by this charm.
|
||||||
|
bluestore-compression-max-blob-size-ssd:
|
||||||
|
type: int
|
||||||
|
default:
|
||||||
|
description: |
|
||||||
|
Value of bluestore compression max blob size for solid state media on
|
||||||
|
pools requested by this charm.
|
||||||
|
|
|
@ -149,11 +149,11 @@ def cluster_connected(hacluster):
|
||||||
|
|
||||||
|
|
||||||
@reactive.when_not('is-update-status-hook')
|
@reactive.when_not('is-update-status-hook')
|
||||||
@reactive.when_not('ceph.create_pool.req.sent')
|
|
||||||
@reactive.when('storage-ceph.connected')
|
@reactive.when('storage-ceph.connected')
|
||||||
def storage_ceph_connected(ceph):
|
def storage_ceph_connected():
|
||||||
ceph.create_pool(hookenv.service_name())
|
storage_ceph = reactive.endpoint_from_flag('storage-ceph.connected')
|
||||||
reactive.set_state('ceph.create_pool.req.sent')
|
with charm.provide_charm_instance() as charm_instance:
|
||||||
|
charm_instance.create_pool(storage_ceph)
|
||||||
|
|
||||||
|
|
||||||
@reactive.when_not('is-update-status-hook')
|
@reactive.when_not('is-update-status-hook')
|
||||||
|
@ -201,11 +201,3 @@ def provide_gnocchi_url(metric_service):
|
||||||
hookenv.log("Providing gnocchi URL: {}"
|
hookenv.log("Providing gnocchi URL: {}"
|
||||||
.format(charm_class.public_url), hookenv.DEBUG)
|
.format(charm_class.public_url), hookenv.DEBUG)
|
||||||
metric_service.set_gnocchi_url(charm_class.public_url)
|
metric_service.set_gnocchi_url(charm_class.public_url)
|
||||||
|
|
||||||
|
|
||||||
@reactive.when_not('is-update-status-hook')
|
|
||||||
@reactive.when('storage-ceph.needed')
|
|
||||||
@reactive.when_not('storage-ceph.connected')
|
|
||||||
@reactive.when_not('storage-ceph.pools.available')
|
|
||||||
def reset_state_create_pool_req_sent():
|
|
||||||
reactive.remove_state('ceph.create_pool.req.sent')
|
|
||||||
|
|
|
@ -17,8 +17,7 @@ gate_bundles:
|
||||||
- test-s3: focal-ussuri-s3
|
- test-s3: focal-ussuri-s3
|
||||||
- test-s3: focal-victoria-s3
|
- test-s3: focal-victoria-s3
|
||||||
smoke_bundles:
|
smoke_bundles:
|
||||||
- bionic-train
|
- focal-ussuri
|
||||||
- test-s3: bionic-train-s3
|
|
||||||
dev_bundles:
|
dev_bundles:
|
||||||
- eoan-train
|
- eoan-train
|
||||||
- groovy-victoria
|
- groovy-victoria
|
||||||
|
@ -33,6 +32,7 @@ configure:
|
||||||
tests:
|
tests:
|
||||||
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiTest
|
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiTest
|
||||||
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiExternalCATest
|
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiExternalCATest
|
||||||
|
- zaza.openstack.charm_tests.ceph.tests.BlueStoreCompressionCharmOperation
|
||||||
- test-s3:
|
- test-s3:
|
||||||
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiS3Test
|
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiS3Test
|
||||||
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiTest
|
- zaza.openstack.charm_tests.gnocchi.tests.GnocchiTest
|
||||||
|
|
|
@ -90,7 +90,6 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks):
|
||||||
'is-update-status-hook',
|
'is-update-status-hook',
|
||||||
),
|
),
|
||||||
'storage_ceph_connected': (
|
'storage_ceph_connected': (
|
||||||
'ceph.create_pool.req.sent',
|
|
||||||
'is-update-status-hook',
|
'is-update-status-hook',
|
||||||
),
|
),
|
||||||
'configure_ceph': (
|
'configure_ceph': (
|
||||||
|
@ -103,11 +102,6 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks):
|
||||||
'is-update-status-hook',
|
'is-update-status-hook',
|
||||||
'storage-ceph.pools.available',
|
'storage-ceph.pools.available',
|
||||||
),
|
),
|
||||||
'reset_state_create_pool_req_sent': (
|
|
||||||
'is-update-status-hook',
|
|
||||||
'storage-ceph.connected',
|
|
||||||
'storage-ceph.pools.available',
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
# test that the hooks were registered via the
|
# test that the hooks were registered via the
|
||||||
|
@ -143,14 +137,13 @@ class TestHandlers(test_utils.PatchHelper):
|
||||||
handlers.init_db()
|
handlers.init_db()
|
||||||
self.gnocchi_charm.db_sync.assert_called_once_with()
|
self.gnocchi_charm.db_sync.assert_called_once_with()
|
||||||
|
|
||||||
@mock.patch.object(handlers, 'hookenv')
|
def test_storage_ceph_connected(self):
|
||||||
def test_storage_ceph_connected(self, hookenv):
|
self.patch_object(handlers.reactive, 'endpoint_from_flag')
|
||||||
mock_ceph = mock.MagicMock()
|
handlers.storage_ceph_connected()
|
||||||
hookenv.service_name.return_value = 'mygnocchi'
|
self.endpoint_from_flag.assert_called_once_with(
|
||||||
handlers.storage_ceph_connected(mock_ceph)
|
'storage-ceph.connected')
|
||||||
mock_ceph.create_pool.assert_called_once_with(
|
self.gnocchi_charm.create_pool.assert_called_once_with(
|
||||||
'mygnocchi',
|
self.endpoint_from_flag())
|
||||||
)
|
|
||||||
|
|
||||||
def test_configure_ceph(self):
|
def test_configure_ceph(self):
|
||||||
mock_ceph = mock.MagicMock()
|
mock_ceph = mock.MagicMock()
|
||||||
|
@ -189,8 +182,3 @@ class TestHandlers(test_utils.PatchHelper):
|
||||||
mock_gnocchi.set_gnocchi_url.assert_called_once_with(
|
mock_gnocchi.set_gnocchi_url.assert_called_once_with(
|
||||||
"http://gnocchi:8041"
|
"http://gnocchi:8041"
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_reset_state_create_pool_req_sent(self):
|
|
||||||
self.patch_object(handlers.reactive, 'remove_state')
|
|
||||||
handlers.reset_state_create_pool_req_sent()
|
|
||||||
self.remove_state.assert_called_once_with('ceph.create_pool.req.sent')
|
|
||||||
|
|
Loading…
Reference in New Issue