Bootstrapping with disks in preseeds while actually missing fails with cryptic error

Bug #2025736 reported by Guillaume Boutry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charmed Operator - MicroCeph
New
Undecided
Unassigned
OpenStack Snap
In Progress
Medium
Hemanth Nakkina

Bug Description

I bootstrapped a node running: `sunbeam cluster bootstrap -p preseed.yaml --role storage --role compute --role control` on a VM without disks attached.

With disks defined in preseed.yaml as:

microceph_config:
  bm0.lxd:
    osd_devices: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd0,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd1,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd2

Running without verbose ends with:

Error: {'return-code': 0}

Running with verbose, you get these logs:

           DEBUG Running action list-disks on microceph/0 microceph.py:269
[08:28:02] DEBUG Result after running action list-disks: {'osds': '[]', 'return-code': 0, 'stdout': "{'osds': [], 'unpartitioned-disks': []}\n", 'unpartitioned-disks': '[]'} microceph.py:273
           DEBUG Unpartitioned disks: [] microceph.py:286
           DEBUG {'microceph_config': {'bm0.lxd': {'osd_devices': '/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd0,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd1,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd2'}}} microceph.py:319
           DEBUG [put] http+unix://%2Fvar%2Fsnap%2Fopenstack%2Fcommon%2Fstate%2Fcontrol.socket/1.0/config/TerraformVarsMicroceph, args={'data': '{"microceph_config": {"bm0.lxd": {"osd_devices": service.py:118
                    "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd0,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd1,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_osd2"}}}'}
           DEBUG http://localhost:None "PUT /1.0/config/TerraformVarsMicroceph HTTP/1.1" 200 108 connectionpool.py:456
           DEBUG Response(<Response [200]>) = {"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":{}} service.py:120

           DEBUG Running step bm0.lxd common.py:241
           DEBUG Running action add-osd on microceph/0 microceph.py:350
⠸ Configuring MicroCeph storage ... [08:28:03] DEBUG {'return-code': 0} microceph.py:363
           DEBUG Finished running step 'bm0.lxd'. Result: ResultType.FAILED common.py:244
Error: {'return-code': 0}

After attaching the disks to the VM, the bootstrap ran to completion. Error message could be better on this error case.

James Page (james-page)
Changed in snap-openstack:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :
Changed in snap-openstack:
assignee: nobody → Hemanth Nakkina (hemanth-n)
Changed in snap-openstack:
status: Triaged → In Progress
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

Actions in charm-microceph returns error message outside of results dict

$ juju run microceph/0 add-osd device-id=/dev/sdb --format json
Running operation 27 with 1 task
  - task 28 on unit-microceph-0

Waiting for task 28...
{"microceph/0":{"id":"28","message":"Error: failed to record disk: This \"disks\" entry already exists\n","results":{"return-code":0},"status":"failed","timing":{"completed":"2024-05-23 04:01:21 +0000 UTC","enqueued":"2024-05-23 04:01:20 +0000 UTC","started":"2024-05-23 04:01:20 +0000 UTC"},"unit":"microceph/0"}}

It will be useful if the message is part of results dict since libjuju get_action_output returns just the results section.

Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.