Bug 1913205

Summary: [machines] The CPU type should not keep on changing between running and shutdown status
Product: Red Hat Enterprise Linux 8 Reporter: Xianghua Chen <xchen>
Component: cockpit-appstreamAssignee: Katerina Koukiou <kkoukiou>
Status: CLOSED ERRATA QA Contact: Xianghua Chen <xchen>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.4CC: mmarusak, mpitt, wshi, ymao
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:53:30 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 Xianghua Chen 2021-01-06 09:23:09 UTC
Description of problem: 
The CPU type should not keep on changing between running and shutdown status

Version-Release number of selected component (if applicable):
cockpit-machines-234-1.el8.noarch
libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a bare metal machine (Not a Virtual env) 

2. Click Import VM, input the name/prepared vm image/os, then unclick "Immediately start VM", click Import

3. Enter the VM detail page, and,  the CPU type is host as default

4. Click Run,the CPU type will change according to the host cpu,e.g.: custom (Haswell-noTSX-IBRS) 

There is an icon showing "Changes will take effect after shutting down the VM"

Check the CPU mode in xml ,same to the value on the page, by :

# virsh dumpxml vm-name

5. Click shutdown , the CPU type changed back to host, it will change back to the value in step 4 if you run it again.



Actual results:
There is icon showing "Changes will take effect after shutting down the VM" and then it change to host after shutting down



Expected results:
The CPU type should not keep on changing between running and shutdown status

Additional info:

Comment 1 Katerina Koukiou 2021-01-06 10:21:36 UTC
Checking the XML configuration from the CLI the <cpu> entry is indeed different between active and inactive XML. For example:

Stopped domain:

  <cpu mode='host-model' check='partial'/>


Running domain:

  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Skylake-Client-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='clflushopt'/>
    <feature policy='require' name='umip'/>
    <feature policy='require' name='md-clear'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='arch-capabilities'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaves'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='ibpb'/>
    <feature policy='require' name='amd-stibp'/>
    <feature policy='require' name='amd-ssbd'/>
    <feature policy='require' name='skip-l1dfl-vmentry'/>
    <feature policy='require' name='pschange-mc-no'/>
    <feature policy='disable' name='mpx'/>
  </cpu>


I am guessing this is expected, so I will just remove the warning Icon and let the UI update the CPU field without notifying the user when the state is tweaked.

Comment 2 Xianghua Chen 2021-01-07 02:32:50 UTC
Thanks for the explanation, yes it make sense, let's just make it silent.

Comment 3 Martin Pitt 2021-01-07 05:54:39 UTC
Katerina sent a fix in https://github.com/cockpit-project/cockpit/pull/15105 , thank you!

Comment 6 Xianghua Chen 2021-01-13 07:07:21 UTC
Verified with package:
cockpit-machines-235-1.el8.noarch
libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.x86_64

Verify steps:
1. Prepare a bare metal machine (Not a Virtual env) 
2. Click Import VM, input the name/prepared vm image/os, then unclick "Immediately start VM", click Import
3. Enter the VM detail page, and,  the CPU type is host as default
4. Click Run,the CPU type will change according to the host cpu,e.g.: custom (Haswell-noTSX-IBRS) 
There is no icon showing "Changes will take effect after shutting down the VM"
Check the CPU mode in xml ,same to the value on the page, by :
# virsh dumpxml vm-name
5. Click shutdown , the CPU type changed back to host, check the xml again.

No icons showing "Changes will take effect after shutting down the VM"
So verified.

Comment 8 errata-xmlrpc 2021-05-18 15:53:30 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-2021:1875