Bug 1773621

Summary: "Boot disk iPXE - host" can be cloned/customized and the custom values are shown within the System-Profile, but the generated "Host ISO" always contains the default template instead
Product: Red Hat Satellite Reporter: Rainer Beyel <rbeyel>
Component: Bootdisk PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED NOTABUG QA Contact: Roman Plevka <rplevka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: jpasqual, lzap, michael.vishchers.extern
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
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: 2019-11-22 13:27:43 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 Rainer Beyel 2019-11-18 15:04:19 UTC
Description of problem:
  "Boot disk iPXE - host" can be cloned/customized and the custom values are shown within the System-Profile, but the generated "Host ISO" always contains the default template instead

Version-Release number of selected component:
  Satellite 6.6.0
  RHEL 8.0

How reproducible:
  1. Clone and customize "Boot disk iPXE - host"
  2. Create a new System-Profile and select the customized template
  3. Create a "Host ISO" from the new System-Profile

Actual results:
  Instead of the customized template the default template is used within the Host ISO

Expected results:
  The customized template is used

Additional info:
  Reproducer with Satellite 6.6 and RHEL 8.0 system profile

  - Hosts, Provisioning Templates:
    - "Boot disk iPXE - host"
      - Clone
        - "Boot disk iPXE - host rbeyel clone"
        - Template, added:
          - ...
            echo rbeyel clone
            echo Foreman Bootdisk: Host image (<%= @host.name %>)
            ...
        - "Successfully created Boot disk iPXE - host rbeyel clone"
    - "Boot disk iPXE - host rbeyel clone"
      - Type: "Boot disk embedded template" (default)
      - Association: "Applicable Operating Systems" "RHEL 8.0"
  - Hosts: "Operating Systems", "RHEL 8.0"
    - Templates, Boot disk embedded template: "Boot disk iPXE - host rbeyel clone"
  - Hosts, All Hosts
    - rhel8-2.rr-int1.net
      - Templates, Boot disk embedded template, Edit
        - ...
          echo rbeyel clone
          echo Foreman Bootdisk: Host image (<%= @host.name %>)
          ...
  - Host ISO
    - # hammer bootdisk host --host rhel8-2.rr-int1.net
      Successfully downloaded host disk image to rhel8-2.rr-int1.net.iso
    - # mount -o loop rhel8-2.rr-int1.net.iso /mnt/iso
      mount: /dev/loop0 is write-protected, mounting read-only  
    - cat /mnt/iso/script
      #!ipxe
      # Example foreman_bootdisk host template
      # This template is rendered for use inside a host-specific boot disk.
      #
      # Copy this template to customize it, the original is read-only.
      ...
      echo Foreman Bootdisk: Host image (rhel8-2.rr-int1.net)
      ...
    - Custom entry "echo rbeyel clone" is missing

Comment 4 Lukas Zapletal 2019-11-22 13:27:43 UTC
Hello, please use Administer - Bootdisk settings to set which template to use during rendering.

Comment 7 Lukas Zapletal 2020-01-06 15:32:15 UTC
Bootdisk template job is to load iPXE which then makes another request to Satellite which is handled by other template called iPXE which can be associated per hostgroup or per host. Please work with the customer to utilize this or describe what exactly needs to be different per every single individual bootdisk generated.