Bug 1808424 - Validation for CephExtraKeys and CephExternalMultiConfig
Summary: Validation for CephExtraKeys and CephExternalMultiConfig
Keywords:
Status: CLOSED DUPLICATE of bug 1857776
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-validations
Version: 16.0 (Train)
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: z5
: ---
Assignee: John Fulton
QA Contact: Yogev Rabl
URL:
Whiteboard:
Depends On:
Blocks: 1802774
TreeView+ depends on / blocked
 
Reported: 2020-02-28 13:52 UTC by John Fulton
Modified: 2021-01-14 14:33 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-14 14:33:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1857776 0 medium CLOSED Provide tools to generate input for CephExternalMultiConfig 2021-04-01 09:59:01 UTC

Description John Fulton 2020-02-28 13:52:34 UTC
If the contents of CephExternalMultiConfig and CephExtraKeys are not valid the deployment will fail. Users can read the failure message and determine how to get the format valid but it requires some understanding of how ceph-ansible works. It would be nicer if there was a validation to help the user.


Inspect the contents of CephExtraKeys to ensure we have name, caps, mode, key.
Ensure caps has mgr, mon, osd. Ensure key matches "^[a-zA-Z0-9+/]{38}==$". etc
and give a meaningful error message to help the user understand more exactly
where inside of CephExtraKeys they had the problem.

  CephExtraKeys:
        - name: "client.glance"
          caps:
            mgr: "allow *"
            mon: "profile rbd"
            osd: "profile rbd pool=images"
          key: "AQBRgQ9eAAAAABAAv84zEilJYZPNuJ0Iwn9Ndg=="
          mode: "0600"

Similarly we could validate CephExternalMultiConfig. E.g. if a user doesn't supply
the "cluster" parameter then this loop will fail but the user probably wouldn't
understand why without reading the code.

 https://review.opendev.org/#/c/702143/23/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/prepare.yml

So we should ensure they have all the paramters like this:

  CephExternalMultiConfig:
    - cluster: 'ceph2'
      fsid: 'af25554b-42f6-4d2b-9b9b-d08a1132d3e8'
      external_cluster_mon_ips: '172.18.0.5,172.18.0.6,172.18.0.7'
      keys:
        - name: "client.openstack"
          caps:
            mgr: "allow *"
            mon: "profile rbd"
            osd: "osd: profile rbd pool=volumes, profile rbd pool=backups, profile rbd pool=vms, profile rbd pool=images"
          key: "AQCwmeRcAAAAABAA6SQU/bGqFjlfLro5KxrB1Q=="
          mode: "0600"
      dashboard_enabled: false
    - cluster: 'ceph3'
      fsid: 'e2cba068-5f14-4b0f-b047-acf375c0004a'
      external_cluster_mon_ips: '172.18.0.8,172.18.0.9,172.18.0.10'
      keys:
        - name: "client.openstack"
          caps:
            mgr: "allow *"
            mon: "profile rbd"
            osd: "osd: profile rbd pool=volumes, profile rbd pool=backups, profile rbd pool=vms, profile rbd pool=images"
          key: "AQCwmeRcAAAAABAA6SQU/bGqFjlfLro5KxrB2Q=="
          mode: "0600"
      dashboard_enabled: false

Loop through it to:

- ensure the fsid is a valid uuid
- ensure the key matches "^[a-zA-Z0-9+/]{38}==$"
- ensure external_cluster_mon_ips is valid
- etc.

Then if they don't match, we say what field failed for what reason.

More indepth descriptions of these lists of maps can be found at
https://review.opendev.org/#/c/707847/

Comment 2 John Fulton 2020-07-16 14:41:34 UTC
One could validation this bug with a positive test by using generating valid input with the result of bug 1857776
One could validation this bug with a series of negative tests by using generating valid input with the result of bug 1857776 and the modifying the output to have invalid syntax

Comment 8 John Fulton 2021-01-14 14:33:26 UTC
As per a conversation with PM, now that 1857776 is resolved and docs [1] have our users generating these files automatically, the probability of encountering the situation this BZ was opened to prevent is eliminated. Thus, from a practical point of view this bug is no longer necessary.

[1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html/distributed_compute_node_and_storage_deployment/assembly_deploying-storage-at-the-edge#deploying_edge_sites_with_storage

*** This bug has been marked as a duplicate of bug 1857776 ***


Note You need to log in before you can comment on or make changes to this bug.