Bug 1303738 - Initial reboot of discovered host fails
Initial reboot of discovered host fails
Status: CLOSED NOTABUG
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Image (Show other bugs)
6.1.3
All Linux
medium Severity medium (vote)
: Unspecified
: --
Assigned To: Lukas Zapletal
Katello Bug Bin
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-01 14:50 EST by Tasos Papaioannou
Modified: 2016-02-25 05:34 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-25 05:34:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tasos Papaioannou 2016-02-01 14:50:43 EST
Description of problem:

Initial reboot of discovered host fails.

Version-Release number of selected component (if applicable):

foreman-discovery-image-2.1.0-36.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.19-1.el7sat.noarch

How reproducible:

100%

Steps to Reproduce:

This is an issue seen while testing the provisioning of libvirt guests with the Red Hat Cloud Infrastructure Unified Installer, which is currently built on Satellite 6.1.3.

1.) Create libvirt guest to pxe boot into foreman discovery:

# virt-install -n foreman-discovery-test --os-variant rhel7 --memory 1024 --pxe --vcpus 1 --cpu host,-invtsc --disk bus="virtio,size=10" --network "bridge:br1" --boot "network,hd" --graphics "vnc,listen=0.0.0.0,password=redhat" --noautoconsole

Starting install...
Allocating 'foreman-discovery-test.qcow2'   |  10 GB  00:00:00     
Creating domain...                          |    0 B  00:00:00     
Domain installation still in progress. You can reconnect to 
the console to complete the installation process.

2.) Verify that foreman-discovery-test is running, and that it appears under Hosts > Discovered Hosts on the Satellite.

# virsh list
 Id    Name                           State
----------------------------------------------------
 106   satellite                      running
 139   foreman-discovery-test         running

3.) In the Satellite web UI, click the down arrow next to Provision for this discovered host, and click Reboot. See that the host shut down instead of rebooting:

# virsh list
 Id    Name                           State
----------------------------------------------------
 106   satellite                      running


4.) Alternatively, with ssh enabled on the foreman discovery image (adding "fdi.ssh=1 fdi.rootpw=XXXX" to the APPEND line in the Satellite's /var/lib/tftpboot/pxelinux.cfg/default file), the same behavior can be seen by logging in to the guest and running "shutdown -r now" manually:

# ssh 192.168.0.127
# shutdown -r now
Connection to 192.168.0.127 closed by remote host.
Connection to 192.168.0.127 closed.

# virsh list
 Id    Name                           State
----------------------------------------------------
 106   satellite                      running

5.) I only see this issue on the first reboot attempt after installing the guest. If I then restart the guest with "virsh start foreman-discovery-test", further reboots from the shell or Satellite web UI are successful.



Actual results:

Reboot of newly-created discovered host from Satellite web UI or shell fails to restart the guest.

Expected results:

Successful reboot.

Additional info:
Comment 1 Lukas Zapletal 2016-02-24 10:08:38 EST
Hello, unable to reproduce. But I've already encountered similar behavior and it was caused by the hypervisor. Some of them, including libvirt, treats the initial start of the VM in a special way - they expect an OS installation. Then they need to switch BIOS configuration in order to boot from first drive and this causes the problem.

You need to provide options to libvirt not to actually do this. The key option is I think --boot for virt-install instead of --pxe (from its man page: Use the PXE boot protocol to load the initial ramdisk and kernel for starting the guest installation process.)

https://github.com/lzap/bin-public/blob/master/virt-install-discovery

Please confirm.
Comment 2 Lukas Zapletal 2016-02-24 10:09:52 EST
One more thing - in Satellite 6 all hosts should be set to boot from network. Provisioned hosts boot PXELinux which chainloads from first drive, therefore there is no need to change the BIOS, even when you want to reprovision it.
Comment 3 Lukas Zapletal 2016-02-24 10:25:23 EST
I am pretty sure this is the issue here, created documentation for this particular case: https://github.com/theforeman/theforeman.org/pull/545
Comment 4 Tasos Papaioannou 2016-02-24 10:39:33 EST
Removing the --pxe option from virt-install (leaving "network" as the first --boot option) resolved the issue. Thanks!
Comment 5 Lukas Zapletal 2016-02-25 05:34:28 EST
Thanks for info!

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