you need to set erase_devices to a lower value if you have metadata erasure enabled, otherwise both will run.
Presently, your agent is running two steps:
Feb 14 07:55:12 localhost ironic-python-agent[2190]: 2023-02-14 07:55:12.132 2190 DEBUG root [-] Executing clean step {'step': 'erase_devices', 'priority': 10, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True} execute_clean_step /opt/ironic-python-agent/lib64/python3.9/site-packages/ironic_python_agent/extensions/clean.py:67#033[00m
erase_devices attempts to use secure erase if possible, and eventually falls back to scrubbing the disk which can take a long time.
and
Feb 14 07:55:07 localhost ironic-python-agent[2190]: 2023-02-14 07:55:07.215 2190 DEBUG root [-] Executing clean step {'step': 'erase_devices_metadata', 'priority': 99, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True} execute_clean_step /opt/ironic-python-agent/lib64/python3.9/site-packages/ironic_python_agent/extensions/clean.py:67#033[00m
erase_devices_metadata is the faster option, but doesn't zero out the entire disk. There is an unfortunate trade-off there.
If you search your log for "Executing clean step {'step':", you will see two instances where clean steps were directed to run.
Regarding #2:
You have a few different options, and typically we find *most* who wish to submit a configuration drive to pass-through user data, to craft their own configuration drive contents, in which can obtain both meta-data, user-data, and arbitrary content.
You can use the `baremetal node deploy --config-drive <file, or path, or json string>` command to achieve this. See link [0].
When you're modifying your images, cloud-init knows to read from two data sources. One being a metadata API which Ironic doesn't have support for in a direct/standalone use case with Ironic, as the metadata service is served with the Nova and Neutron services. The other data source is a configuration drive, which Ironic does support. See [1] for more details if you're using diskimage-builder.
-Julia