if create_raid:
mdadm.mdadm_create(md_devname, raidlevel, device_paths, spare_device_paths, container_dev, info.get('mdname', ''), metadata)
wipe_mode = info.get('wipe')
if wipe_mode:
if wipe_mode == 'superblock' and create_raid:
# Newly created raid devices already wipe member superblocks at
# their data offset (this is equivalent to wiping the assembled
# device, see curtin.block.mdadm.zero_device for more details.
pass
else: LOG.debug('Wiping raid device %s mode=%s', md_devname, wipe_mode) block.wipe_volume(md_devname, mode=wipe_mode, exclusive=False)
```
Curtin will verify the array, lower the create_raid flag, and then if wipe
is set, it will clear the array; it only *skips* clearing if wipe=superblock
and we've just created the array (which already wipes the underlying disks).
Hrm, I didn't think this was true (that preserve means keeping partition table).
looking at raid_handler, if you set wipe: superblock, it will wipe a verified.
``` verify( md_devname, raidlevel, device_paths, spare_device_paths)
create_raid = True
if preserve:
raid_
LOG.debug('raid %s already present, skipping create', md_devname)
create_raid = False
if create_raid: mdadm_create( md_devname, raidlevel,
device_ paths, spare_device_paths, container_dev,
info. get('mdname' , ''), metadata)
mdadm.
wipe_mode = info.get('wipe') block.mdadm. zero_device for more details.
LOG.debug( 'Wiping raid device %s mode=%s', md_devname, wipe_mode)
block. wipe_volume( md_devname, mode=wipe_mode, exclusive=False)
if wipe_mode:
if wipe_mode == 'superblock' and create_raid:
# Newly created raid devices already wipe member superblocks at
# their data offset (this is equivalent to wiping the assembled
# device, see curtin.
pass
else:
```
Curtin will verify the array, lower the create_raid flag, and then if wipe
is set, it will clear the array; it only *skips* clearing if wipe=superblock
and we've just created the array (which already wipes the underlying disks).