[ironic] the confuse of user data and too long time of clean
Hello,
I'm using ironic to deploy baremetal node. Now I have two puzzles.
1. The node has been in the "clean wait" stage for more than 3 hours
I saw that node was used "erase_devices_metadata" clean step, and It is very different from the description in the document[1] " it has the advantage of a reasonably quick runtime (seconds to minutes)" Attachment “ramdisk_ironic-python-agent.log” is the log of ironic-python-agent in ramdisk. Does anyone know why this is?
```shell # openstack baremetal node show $NODE_UUID -f value -c driver_internal_info {'agent_erase_devices_iterations': 1, 'agent_erase_devices_zeroize': True, 'agent_continue_if_ata_erase_failed': False, 'agent_enable_ata_secure_erase': True, 'disk_erasure_concurrency': 1, 'agent_erase_skip_read_only': False, 'last_power_state_change': '2023-02-14T12:50:40.718177', 'clean_steps': [{'step': 'erase_devices_metadata', 'priority': 99, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices', 'priority': 10, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}], 'agent_version': '9.2.1.dev4', 'agent_last_heartbeat': '2023-02-14T13:49:18.272802', 'hardware_manager_version': {'generic_hardware_manager': '1.1'}, 'agent_cached_clean_steps_refreshed': '2023-02-14 12:55:07.250187', 'agent_secret_token': '******', 'agent_url': 'https://192.168.3.62:9999', 'agent_verify_ca': '/var/lib/ironic/certificates/f982467d-57bc-497d-9905-6594e5d03ca9.crt', 'agent_cached_clean_steps': {'deploy': [{'step': 'erase_devices', 'priority': 10, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices_metadata', 'priority': 99, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices_express', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_pstore', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_cpu', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_disk', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_memory', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_network', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}], 'raid': [{'step': 'delete_configuration', 'priority': 0, 'interface': 'raid', 'reboot_requested': False, 'abortable': True}, {'step': 'create_configuration', 'priority': 0, 'interface': 'raid', 'reboot_requested': False, 'abortable': True}]}, 'clean_step_index': 1} ```
2. Could I can directly use `openstack server create --user-data ./my-user-date.txt` for baremetal node? or baremetal node requires configdrive?
Is there any special configuration required in the user image? such as ““datasource_list of cloud-init”
Any kind of pointers are greatly appreciated, sincere thanks
[1]: https://docs.openstack.org/ironic/latest/admin/cleaning.html#storage-cleanin...
Regarding #1:
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
[0]: https://docs.openstack.org/python-ironicclient/latest/cli/osc/v1/index.html#... [1]: https://docs.openstack.org/diskimage-builder/latest/elements/cloud-init-data...
On Tue, Feb 14, 2023 at 9:12 AM 韩光宇 hanguangyu2@gmail.com wrote:
Hello,
I'm using ironic to deploy baremetal node. Now I have two puzzles.
- The node has been in the "clean wait" stage for more than 3 hours
I saw that node was used "erase_devices_metadata" clean step, and It is very different from the description in the document[1] " it has the advantage of a reasonably quick runtime (seconds to minutes)" Attachment “ramdisk_ironic-python-agent.log” is the log of ironic-python-agent in ramdisk. Does anyone know why this is?
# openstack baremetal node show $NODE_UUID -f value -c driver_internal_info {'agent_erase_devices_iterations': 1, 'agent_erase_devices_zeroize': True, 'agent_continue_if_ata_erase_failed': False, 'agent_enable_ata_secure_erase': True, 'disk_erasure_concurrency': 1, 'agent_erase_skip_read_only': False, 'last_power_state_change': '2023-02-14T12:50:40.718177', 'clean_steps': [{'step': 'erase_devices_metadata', 'priority': 99, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices', 'priority': 10, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}], 'agent_version': '9.2.1.dev4', 'agent_last_heartbeat': '2023-02-14T13:49:18.272802', 'hardware_manager_version': {'generic_hardware_manager': '1.1'}, 'agent_cached_clean_steps_refreshed': '2023-02-14 12:55:07.250187', 'agent_secret_token': '******', 'agent_url': 'https://192.168.3.62:9999', 'agent_verify_ca': '/var/lib/ironic/certificates/f982467d-57bc-497d-9905-6594e5d03ca9.crt', 'agent_cached_clean_steps': {'deploy': [{'step': 'erase_devices', 'priority': 10, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices_metadata', 'priority': 99, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_devices_express', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'erase_pstore', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_cpu', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_disk', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_memory', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}, {'step': 'burnin_network', 'priority': 0, 'interface': 'deploy', 'reboot_requested': False, 'abortable': True}], 'raid': [{'step': 'delete_configuration', 'priority': 0, 'interface': 'raid', 'reboot_requested': False, 'abortable': True}, {'step': 'create_configuration', 'priority': 0, 'interface': 'raid', 'reboot_requested': False, 'abortable': True}]}, 'clean_step_index': 1}
- Could I can directly use `openstack server create --user-data
./my-user-date.txt` for baremetal node? or baremetal node requires configdrive?
Is there any special configuration required in the user image? such as ““datasource_list of cloud-init”
Any kind of pointers are greatly appreciated, sincere thanks
participants (2)
-
Julia Kreger
-
韩光宇