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 2179017 - cloud-init: backport fix for instance id detection on Azure to RHEL9 [rhel-9.3]
Summary: cloud-init: backport fix for instance id detection on Azure to RHEL9 [rhel-9.3]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: cloud-init
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ani Sinha
QA Contact: Huijuan Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-16 12:59 UTC by Chris Patterson
Modified: 2023-11-07 09:27 UTC (History)
14 users (show)

Fixed In Version: cloud-init-23.1.1-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:28:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2178793 0 unspecified CLOSED cloud-init: backport fix for instance id detection on Azure [rhel-8.9] 2023-11-14 16:43:13 UTC
Red Hat Issue Tracker RHELPLAN-152065 0 None None None 2023-03-16 13:01:11 UTC
Red Hat Product Errata RHSA-2023:6371 0 None None None 2023-11-07 08:29:29 UTC

Description Chris Patterson 2023-03-16 12:59:08 UTC
Description of problem:
cloud-init may re-configure VM after falling back to non-Azure datasource on Azure.

Some error cases will cause the instance ID to fall back to a default value of "iid-datasource".  This will cause cloud-init to reconfigure the VM thinking it is a new instance.

Version-Release number of selected component (if applicable):
All cloud-init versions < 22.4

How reproducible:
The customer cases we have seen have been due to DHCP failures for various reasons (either due to image misconfiguration or platform issues).

Steps to Reproduce:
1. create RHEL VM on Azure
2. reboot # clean reboot for demonstration purposes
2. mv /usr/sbin/dhclient /usr/sbin/dhclient.x
2. cp /bin/false /usr/sbin/dhclient
3. reboot
4. grep config-users /var/log/cloud-init.log

We should see something like:

<First boot where provisioning runs config-users-groups>
2023-02-24 16:46:08,014 - handlers.py[DEBUG]: start: init-network/config-users-groups: running config-users-groups with frequency once-per-instance
2023-02-24 16:46:08,017 - helpers.py[DEBUG]: Running config-users-groups using lock (<FileLock using file '/var/lib/cloud/instances/05a707cf-665b-b547-8fd4-a88de9aa6215/sem/config_users_groups'>)
2023-02-24 16:46:09,851 - handlers.py[DEBUG]: finish: init-network/config-users-groups: SUCCESS: config-users-groups ran successfully

<Normal subsequent boot where config-users-groups does not run>
2023-03-15 15:14:03,278 - handlers.py[DEBUG]: start: init-network/config-users-groups: running config-users-groups with frequency once-per-instance
2023-03-15 15:14:03,279 - helpers.py[DEBUG]: config-users-groups already ran (freq=once-per-instance)
2023-03-15 15:14:03,279 - handlers.py[DEBUG]: finish: init-network/config-users-groups: SUCCESS: config-users-groups previously ran

<Boot with /bin/false for dhclient, config-users unexpectedly re-runs>
2023-03-15 17:30:49,484 - handlers.py[DEBUG]: start: init-network/config-users-groups: running config-users-groups with frequency once-per-instance
2023-03-15 17:30:49,487 - helpers.py[DEBUG]: Running config-users-groups using lock (<FileLock using file '/var/lib/cloud/instances/iid-datasource/sem/config_users_groups'>)
2023-03-15 17:30:49,491 - handlers.py[DEBUG]: finish: init-network/config-users-groups: SUCCESS: config-users-groups ran successfully

The upstream patch that should address this failure:
https://github.com/canonical/cloud-init/commit/b861ea8a5e1fd0eb33096f60f54eeff42d80d3bd

Comment 1 Ani Sinha 2023-03-30 10:04:19 UTC
@huzhao will this be fixed by the cloud-init rebase https://bugzilla.redhat.com/show_bug.cgi?id=2172811 ?

Comment 2 Ani Sinha 2023-03-30 10:09:57 UTC
Seems https://github.com/canonical/cloud-init/commit/b861ea8a5e1fd0eb33096f60f54eeff42d80d3bd is present in cloud-init 23.1.1

Comment 3 Huijuan Zhao 2023-03-30 22:37:32 UTC
(In reply to Ani Sinha from comment #1)
> @huzhao will this be fixed by the cloud-init rebase
> https://bugzilla.redhat.com/show_bug.cgi?id=2172811 ?

Yes, I think so. 
Please refer to the https://bugzilla.redhat.com/show_bug.cgi?id=2178793#c14 for detail test results and discussion.

Comment 4 Ani Sinha 2023-04-28 08:20:22 UTC
@huzhao Please feel free to close this bug as the rebase is complete.

Comment 5 Huijuan Zhao 2023-04-28 14:14:11 UTC
(In reply to Ani Sinha from comment #4)
> @huzhao Please feel free to close this bug as the rebase is
> complete.

Thanks Ani. Should we add this BZ to errata or close it directly?

Comment 6 Ani Sinha 2023-04-28 15:04:57 UTC
(In reply to Huijuan Zhao from comment #5)
> (In reply to Ani Sinha from comment #4)
> > @huzhao Please feel free to close this bug as the rebase is
> > complete.
> 
> Thanks Ani. Should we add this BZ to errata or close it directly?

I guess add it to errata

Comment 13 Huijuan Zhao 2023-05-24 09:57:20 UTC
The issue is fixed in cloud-init-23.1.1-4.el9, test results are same as https://bugzilla.redhat.com/show_bug.cgi?id=2178793#c3

Moving to VERIFIED.

Comment 15 errata-xmlrpc 2023-11-07 08:28:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: cloud-init security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6371


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