From 15e158f6ebb270639ec3a69633ca44d199b6ac60 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 16 Oct 2019 15:26:52 +0100 Subject: [PATCH] Revert "Remove explicit fsid charm config option" Revert the removal of the fsid charm configuration option. This is required for the in-place migration of an existing Ceph deployment into a Charm managed deployment. This reverts commit 54c3f2122119f7425e1e629a41759b80b87acc83. Change-Id: I260b3eef85465293cc7ec554913dc66d9a4b7ee4 Closes-Bug: 1846337 --- config.yaml | 9 ++ hooks/ceph_hooks.py | 5 +- tests/bundles/bionic-train-with-fsid.yaml | 104 ++++++++++++++++++++++ tests/tests.yaml | 1 + 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/bundles/bionic-train-with-fsid.yaml diff --git a/config.yaml b/config.yaml index e3e0c92a..55e41380 100644 --- a/config.yaml +++ b/config.yaml @@ -32,6 +32,15 @@ options: description: | Apply system hardening. Supports a space-delimited list of modules to run. Supported modules currently include os, ssh, apache and mysql. + fsid: + type: string + default: + description: | + The unique identifier (fsid) of the Ceph cluster. + . + WARNING: this option should only be used when performing an in-place + migration of an existing non-charm deployed Ceph cluster to a charm + managed deployment. config-flags: type: string default: diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 46ba0901..2ed2114d 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -242,7 +242,10 @@ def config_changed(): if is_leader(): if not config('no-bootstrap'): if not leader_get('fsid') or not leader_get('monitor-secret'): - fsid = "{}".format(uuid.uuid1()) + if config('fsid'): + fsid = config('fsid') + else: + fsid = "{}".format(uuid.uuid1()) if config('monitor-secret'): mon_secret = config('monitor-secret') else: diff --git a/tests/bundles/bionic-train-with-fsid.yaml b/tests/bundles/bionic-train-with-fsid.yaml new file mode 100644 index 00000000..143e0ecc --- /dev/null +++ b/tests/bundles/bionic-train-with-fsid.yaml @@ -0,0 +1,104 @@ +series: bionic +applications: + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + osd-devices: '/dev/test-non-existent' + source: cloud:bionic-train/proposed + ceph-mon: + charm: ceph-mon + series: bionic + num_units: 3 + options: + monitor-count: '3' + source: cloud:bionic-train/proposed + fsid: 3930914c-4fc5-4720-8975-b7bf554f647c + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + dataset-size: 25% + max-connections: 1000 + source: cloud:bionic-train/proposed + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: cloud:bionic-train/proposed + keystone: + expose: True + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: cloud:bionic-train/proposed + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: cloud:bionic-train/proposed + glance: + expose: True + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: cloud:bionic-train/proposed + cinder: + expose: True + charm: cs:~openstack-charmers-next/cinder + num_units: 1 + options: + block-device: 'None' + glance-api-version: '2' + openstack-origin: cloud:bionic-train/proposed + cinder-ceph: + charm: cs:~openstack-charmers-next/cinder-ceph + nova-cloud-controller: + expose: True + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: cloud:bionic-train/proposed +relations: +- - nova-compute:amqp + - rabbitmq-server:amqp +- - nova-compute:image-service + - glance:image-service +- - nova-compute:ceph + - ceph-mon:client +- - keystone:shared-db + - percona-cluster:shared-db +- - glance:shared-db + - percona-cluster:shared-db +- - glance:identity-service + - keystone:identity-service +- - glance:amqp + - rabbitmq-server:amqp +- - glance:ceph + - ceph-mon:client +- - cinder:shared-db + - percona-cluster:shared-db +- - cinder:identity-service + - keystone:identity-service +- - cinder:amqp + - rabbitmq-server:amqp +- - cinder:image-service + - glance:image-service +- - cinder-ceph:storage-backend + - cinder:storage-backend +- - cinder-ceph:ceph + - ceph-mon:client +- - ceph-osd:mon + - ceph-mon:osd +- - nova-cloud-controller:shared-db + - percona-cluster:shared-db +- - nova-cloud-controller:identity-service + - keystone:identity-service +- - nova-cloud-controller:amqp + - rabbitmq-server:amqp +- - nova-cloud-controller:cloud-compute + - nova-compute:cloud-compute +- - nova-cloud-controller:image-service + - glance:image-service diff --git a/tests/tests.yaml b/tests/tests.yaml index 4b72dbbd..46f09e8d 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,6 +1,7 @@ charm_name: ceph-mon gate_bundles: - bionic-train + - bionic-train-with-fsid - bionic-stein - bionic-rocky - bionic-queens