Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1452323

Summary: Ironic disk cleaning to ensure removal of disk labels (not just partitions)
Product: Red Hat OpenStack Reporter: John Fulton <johfulto>
Component: python-ironic-libAssignee: Dmitry Tantsur <dtantsur>
Status: CLOSED ERRATA QA Contact: mlammon
Severity: medium Docs Contact:
Priority: medium    
Version: 11.0 (Ocata)CC: apevec, jjoyce, jschluet, lhh, mkovacik, racedoro, tvignaud
Target Milestone: gaKeywords: Triaged
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ironic-lib-2.8.0-0.20170621200136.56e7619.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 21:28:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Fulton 2017-05-18 17:17:50 UTC
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

Comment 1 Ramon Acedo 2017-05-22 14:28:56 UTC
If both, ‘wipefs —all' + 'sgdisk -Z' is the right way to wipe all the partition table and file system metadata for MBR and GPT, then the missing 'sgdisk -Z’ command needs to be added when wiping the disk metadata.

If confirmed, I'd suggest to treat this as a regular bug, not a RFE.

Comment 2 Ramon Acedo 2017-05-30 14:49:46 UTC
Removing RFE from title. Wiping disk the metadata relied on the 'wipefs' command but the goal is to really wipe the disk metadata which includes partitions and disk labels making it a bug rather than a new feature in my view.

Comment 3 mkovacik 2017-06-26 16:23:59 UTC
patch was merged upstream -> POST https://review.openstack.org/#/c/469155/

Comment 10 errata-xmlrpc 2017-12-13 21:28:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3462