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 2032099

Summary: [machines] In RHEL 9, there will be an error when selecting "Console type" to "Serial console"
Product: Red Hat Enterprise Linux 9 Reporter: YunmingYang <yunyang>
Component: cockpit-machinesAssignee: Simon Kobyda <skobyda>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: mmarusak, mpitt, skobyda, wshi, xchen, ymao
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cockpit-machines-260-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 12:44:42 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 YunmingYang 2021-12-14 03:08:28 UTC
Description of problem:
Create a VM with follow parameters
Prepare the VM XML by "virt-install --connect qemu:///system --name subVmTest1 --os-variant fedora31 --boot hd,network --vcpus 2 --memory 2048 --import --disk /var/lib/libvirt/images/fedora31.qcow2 --graphics vnc,listen=127.0.0.1 --console pty,target.type=virtio --print-step 1 > xml", then define the VM by "virsh define xml". Then enter the VM detail page. After that, Click "Run" and switch "Console type" to "Serial console" immediately, there will be an error, which is 'error: Failed to get option 'devname': Option argument is empty"


Version-Release number of selected components (if applicable):
cockpit-258-1.el9.s390x
cockpit-machines-256-1.el9.noarch
libvirt-dbus-1.4.1-5.el9.s390x


How reproducible:
100%


Steps to Reproduce:
1 Prepare the VM XML by "virt-install --connect qemu:///system --name subVmTest1 --os-variant fedora31 --boot hd,network --vcpus 2 --memory 2048 --import --disk /var/lib/libvirt/images/fedora31.qcow2 --graphics vnc,listen=127.0.0.1 --console pty,target.type=virtio --print-step 1 > xml"
2 Define the VM by "virsh define xml"
3 Enter the VM detail page
4 Click "Run" and switch "Console" to "Serial console" immediately


Actual results:
1 After step 4, there will be an error shown, which is "error: Failed to get option 'devname': Option argument is empty"


Expected results:
1 After step 4, no error and show console output correctly


Additional info:

Comment 1 Martin Pitt 2021-12-14 13:06:46 UTC
Hello Yunming,

> 4 Click "Run" and switch "Console" to "Serial console" immediately

Is this timing related, i.e. you need to be quick? Or does that happen after waiting for a few seconds as well, and the "immediate" just means "no other action in between"? Does this ever work, or is this a timing issue?

Is the VM actually running, or does it fail/crash after startup?

c-machines code does not use "devname" anywhere in its own code, nor in PatternFly, novnc, nor any other imported NPM module. So this is probably something internal to libvirt. Can you please attach the generated "xml" file here?

Do you happen to have a RH network accessible s390x instance where we can debug this?

Simon or Katerina might know what other information to ask for.

Thanks!

Comment 2 YunmingYang 2021-12-14 14:51:00 UTC
Hi martin, 
1 I think it is timing related, we should switch to "Serial console" in about 2 second after we could see the "Console type" select
2 The VM is running actually, since I switch back to "VNC console", and it looks correctly. And I also check the VM state by "virsh list --all", and the VM state is also running
3 Yeah, I borrow a s390x VM from beaker, I will send IP address to Katerina

Thanks

