[RFE] During cleaning, remove also disk labels (not just partitions)

Bug #1690458 reported by John Fulton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ironic-lib
Fix Released
Wishlist
Dmitry Tantsur

Bug Description

In addition to wipefs [0], could Ironic disk_utils also call `sgdisk -Z` or similar?

This issue affects TripleO Ceph deployments as `ceph-disk prepare` is called which in turn calls `sgdisk --mbrtogpt`. While testing a 1020 disk deployment with TripleO, when `sgdisk --mbrtogpt` was called it failed for 143 of the disks but succeeded for the other 877 of the disks; all 1020 of the disks had gone through Ironic cleaning [1]. The 143 disks all had unrecognised disk labels and the issue was worked around by labeling the disks and resuming the deployment to get all 1020 disks activated. I've verified also that `ceph-disk prepare` works with disks which have had `sgdisk -Z` run on them. Using something like `ceph-disk zap` in a preboot script can achieve the same effect, but it seems preferable for TripleO users to just let the Ironic cleaning take care of it.

AFAICT, `wipefs --all` removes partitions but not disk labels. Is there any reason why Ironic cleaning should leave pre-existing GPT/MBR (or even EFI) labels on a disk if the user already opted to have the disk cleaned?

[0] https://github.com/openstack/ironic-lib/commit/042aa9ab5a27e251c8fb2f1855695cf5e791ecf5
[1] As implemented in https://bugs.launchpad.net/ironic/+bug/1603411

Dmitry Tantsur (divius)
summary: - RFE for Ironic disk cleaning to ensure removal of disk labels (not just
- partitions)
+ [RFE] During cleaning, remove also disk labels (not just partitions)
Changed in ironic:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in ironic-lib:
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: cleaning low-hanging-fruit rfe
Dmitry Tantsur (divius)
tags: added: rfe-approved
removed: rfe
Revision history for this message
Vladyslav Drok (vdrok) wrote :

I'm +1 on this.

Revision history for this message
Pavlo Shchelokovskyy (pshchelo) wrote :

I stumbled on something similar when implementing partitioning support in ansible-deploy driver, which is 'erase_devices_metadata' clean step is not thorough enough, destroying only partition tables, while some partition info is left in the headers of partitions themselves, and can interfere with future partitions if they happen to fall on the same start position.

As example of the logic I used to work this around in ansible-deploy please see this gerrit change

https://review.openstack.org/#/c/424291

I think it would be quite straightforward to extend logic of erase_devices_metadata in IPA in a similar way.

Dmitry Tantsur (divius)
Changed in ironic-lib:
assignee: nobody → Dmitry Tantsur (divius)
no longer affects: ironic
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/469155

Changed in ironic-lib:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic-lib (master)

Reviewed: https://review.openstack.org/469155
Committed: https://git.openstack.org/cgit/openstack/ironic-lib/commit/?id=4491a52c904432d6ec48fd2751a2b1931223cb28
Submitter: Jenkins
Branch: master

commit 4491a52c904432d6ec48fd2751a2b1931223cb28
Author: Dmitry Tantsur <email address hidden>
Date: Tue May 30 17:05:22 2017 +0200

    Add 'sgdisk -Z' to destroy_disk_metadata

    Apparently, wipefs still leaves some metadata around, which can break ceph.
    Use sgdisk's zapping feature to be absolutely sure.

    Change-Id: I51aea8fb5ba02d63a05a3794405caf000ff28e75
    Closes-Bug: #1690458

Changed in ironic-lib:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic-lib 2.8.0

This issue was fixed in the openstack/ironic-lib 2.8.0 release.

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.