is_osd_disk needs to failsafe

Bug #1431293 reported by James Page
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Triaged
Medium
Unassigned
OpenStack Ceph Charm (Retired)
Won't Fix
Medium
Unassigned
ceph (Juju Charms Collection)
Invalid
Medium
Unassigned
ceph-osd (Juju Charms Collection)
Invalid
Medium
Unassigned

Bug Description

def is_osd_disk(dev):
    try:
        info = subprocess.check_output(['sgdisk', '-i', '1', dev])
        info = info.split("\n") # IGNORE:E1103
        for line in info:
            if line.startswith(
                'Partition GUID code: 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D'
            ):
                return True
    except subprocess.CalledProcessError:
        pass
    return False

if the sgdisk command fails, then the disk will be marked as not an OSD, so will be eligible for reuse - that's probably not a good idea - some sort of exception for this might be better.

James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: none → 15.04
Changed in ceph-osd (Juju Charms Collection):
milestone: none → 15.04
Changed in ceph (Juju Charms Collection):
importance: Undecided → High
Changed in ceph-osd (Juju Charms Collection):
importance: Undecided → High
Changed in ceph (Juju Charms Collection):
status: New → Triaged
Changed in ceph-osd (Juju Charms Collection):
status: New → Triaged
Changed in ceph (Juju Charms Collection):
importance: High → Medium
Changed in ceph-osd (Juju Charms Collection):
importance: High → Medium
tags: added: cloud-installer
James Page (james-page)
tags: added: openstack
Changed in ceph (Juju Charms Collection):
milestone: 15.04 → 15.07
Changed in ceph-osd (Juju Charms Collection):
milestone: 15.04 → 15.07
James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: 15.07 → 15.10
Changed in ceph-osd (Juju Charms Collection):
milestone: 15.07 → 15.10
James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: 15.10 → 16.01
Changed in ceph-osd (Juju Charms Collection):
milestone: 15.10 → 16.01
James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: 16.01 → 16.04
Changed in ceph-osd (Juju Charms Collection):
milestone: 16.01 → 16.04
James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: 16.04 → 16.07
Changed in ceph-osd (Juju Charms Collection):
milestone: 16.04 → 16.07
Liam Young (gnuoy)
Changed in ceph (Juju Charms Collection):
milestone: 16.07 → 16.10
Changed in ceph-osd (Juju Charms Collection):
milestone: 16.07 → 16.10
James Page (james-page)
Changed in ceph (Juju Charms Collection):
milestone: 16.10 → 17.01
Changed in ceph-osd (Juju Charms Collection):
milestone: 16.10 → 17.01
James Page (james-page)
Changed in charm-ceph:
importance: Undecided → Medium
status: New → Triaged
Changed in ceph (Juju Charms Collection):
status: Triaged → Invalid
Changed in charm-ceph-osd:
importance: Undecided → Medium
status: New → Triaged
Changed in ceph-osd (Juju Charms Collection):
status: Triaged → Invalid
Changed in ceph (Juju Charms Collection):
milestone: 17.01 → none
Changed in ceph-osd (Juju Charms Collection):
milestone: 17.01 → none
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

Marking the charm-ceph task wontfix as the ceph charm has been removed from support for a while now

Changed in charm-ceph:
status: Triaged → Won't Fix
Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote :

Hi James,

Current is_osd_disk() implementation logs a message,

def is_osd_disk(dev):
  ...
    partitions = get_partition_list(dev)
    for partition in partitions:
        try:
            info = str(subprocess
                       .check_output(['sgdisk', '-i', partition.number, dev])
                       .decode('UTF-8'))
            info = info.split("\n") # IGNORE:E1103
            for line in info:
                for ptype in CEPH_PARTITIONS:
                    sig = 'Partition GUID code: {}'.format(ptype)
                    if line.startswith(sig):
                        return True
        except subprocess.CalledProcessError as e:
            log("sgdisk inspection of partition {} on {} failed with " <---
                "error: {}. Skipping".format(partition.minor, dev, e), <---
                level=ERROR)
    return False

Is this adequate for now or would you suggest additional handling of this particular case?

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.