canonical / charm-microceph

Charm to deploy/manage microceph
Apache License 2.0
2 stars 9 forks source link

Action add-osd: Add all disks irrespective of errors #79

Closed hemanthnakkina closed 4 months ago

hemanthnakkina commented 4 months ago

Description

Currently add-osd tries to add disk one by one and the action execution returns failure on the first error encountered without trying to add rest of the disks. However it is desirable to add all the disks specified by user and returns the aggregated output for each disk in case of success and failure.

Little background: sunbeam before adding disks to microceph wants to check if disk is already added. However this is not possible using output of list-disks action as user can specify /dev/sdb but the action output will print dev-by-id. So this can be solved by running add-osd action and checking on error message if the disk already exists.

Fixes # (issue) Relevant issue in snap-openstack https://bugs.launchpad.net/snap-openstack/+bug/2065649

This is considered as breaking change since the output of the action is changed.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

  1. Verified manually by running the action add-osd on charm-microceph on the disk which is already added.
  2. Unit test is added to test the modified code

Contributor's Checklist

Please check that you have:

sabaini commented 4 months ago

lgtm!

sabaini commented 4 months ago

@UtkarshBhatthere care to take a quick peek too?