<div dir="ltr">Regarding #1:<div><br></div><div>you need to set erase_devices to a lower value if you have metadata erasure enabled, otherwise both will run.<div><br></div><div>Presently, your agent is running two steps:</div><div><br></div><div>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<br></div><div><br></div><div>erase_devices attempts to use secure erase if possible, and eventually falls back to scrubbing the disk which can take a long time.</div><div><br></div><div>and</div><div><br></div><div>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<br></div><div><br></div><div>erase_devices_metadata is the faster option, but doesn't zero out the entire disk. There is an unfortunate trade-off there.</div><div><br></div><div>If you search your log for "Executing clean step {'step':", you will see two instances where clean steps were directed to run.</div><div><br></div><div><br></div><div>Regarding #2:</div><div><br></div><div>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.</div><div><br></div><div>You can use the `baremetal node deploy --config-drive <file, or path, or json string>` command to achieve this. See link [0].</div><div><br></div><div>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.</div><div><br></div><div>-Julia</div><div><br></div><div>[0]: <a href="https://docs.openstack.org/python-ironicclient/latest/cli/osc/v1/index.html#cmdoption-openstack-baremetal-node-deploy-config-drive">https://docs.openstack.org/python-ironicclient/latest/cli/osc/v1/index.html#cmdoption-openstack-baremetal-node-deploy-config-drive</a></div><div>[1]: <a href="https://docs.openstack.org/diskimage-builder/latest/elements/cloud-init-datasources/README.html">https://docs.openstack.org/diskimage-builder/latest/elements/cloud-init-datasources/README.html</a></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 14, 2023 at 9:12 AM 韩光宇 <<a href="mailto:hanguangyu2@gmail.com">hanguangyu2@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm using ironic to deploy baremetal node. Now I have two puzzles.<br>
<br>
1. The node has been in the "clean wait" stage for more than 3 hours<br>
<br>
I saw that node was used "erase_devices_metadata" clean step, and It<br>
is very different from the description in the document[1]<br>
" it has the advantage of a reasonably quick runtime (seconds to minutes)"<br>
Attachment “ramdisk_ironic-python-agent.log” is the log of<br>
ironic-python-agent in ramdisk. Does anyone know why this is?<br>
<br>
```shell<br>
# openstack baremetal node show $NODE_UUID -f value -c driver_internal_info<br>
{'agent_erase_devices_iterations': 1, 'agent_erase_devices_zeroize':<br>
True, 'agent_continue_if_ata_erase_failed': False,<br>
'agent_enable_ata_secure_erase': True, 'disk_erasure_concurrency': 1,<br>
'agent_erase_skip_read_only': False, 'last_power_state_change':<br>
'2023-02-14T12:50:40.718177', 'clean_steps': [{'step':<br>
'erase_devices_metadata', 'priority': 99, 'interface': 'deploy',<br>
'reboot_requested': False, 'abortable': True}, {'step':<br>
'erase_devices', 'priority': 10, 'interface': 'deploy',<br>
'reboot_requested': False, 'abortable': True}], 'agent_version':<br>
'9.2.1.dev4', 'agent_last_heartbeat': '2023-02-14T13:49:18.272802',<br>
'hardware_manager_version': {'generic_hardware_manager': '1.1'},<br>
'agent_cached_clean_steps_refreshed': '2023-02-14 12:55:07.250187',<br>
'agent_secret_token': '******', 'agent_url':<br>
'<a href="https://192.168.3.62:9999" rel="noreferrer" target="_blank">https://192.168.3.62:9999</a>', 'agent_verify_ca':<br>
'/var/lib/ironic/certificates/f982467d-57bc-497d-9905-6594e5d03ca9.crt',<br>
'agent_cached_clean_steps': {'deploy': [{'step': 'erase_devices',<br>
'priority': 10, 'interface': 'deploy', 'reboot_requested': False,<br>
'abortable': True}, {'step': 'erase_devices_metadata', 'priority': 99,<br>
'interface': 'deploy', 'reboot_requested': False, 'abortable': True},<br>
{'step': 'erase_devices_express', 'priority': 0, 'interface':<br>
'deploy', 'reboot_requested': False, 'abortable': True}, {'step':<br>
'erase_pstore', 'priority': 0, 'interface': 'deploy',<br>
'reboot_requested': False, 'abortable': True}, {'step': 'burnin_cpu',<br>
'priority': 0, 'interface': 'deploy', 'reboot_requested': False,<br>
'abortable': True}, {'step': 'burnin_disk', 'priority': 0,<br>
'interface': 'deploy', 'reboot_requested': False, 'abortable': True},<br>
{'step': 'burnin_memory', 'priority': 0, 'interface': 'deploy',<br>
'reboot_requested': False, 'abortable': True}, {'step':<br>
'burnin_network', 'priority': 0, 'interface': 'deploy',<br>
'reboot_requested': False, 'abortable': True}], 'raid': [{'step':<br>
'delete_configuration', 'priority': 0, 'interface': 'raid',<br>
'reboot_requested': False, 'abortable': True}, {'step':<br>
'create_configuration', 'priority': 0, 'interface': 'raid',<br>
'reboot_requested': False, 'abortable': True}]}, 'clean_step_index':<br>
1}<br>
```<br>
<br>
2. Could I can directly use `openstack server create --user-data<br>
./my-user-date.txt` for baremetal node?<br>
or baremetal node requires configdrive?<br>
<br>
Is there any special configuration required in the user image? such as<br>
““datasource_list of cloud-init”<br>
<br>
Any kind of pointers are greatly appreciated, sincere thanks<br>
<br>
<br>
[1]: <a href="https://docs.openstack.org/ironic/latest/admin/cleaning.html#storage-cleaning-options" rel="noreferrer" target="_blank">https://docs.openstack.org/ironic/latest/admin/cleaning.html#storage-cleaning-options</a><br>
</blockquote></div>