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 2150004 - VMs requiring vTPM fails to create
Summary: VMs requiring vTPM fails to create
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.2
Hardware: All
OS: All
high
high
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On:
Blocks: 2149227 2150730 2150731 2152188
TreeView+ depends on / blocked
 
Reported: 2022-12-01 15:10 UTC by Jaroslav Suchanek
Modified: 2023-05-15 07:36 UTC (History)
12 users (show)

Fixed In Version: libvirt-8.2.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2149227
: 2150730 2150731 2152188 (view as bug list)
Environment:
Last Closed: 2023-05-09 07:27:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-141049 0 None None None 2022-12-01 15:19:18 UTC
Red Hat Product Errata RHBA-2023:2171 0 None None None 2023-05-09 07:29:09 UTC

Description Jaroslav Suchanek 2022-12-01 15:10:07 UTC
+++ This bug was initially created as a clone of Bug #2149227 +++

Description of problem:
Recent upstream changes in Kubevirt removed ptrace capability. This means downstream builds need to remove the capability too, causing the Libvirt to fail when vTPM is requested.

This is impacting Windows VMs (as they require vTPM) but not exclusively.

Andrea Bolognani made a preliminary list of commits,

The libvirt change is

  commit a9c500d2b50c5c041a1bb6ae9724402cf1cec8fe
  Author: Vasiliy Ulyanov <vulyanov>
  Date:   Wed Feb 2 17:28:16 2022 +0100

    qemu: tpm: Get swtpm pid without binary validation

plus I guess

  commit 4d7bb0177a33c4e90fd001edfe27bc030354d875
  Author: Michal Prívozník <mprivozn>
  Date:   Mon Mar 21 13:33:06 2022 +0100

    qemu_tpm: Do async IO when starting swtpm emulator

Comment 1 sgott 2022-12-01 18:42:48 UTC
Please note that the CNV BZ that depends on this BZ is a blocker for us.

Comment 3 Michal Privoznik 2022-12-02 08:39:55 UTC
Since all the patches needed are merged (the last one is in libvirt-8.2.0) this can go right into MODIFIED.

Comment 4 John Ferlan 2022-12-02 12:30:44 UTC
Can we get qa_ack+ please in order to set release+ ?

Although I believe it's mainly a formality because we're using this bug to get the z-stream for CNV as the patches in question were part of the RHEL 9.1 libvirt rebase bug 2060313

Comment 5 Yanqiu Zhang 2022-12-02 12:37:15 UTC
(In reply to John Ferlan from comment #4)
Sure. Done.

Comment 8 Yanqiu Zhang 2022-12-08 04:07:09 UTC
Tested on rhel9.2 with:
libvirt-8.10.0-2.el9.x86_64
qemu-kvm-7.1.0-6.el9.x86_64

Steps same with bz2150731#c8:
# virsh dumpxml avocado-vt-vm1 |grep /tpm -B2
    <tpm model='tpm-crb'>
      <backend type='emulator' version='2.0'/>
    </tpm>
# strace -o output.txt -T -tt -e trace=all -f -p `pidof virtqemud`
[terminal2]# virsh start avocado-vt-vm1 
Domain 'avocado-vt-vm1' started

# cat output.txt |grep -nE 'swtpm.pid|"/usr/bin/swtpm", "socket"|capset|execve' 
...
4946:361376 22:56:56.719985 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=361376}, {effective=1<<CAP_SETGID|1<<CAP_SETUID|1<<CAP_SETPCAP, permitted=1<<CAP_SETGID|1<<CAP_SETUID|1<<CAP_SETPCAP, inheritable=0}) = 0 <0.000011>
4951:361376 22:56:56.720146 capset({version=_LINUX_CAPABILITY_VERSION_3, pid=361376}, {effective=0, permitted=0, inheritable=0}) = 0 <0.000010>
4952:361376 22:56:56.720183 execve("/usr/bin/swtpm", ["/usr/bin/swtpm", "socket", "--ctrl", "type=unixio,path=/run/libvirt/qe"..., "--tpmstate", "dir=/var/lib/libvirt/swtpm/477ac"..., "--log", "file=/var/log/swtpm/libvirt/qemu"..., "--terminate", "--tpm2"], 0x7ffc1ba5bbc8 /* 8 vars */ <unfinished ...>
4956:361172 22:56:56.720756 openat(AT_FDCWD, "/run/libvirt/qemu/swtpm/1-avocado-vt-vm1-swtpm.pid", O_RDONLY) = 24 <0.000019>
4964:361376 22:56:56.722214 <... execve resumed>) = 0 <0.001999>
...

Ptrace capability not required.

Comment 20 errata-xmlrpc 2023-05-09 07:27:43 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 (libvirt 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-2023:2171


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