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 2036330

Summary: [RFE] [machines] Create disks with random serial number
Product: Red Hat Enterprise Linux 8 Reporter: Strahil Nikolov <hunter86_bg>
Component: cockpit-appstreamAssignee: Simon Kobyda <skobyda>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: hunter86_bg, mpitt, skobyda
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.7Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cockpit-appstream-269-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:38:48 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Strahil Nikolov 2021-12-31 09:19:01 UTC
Description of problem:
There are not entries in /dev/disk/by-id in KVM guests due to missing serial number of the disks

Version-Release number of selected component (if applicable):
cockpit-machines-251.1-1.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1.Create a VM
2.Start the VM
3.Create a new disk from the available storage pools

Actual results:
No Serial in the disk definition:

virsh dumpxml okd4-control-plane-1  | xmllint --xpath '/domain/devices/disk[@device!="cdrom"]/serial' - | sed 's#</serial>#</serial>\n#g'
XPath set is empty

Expected results:
virsh dumpxml okd4-control-plane-1 --inactive | xmllint --xpath '/domain/devices/disk[@device!="cdrom"]/serial' - | sed 's#</serial>#</serial>\n#g'
<serial>control-plane-1_sysroot_e8OysP5rXOjSNfBa6Fn9ro0iJb0LLA8MivgkqM7PSeExeEb22FHuG2r</serial>
<serial>control-plane-1_gluster_bC9dTG4owYWLhx9zb9jx6pNtF9JlUmmic6sjKUoWv1Yd3hf0aqV41fy</serial>


Additional info:

Comment 2 Martin Pitt 2022-01-03 05:47:45 UTC
@skobyda is this something c-machines would have to specify/do, or should that be reassigned to libvirt itself?

Comment 3 Strahil Nikolov 2022-01-03 05:59:29 UTC
I forgot to mention that oVirt/RHV automatically does it.

Comment 4 Simon Kobyda 2022-02-04 13:35:22 UTC
I don't we should just generate a random serial number, as there are use cases when users would want to specify one manually. E.g. when they want to set up multipath storage, or have some application inside the guest which is configured to the specific disk serial number (common with Windows virtual machines who can have licensed application tied to a serial number of disks).
I posted a PR that allows user to specify a serial number: https://github.com/cockpit-project/cockpit-machines/pull/556

Comment 5 Strahil Nikolov 2022-02-04 13:56:32 UTC
Would it be also possible to add a tick box for randomly generated serial ?

Comment 6 Martin Pitt 2022-03-02 15:53:31 UTC
Implemented in https://github.com/cockpit-project/cockpit-machines/pull/556

Yunming, can you please qe-ack? This is covered by gating tests.

Comment 13 YunmingYang 2022-05-27 08:50:18 UTC
Test Versions:
cockpit-269-1.el8.x86_64
cockpit-machines-269-1.el8.noarch
libvirt-dbus-1.3.0-2.module+el8.6.0+12861+13975d62.x86_64

Test Steps:
1 Login cockpit, then enter "Virtual Machines" page
2 Create a shutoff VM, then enter the VM detail page
3 Click "Add disk" button, then click "Show additional options" in the "Add disk" dialog
4 Fill "Name" and "Disk identifier" of the dialog like "supplementry_ disk.qcow2" and "sup_disk_GB9DSDAAWDI"
5 Click "Add" of the dialog
6 Check the new created disk by "virsh dumpxml test | xmllint --xpath '/domain/devices/disk[@device!="cdrom"]/serial' - | sed 's#</serial>#</serial>\n#g'"

Test Results:
1 After step 3, the "Source" of the dialog should be "Create new", the "Pool" should be default the default storage pool
2 After step 5, adding the disk should be successful. "Add disk" dialog should be closed, and there will be a new created disk shown in "Disks" tab
3 After step 6, the result should be like "<serial>sup_disk_GB9DSDAAWDI</serial>"

According to the results, move status to VERIFIED.

Comment 15 errata-xmlrpc 2022-11-08 09:38:48 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 (cockpit-appstream 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/RHBA-2022:7554