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 1853408

Summary: [machines] The VM failed to reboot after click the reboot button on the installation dialog for PXE
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: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: mpitt, wshi, ymao, yunyang
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.3   
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: 2020-11-04 03:09:56 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 2020-07-02 15:06:48 UTC
Description of problem: 
The VM failed to reboot after click the reboot button on the  installation dialog for PXE

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

How reproducible:
100%

Steps to Reproduce:
1. Login cockpit with root and open VM creation dialog
2. Input the name of VM.
    Then, choose 'Network Boot(PXE)' for the installation source type, and choose the network card which can connect to the network for the installation source.(eg: eno1)
    Choose Operating System and click 'Create' button to create the VM.
3. Install the vm accordingly and click reboot on the installation dialog at last
4. Try to use "Local Install Media" instead of PXE, and click reboot on  the installation dialog at last

Actual results:
After step 3, the vm is shut down instead of reboot, and the Boot Order" on Overview tab is not changed to disk automatically
After step 4, the vm can be reboot, but the cdrom can't be detached automatically

Expected results:
After step 3, the vm should reboot and the "Boot Order" on Overview tab should be changed to disk automatically.
After step 4,  the cdrom should be detached automatically.

Additional info:
According to bug1750637, the cdrom can be detached after reboot when using local install media, so the detach problem is introduced again for version 222, but it is ok to reboot.

Comment 1 Katerina Koukiou 2020-07-21 10:04:47 UTC
Xianghua regarding the issue with the VM running a PXE installation which shuts down when reboot is issued I sent a PR upstream:

https://github.com/cockpit-project/cockpit/pull/14382

Regarding the non-detached cdrom the following is the expected behavior:
* After virt-install process exists, which happens on shutdown/restart it changes the boot order so that the next boot will be from the created disk and not from the chrom or network in the PXE case.
* The CDROM device will still appear in the disks list, but without the ISO source specified.

So the installation XML contains the cdrom like this:

```
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/novell.iso' index='1'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
```

Whilst the after-installation XML contains the cdrom like this:

```
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

```


You can confirm that this is the original virt-install behavior and Cockpit Machines does not diverge if you run this by CLI and monitor accordingly:

virt-install --connect qemu:///system \
             --name subVmTestCreate1 --os-variant fedora28 --memory 256 \
             --quiet --disk size=0.25,format=qcow2 --noautoconsole --wait -1 \
             --cdrom /var/lib/libvirt/novell.iso \
             --graphics spice,listen=127.0.0.1 --graphics vnc,listen=127.0.0.1

Comment 5 Xianghua Chen 2020-07-31 02:13:36 UTC
Verified with package:
cockpit-machines-224-1.el8.noarch

Step:
1. Login cockpit with root and open VM creation dialog
2. Input the name of VM.
    Then, choose 'Network Boot(PXE)' for the installation source type, and choose the network card which can connect to the network for the installation source.(eg: eno1)
    Choose Operating System and click 'Create' button to create the VM.
3. Install the vm accordingly and click reboot on the installation dialog at last
4. Try to use "Local Install Media" instead of PXE, and click reboot on  the installation dialog at last

After step 3, the vm is reboot, and the Boot Order" on Overview tab is changed to disk automatically.
After step 4, the vm can be reboot, and CDROM device will still appear in the disks list, but without the ISO source specified.

So verified.

Comment 8 errata-xmlrpc 2020-11-04 03:09:56 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-2020:4705