Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2211632

Summary: udev overwrite persistent disk name because of unset variable
Product: Red Hat Enterprise Linux 9 Reporter: RY <ryasharz>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Frantisek Sumsal <fsumsal>
Severity: high Docs Contact:
Priority: unspecified    
Version: 9.0CC: msekleta, systemd-maint-list
Target Milestone: rcKeywords: Reopened
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-02 12:07:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description RY 2023-06-01 09:24:59 UTC
TL;DR:

  - udev need to be updated to include a recent rule for gce, which should bypass
    this specific issue we had.

  - udev should not silently overwrite symlink


Description of problem:

In recent OCP 4.13 the GA release came with systemd-udev which include 
a new rule for Google gce (/usr/lib/udev/rules.d/65-gce-disk-naming.rules)

The version of the file in the package include an undesired behavior 
which create the persistent name for all disk.

There was a PR merged to resolve this issue, to filter the actions
Against devices with vendor id "Google" 
 - https://github.com/GoogleCloudPlatform/guest-configs/pull/52

Also, we encounter undesired effect with this rule, It was using 
a variable called `ID_SERIAL_SHORT` which didn't exists in our OpenStack cluster,
the VM disk, didn't have this attribute, which lead to empty variable
And so, udev started with vda, but the link was overwritten to vdc as new 
devices were added to the VM.

```sh
# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root  9 May 31 07:25 google- -> ../../vdc
lrwxrwxrwx. 1 root root 10 May 31 06:47 google--part1 -> ../../vda1
lrwxrwxrwx. 1 root root 10 May 31 06:47 google--part2 -> ../../vda2
```

Version-Release number of selected component (if applicable):

 - systemd-udev-252-14.el9.rhaos4.13.x86_64

How reproducible:

 - Very

Steps to Reproduce:
1. Create a VM in PSI
2. Attach new disks to the VM
3. watch udev events

Actual results:

  - udev overwrite the existing persistent name

Expected results:

  - udev should complain, about a conflict, and not saliently overwrite the link.

Comment 1 Michal Sekletar 2023-06-02 10:53:10 UTC
We are not going to change the current behavior. Generally, uevent processing by udev can change the system state, including symlinks. This is a bug in GCP rules, they should add by-id symlink only if all components of the symlink are defined.

Comment 2 RY 2023-06-02 11:59:36 UTC
What about updating systemd-udev package to include the fixed udev rule?

- https://github.com/GoogleCloudPlatform/guest-configs/blob/master/src/lib/udev/rules.d/65-gce-disk-naming.rules#L23

Comment 3 Frantisek Sumsal 2023-06-02 12:07:38 UTC
We (systemd) don't ship 65-gce-disk-naming.rules, so please file an issue against the package that provides that rule file.

Comment 4 RY 2023-06-02 12:35:52 UTC
Sorry about that, I see it now,

[core@worker1 ~]$ rpm -qf /usr/lib/udev/rules.d/65-gce-disk-naming.rules
file /usr/lib/udev/rules.d/65-gce-disk-naming.rules is not owned by any package