This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1972438 - [RFE] Provide way for cloud-init configuration to run commands in the bootcmd stage even if user data is provided
Summary: [RFE] Provide way for cloud-init configuration to run commands in the bootcmd...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: cloud-init
Version: 8.3
Hardware: All
OS: Linux
medium
high
Target Milestone: beta
: ---
Assignee: Bandan Das
QA Contact: xiachen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-15 21:37 UTC by Allie DeVolder
Modified: 2023-09-22 15:48 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 15:46:56 UTC
Type: Story
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7287 0 None Migrated None 2023-09-22 15:46:55 UTC

Description Allie DeVolder 2021-06-15 21:37:51 UTC
[What is the nature and description of the request?]

When provisioning a system using cloud-init, the customer scripts that need to be run once the bootcmd contents from user data are completed. If they're run before userdata, it's too early for them to be effective, and attempting to use bootcmd in the cloud-init configuration won't occur if the user data includes any bootcmd content.

This specific example is yum commands that cannot run during the config stage and must be run during the init stage in order to run because yum settings are not yet defined prior to the start if the init stage.

More details from the customer:
*******************************
1.  My script to configure the yum variables needs to run during the Network boot stage (I will rely on the terminology from this document when referring to the boot stages: https://cloudinit.readthedocs.io/en/latest/topics/boot.html).  The bootcmd is run during the Network boot stage, and so I should be able to use this instruction to run my script.  However, the challenge is that I need to be able to bake this configuration into an image, by placing a configuration file in /etc/cloud/cloud.cfg.d.  If the user specifies a bootcmd instruction in their user data, my script won't be run, which is not desirable.
2.  The reason the script cannot be run during the Config stage is that the Config stage includes other steps that access the instance's yum repositories (e.g., the user might have a yum install in their runcmd instructions) and there would be no way to guarantee that my script is run before these steps.
*******************************

The customer is currently using a workaround I found on serverfault.com: https://serverfault.com/questions/871328/start-service-after-aws-user-data-has-run

[Why does the customer need this? (List the business requirements here)]

Being able to ensure the applying user-data still allows for content to be run as part of bootcmd is essential for many use cases for provisioning. Working around the issue by tinkering with the systemd service files is unnecessarily complicated and prone to issues, as well as being unsupported.

[How would the customer like to achieve this? (List the functional
requirements here)]

A way to specify commands be run as part of bootcmd that aren't overridden by user data, while still permitting user data.

Comment 2 xiachen 2021-06-24 04:39:39 UTC
There is a similar requirement on upstream bug, they also want to merge bootcmd between user-data and cloud.cfg.d/*.cfg. (see https://bugs.launchpad.net/cloud-init/+bug/1532234/comments/2).

However, it hasn't been updated in a long time.
In my view, it's better to discuss this RFE in upstream project firstly.

Comment 3 John Ferlan 2021-06-30 19:01:57 UTC
Assigned to Rick for initial triage per bz process and age of bug created or assigned to virt-maint without triage.

Comment 4 Rick Barry 2021-07-01 12:48:01 UTC
(In reply to xiachen from comment #2)
> There is a similar requirement on upstream bug, they also want to merge
> bootcmd between user-data and cloud.cfg.d/*.cfg. (see
> https://bugs.launchpad.net/cloud-init/+bug/1532234/comments/2).
> 
> However, it hasn't been updated in a long time.
> In my view, it's better to discuss this RFE in upstream project firstly.

Agreed. Eduardo, can you discuss this requested feature with the upstream community and see if they have any plans to provide this feature or some alternative?

Comment 5 Eduardo Otubo 2021-07-07 14:49:24 UTC
(In reply to Rick Barry from comment #4)
> (In reply to xiachen from comment #2)
> > There is a similar requirement on upstream bug, they also want to merge
> > bootcmd between user-data and cloud.cfg.d/*.cfg. (see
> > https://bugs.launchpad.net/cloud-init/+bug/1532234/comments/2).
> > 
> > However, it hasn't been updated in a long time.
> > In my view, it's better to discuss this RFE in upstream project firstly.
> 
> Agreed. Eduardo, can you discuss this requested feature with the upstream
> community and see if they have any plans to provide this feature or some
> alternative?

I sent an email to the mailing list. Technically speaking it doesn't seem to be complicated to implement, but we need to assess the implications and how an algorithm would merge both lists of commands together. I'll follow up on the discussion and will update the BZ accordingly.

Comment 9 xiachen 2023-02-27 08:23:35 UTC
Remove ITR because no update in upstream bug https://bugs.launchpad.net/cloud-init/+bug/1532234

Comment 11 RHEL Program Management 2023-09-22 15:43:49 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.


Note You need to log in before you can comment on or make changes to this bug.