Comment 3 YunmingYang 2021-12-14 14:52:34 UTC
Also, here is the XML
<domain type='kvm' id='20'>
  <name>test</name>
  <uuid>4e7c739c-4453-477f-8637-1db298c789b7</uuid>
  <metadata xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0" xmlns:cockpit_machines="https://github.com/cockpit-project/cockpit-machines">
    <libosinfo:libosinfo>
      <libosinfo:os id="http://fedoraproject.org/fedora/32"/>
    </libosinfo:libosinfo>
    <cockpit_machines:data>
      <cockpit_machines:has_install_phase>false</cockpit_machines:has_install_phase>
      <cockpit_machines:install_source_type>disk_image</cockpit_machines:install_source_type>
      <cockpit_machines:install_source>/var/lib/libvirt/images/fedora31.qcow2</cockpit_machines:install_source>
      <cockpit_machines:os_variant>fedora32</cockpit_machines:os_variant>
    </cockpit_machines:data>
  </metadata>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='s390x' machine='s390-ccw-virtio-rhel8.5.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>gen15a-base</model>
    <feature policy='require' name='aen'/>
    <feature policy='require' name='vxpdeh'/>
    <feature policy='require' name='aefsi'/>
    <feature policy='require' name='diag318'/>
    <feature policy='require' name='csske'/>
    <feature policy='require' name='msa9'/>
    <feature policy='require' name='msa8'/>
    <feature policy='require' name='msa7'/>
    <feature policy='require' name='msa6'/>
    <feature policy='require' name='msa5'/>
    <feature policy='require' name='msa4'/>
    <feature policy='require' name='msa3'/>
    <feature policy='require' name='msa2'/>
    <feature policy='require' name='msa1'/>
    <feature policy='require' name='sthyi'/>
    <feature policy='require' name='edat'/>
    <feature policy='require' name='deflate'/>
    <feature policy='require' name='etoken'/>
    <feature policy='require' name='vx'/>
    <feature policy='require' name='ap'/>
    <feature policy='require' name='vxeh'/>
    <feature policy='require' name='vxpd'/>
    <feature policy='require' name='esop'/>
    <feature policy='require' name='msa9_pckmo'/>
    <feature policy='require' name='vxeh2'/>
    <feature policy='require' name='esort'/>
    <feature policy='require' name='apft'/>
    <feature policy='require' name='els'/>
    <feature policy='require' name='iep'/>
    <feature policy='require' name='apqci'/>
    <feature policy='require' name='cte'/>
    <feature policy='require' name='ais'/>
    <feature policy='require' name='bpb'/>
    <feature policy='require' name='gs'/>
    <feature policy='require' name='ppa15'/>
    <feature policy='require' name='zpci'/>
    <feature policy='require' name='sea_esop2'/>
    <feature policy='require' name='te'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/fedora31.qcow2' index='1'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:1c:48:f0'/>
      <source network='default' portid='8ec8900a-e0e1-49e3-8871-6a63cbfa742f' bridge='virbr0'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='sclp' port='0'/>
      <alias name='console0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-20-test/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='virtio'>
      <alias name='input0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0004'/>
    </input>
    <input type='keyboard' bus='virtio'>
      <alias name='input1'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <audio id='1' type='none'/>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0006'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0007'/>
    </rng>
    <panic model='s390'/>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </secla

Comment 4 Martin Pitt 2021-12-14 16:17:23 UTC
Yunming: Your XML was cut off -- in the top part there is no "devname" inside. But..

> 3 Yeah, I borrow a s390x VM from beaker, I will send IP address to Katerina

If it's "just" beaker, we can do that ourselves as well, easier with the timing then. For a long time these were completely broken, good to hear that they work again. So I think next step is to reproduce/investigate it on our side.

Thanks!

Comment 5 Simon Kobyda 2021-12-15 12:25:09 UTC
> 3 Yeah, I borrow a s390x VM from beaker, I will send IP address to Katerina

So I just managed to reproduce it locally on my machine, so no need for the s390x machine,

Comment 6 Simon Kobyda 2022-01-04 13:44:29 UTC
Patch PR: https://github.com/cockpit-project/cockpit-machines/pull/490

Comment 7 Martin Pitt 2022-01-24 09:26:50 UTC
Fixed in version 260.

Comment 11 YunmingYang 2022-01-30 09:10:45 UTC
Test Versions:
cockpit-bridge-258-1.el9.x86_64
cockpit-ws-258-1.el9.x86_64
cockpit-system-258-1.el9.noarch
cockpit-machines-260-1.el9.noarch
cockpit-258-1.el9.x86_64
libvirt-dbus-1.4.1-5.el9.x86_64


Test Steps:
1 Provision a machine with around 400ms delay
2 Prepare the VM XML by "virt-install --connect qemu:///system --name subVmTest1 --os-variant fedora31 --boot hd,network --vcpus 2 --memory 2048 --import --disk /var/lib/libvirt/images/fedora31.qcow2 --graphics vnc,listen=127.0.0.1 --console pty,target.type=virtio --print-step 1 > xml"
3 Define the VM by "virsh define xml"
4 Enter the VM detail page
5 Click "Run" and switch "Console" to "Serial console" immediately

Test Results:
1 After step 5, at first, there will be an error shown, which is "error: Failed to get option 'devname': Option argument is empty". After some seconds, the error disappear, and "VNC console" will output boot log correctly

According to the results, move status to VERIFIED.

Comment 13 errata-xmlrpc 2022-05-17 12:44:42 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 (new packages: cockpit-machines), 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:2388