Wipe a device or partition¶
Available since 2.26.0 (17.1.0 and 16.1.0)
Before deploying a cluster, you may need to erase existing data from hardware
devices to be used for deployment. You can either erase an existing partition
or remove all existing partitions from a physical device. For this purpose,
use the wipeDevice
structure that configures cleanup behavior during
configuration of a custom bare metal host profile described in
Create a custom host profile.
The wipeDevice
structure contains the following options:
eraseMetadata
Configures metadata cleanup of a device
eraseDevice
Configures a complete cleanup of a device
Erase metadata from a device¶
When you enable the eraseMetadata
option, which is disabled by default,
the Ansible provisioner attempts to clean up the existing metadata from
the target device. Examples of metadata include:
Existing file system
Logical Volume Manager (LVM) or Redundant Array of Independent Disks (RAID) configuration
The behavior of metadata erasure varies depending on the target device:
If a device is part of other logical devices, for example, a partition, logical volume, or MD RAID volume, such logical device is disassembled and its file system metadata is erased. On the final erasure step, the file system metadata of the target device is erased as well.
If a device is a physical disk, then all its nested partitions along with their nested logical devices, if any, are erased and disassembled. On the final erasure step, all partitions and metadata of the target device are removed.
Caution
None of the eraseMetadata
actions include overwriting the
target device with data patterns. For this purpose, use the eraseDevice
option as described in Erase a device.
To enable the eraseMetadata
option, use the wipeDevice
field in the
spec:devices
section of the BareMetalHostProfile
object. For a
detailed description of the option, see API Reference:
BareMetalHostProfile.
Erase a device¶
If you require not only disassembling of existing logical volumes but also
removing of all data ever written to the target device, configure the
eraseDevice
option, which is disabled by default. This option is not
applicable to paritions, LVM, or MD RAID logical volumes because such volumes
may use caching that prevents a physical device from being erased properly.
Important
The eraseDevice
option does not replace the secure erase.
To configure the eraseDevice
option, use the wipeDevice
field in the
spec:devices
section of the BareMetalHostProfile
object. For a
detailed description of the option, see API Reference:
BareMetalHostProfile.