Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-18177

Always try to eject the cdrom even whether host was built with Auto-attach bootdisk feature or Manual attachment of Full Host Image

XMLWordPrintable

    • Rocket
    • False
    • Moderate
    • sat-rocket
    • None
    • None
    • None
    • To Do

      Description of problem:

      The basic code for eject_cdrom snippet is the following

      <% if @host.respond_to?(:bootdisk_build?) && @host.bootdisk_build? -%>
      eject -v
      <% end -%>

      And we call the snippet in these many templates:

      /usr/share/foreman/app/views/unattended/provisioning_templates/finish/preseed_default_finish.erb:<%= snippet 'eject_cdrom' -%>
      /usr/share/foreman/app/views/unattended/provisioning_templates/provision/autoyast_default.erb:<%= snippet 'eject_cdrom' -%>
      /usr/share/foreman/app/views/unattended/provisioning_templates/provision/autoyast_sles_default.erb:<%= snippet 'eject_cdrom' -%>
      /usr/share/foreman/app/views/unattended/provisioning_templates/provision/kickstart_default.erb:<%= snippet 'eject_cdrom' -%>

      This means, Unless we use the Auto-Attach bootdisk method where "Boot Disk Based" build option is enabled, For no other circumstances the cdrom will be ejected.

      But it can prove to be problematic when a bare-metal build is happening using Full Host Boot Disk and cdrom\VirtualMedia is at the top of the Boot device order.

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

      Any supported version of Satellite 6

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a blank VM and ensure that CDROM is the first boot device and Harddisk is the second

      2. Use Satellite to create a Host profile for that VM and submit it for build.

      3. Download Full Host Image for the host.

      4. Upload that ISO to the VM's cdrom and boot the VM with the same

      5. Let the build happen on it's own and reboot the system afterwards.

      Actual results:

      Once the system is marked as built in satellite, The build token is invalidated.

      So if the system reboots and boots up with the cdrom once again, Then the attached ISO will try to rebuild the system but will fail to fetch the kickstart due to an invalid token embedded in the URL.

      ( and system will go into emergency mode )

      This can only be solved by powering off the system, ejecting the cdrom and powering it back on or else make HDD as the first boot device somehow.

      Expected results:

      Unless, there some problems could happen with the overall kickstart workflow, I would expect "eject -v" to be executed at the end of each build so that the cdrom gets detached before the system reboots.

      Additional info:

      NA

              Unassigned Unassigned
              rhn-support-saydas Sayan Das
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: