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

undefined methods `bootdisk_raise' and 'bootdisk_chain_url'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • 6.17.0
    • None
    • None
    • Automated
    • None

      • Foreman latest
      • Configured OS etc, it works to provision BIOS/PXE hosts with TFTP
      • Tried to create a UEFI/PXE host, the following error is issued:

       

      Failure parsing Boot disk Grub2 EFI - generic host: undefined method `bootdisk_raise' for #<Foreman::Renderer::Scope::Provisioning:0x00007fc8928a9910 @source=#<Foreman::Renderer::Source::Database:0x00007fc8928a9af0 @template=#<ProvisioningTemplate id: 31, name: "Boot disk Grub2 EFI - generic host", template: "<%#\nname: Boot disk Grub2 EFI - generic host\nsnipp...", snippet: false, template_kind_id: 1, created_at: "2024-07-16 09:08:47.747942000 0200", updated_at: "2024-07-16 09:08:47.747942000 +0200", locked: true, default: true, vendor: "Foreman", type: "ProvisioningTemplate", os_family: nil, description: "Boot disk Grub2 EFI - generic host">, @name="Boot disk Grub2 EFI - generic host", @content="<%#\nname: Boot disk Grub2 EFI - generic host\nsnippet: false\nmodel: ProvisioningTemplate\nkind: Bootdisk\ndescription: |\n Boot disk Grub2 EFI - generic host\nrequire:\n- plugin: foreman_bootdisk\n version: 20.0.0\n-%>\n#\n# Boot disk Grub2 EFI - generic host\n#\n#set debug=\"http,efinet,net\"\n#set debug=all\necho \"Foreman Bootdisk: 'Boot disk Grub2 EFI - generic host' template\"\necho\necho \"*******************************************************\"\necho \" REQUIREMENTS:\"\necho \" * SUBNET GENERIC IMAGE ONLY (host image not supported)\"\necho \" * HOST PARAM default_grub_install_entry set to efi_http\"\necho \" * PROXY WITH HTTPBOOT FEATURE\"\necho \" * HTTP UEFI BOOT ONLY (Legacy/PXE not supported)\"\necho \" * IPv4 ONLY (IPv6 not tested, change the template)\"\necho \" * HTTP ONLY (change the template for HTTPS)\"\necho \" * ISC DHCP (other servers not tested)\"\necho \" * GRUB FROM RHEL 8.3/7.9+ (when generating the image)\"\necho \" * EFI HTTP or HTTPS grub entry must be selected in menu\"\necho \" * DNS must resolve proxy hostname via DNS proxy if set\"\necho \"******************************************************\"\nsleep 5\n<%\n# possible values are: \"http\" or \"https\"\nproxy_proto = \"http\"\n\n@subnet || bootdisk_raise(\"Generic disk not supported for EFI, use subnet disk\")\n@subnet.template? || bootdisk_raise(\"Requires a proxy with template feature\")\nproxy_port = if proxy_proto == \"http\"\n @subnet.httpboot.httpboot_http_port\nelse\n @subnet.httpboot.httpboot_https_port\nend\n# Workaround for \"no DNS server configured\" https://bugzilla.redhat.com/show_bug.cgi?id=1842509\nproxy_httpboot_host = dns_lookup(@subnet.httpboot.hostname)\nproxy_template_host = dns_lookup(@subnet.template.hostname)\n-%>\necho\nnet_ls_cards\necho \"Configuring ALL cards via BOOTP/IPv4\"\nnet_bootp\n# uncomment here for IPv6 support (not tested)\n#echo \"Configuring ALL cards via BOOTP/IPv6\"\n#net_ipv6_autoconf\nnet_ls_addr\nnet_ls_routes\nnet_ls_dns\necho Trying to ping proxy_httpboot_host: <%= proxy_httpboot_host %>\nping --count 1 <%= proxy_httpboot_host %> || echo Ping to proxy_httpboot_host failed or ping command not available.\necho Trying to ping proxy_template_host: <%= proxy_template_host %>\nping --count 1 <%= proxy_template_host %> || echo Ping to proxy_template_host failed or ping command not available.\nsleep 5\nset root=(<%= proxy_proto %>,<%= proxy_httpboot_host %>:<%= proxy_port %>)\n# The variable will not survive configfile fetch, therefore absolute path\n# must be used in the chainloaded template.\n# https://bugzilla.redhat.com/show_bug.cgi?id=1842893\nset http_path=/httpboot/\nset default=efi_<%= proxy_proto %>\n<% (0..32).each do |i| -%>\n echo \"Trying efinet<%= i %> via <%= proxy_proto %>://<%= proxy_template_host %>:<%= proxy_port %>/unattended/PXEGrub2?mac=$net_efinet<%= i %>_dhcp_mac\"\n set net_default_mac=$net_efinet<%= i %>_dhcp_mac\n sleep 5\n configfile (<%= proxy_proto %>,<%= proxy_template_host %>:<%= proxy_port %>)/unattended/PXEGrub2?mac=$net_efinet<%= i %>_dhcp_mac\n<% end -%>\n\necho \"Could not find a host with PXEGrub2 template and one of the MAC addresses!\"\necho \"The system will poweroff in few minutes...\"\nsleep 500\npoweroff\n">, @host=#<Host::Managed id: 6, name: "my-host.example.com", last_compile: nil, last_report: nil, updated_at: "2024-08-30 10:16:47.621208000 +0200", created_at: "2024-08-28 16:39:50.121550000 +0200", root_pass: [FILTERED], architecture_id: 1, operatingsystem_id: 2, ptable_id: 164, medium_id: 16, build: false, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 5, owner_type: "User", enabled: true, puppet_ca_proxy_id: 3, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 3, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: "build", grub_pass: "$5$8T3y9fIFQb9MTkaS$hZ0O/1AvDmwF9USwReSmdpY7JFpj7w...", discovery_rule_id: nil, global_status: 0, lookup_value_matcher: [FILTERED], openscap_proxy_id: 3, pxe_loader: "PXELinux UEFI", initiated_at: "2024-08-30 10:13:00.863692000 +0200", build_errors: nil, creator_id: 5>, @params={}, @variables_keys=[], @mode="real", @template_name="Boot disk Grub2 EFI - generic host", @loaded=["load_variables_base"], @medium_provider=#<MediumProviders::Default:0x00007fc8928a9438 @entity=#<Host::Managed id: 6, name: "my-host.example.com", last_compile: nil, last_report: nil, updated_at: "2024-08-30 10:16:47.621208000 +0200", created_at: "2024-08-28 16:39:50.121550000 +0200", root_pass: [FILTERED], architecture_id: 1, operatingsystem_id: 2, ptable_id: 164, medium_id: 16, build: false, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 5, owner_type: "User", enabled: true, puppet_ca_proxy_id: 3, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 3, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: "build", grub_pass: "$5$8T3y9fIFQb9MTkaS$hZ0O/1AvDmwF9USwReSmdpY7JFpj7w...", discovery_rule_id: nil, global_status: 0, lookup_value_matcher: [FILTERED], openscap_proxy_id: 3, pxe_loader: "PXELinux UEFI", initiated_at: "2024-08-30 10:13:00.863692000 +0200", build_errors: nil, creator_id: 5>, @errors=[], @unique_id="almalinux-garr-HUPoRN6tqM21">, @dynamic=false, @arch="x86_64", @osver=9, @mediapath="url --url https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os/", @kernel="boot/almalinux-garr-HUPoRN6tqM21-vmlinuz", @initrd="boot/almalinux-garr-HUPoRN6tqM21-initrd.img", @kernel_uri="https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os//images/pxeboot/vmlinuz", @initrd_uri="https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os//images/pxeboot/initrd.img", @additional_media=[], @provisioning_type="host", @static=false, @template_url=nil, @template_input_values={}, @renderer=Foreman::Renderer::SafeModeRenderer, @allowed_helpers=[:foreman_url, :snippet, :snippets, :snippet_if_exists, :indent, :foreman_server_fqdn, :foreman_server_url, :foreman_request_addr, :log_debug, :log_info, :log_warn, :log_error, :log_fatal, :template_name, :dns_lookup, :pxe_kernel_options, :save_to_file, :subnet_param, :subnet_has_param?, :global_setting, :default_template_url, :plugin_present?, :medium_provider, :medium_uri, :user_auth_source_name, :all_host_statuses, :all_host_statuses_hash, :all_host_statuses_labels_hash, :host_status, :preview?, :raise, :input, :input_resource, :rand, :rand_hex, :rand_name, :mac_name, :host_kernel_release, :host_uptime_seconds, :host_memory, :host_sockets, :host_cores, :host_virtual, :number_to_currency, :number_to_human, :number_to_percentage, :number_with_delimiter, :number_with_precision, :number_to_human_size, :gem_version_compare, :sequence_hostgroup_param_next, :transpile_coreos_linux_config, :transpile_fedora_coreos_config, :parse_yaml, :parse_json, :to_json, :to_yaml, :foreman_server_ca_cert, :format_time, :shell_escape, :join_with_line_break, :current_date, :current_time, :truthy?, :falsy?, :previous_revision, :foreman_short_version, :product_short_version, :bootdisk_chain_url, :bootdisk_raise, :host_puppet_classes, :grub_pass, :ks_console, :root_pass, :media_path, :match, :host_param_true?, :host_param_false?, :host_param, :host_param!, :host_puppet_server, :host_puppet_ca_server, :host_puppet_environment, :host_enc, :install_packages, :update_packages, :load_organizations, :load_locations, :load_hosts, :load_operating_systems, :load_subnets, :load_smart_proxies, :load_user_groups, :load_host_groups, :load_domains, :load_realms, :load_users], @allowed_variables={:additional_media=>[], :arch=>"x86_64", :dynamic=>false, :host=>#<Host::Managed id: 6, name: "my-host.example.com", last_compile: nil, last_report: nil, updated_at: "2024-08-30 10:16:47.621208000 +0200", created_at: "2024-08-28 16:39:50.121550000 +0200", root_pass: [FILTERED], architecture_id: 1, operatingsystem_id: 2, ptable_id: 164, medium_id: 16, build: false, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 5, owner_type: "User", enabled: true, puppet_ca_proxy_id: 3, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 3, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: "build", grub_pass: "$5$8T3y9fIFQb9MTkaS$hZ0O/1AvDmwF9USwReSmdpY7JFpj7w...", discovery_rule_id: nil, global_status: 0, lookup_value_matcher: [FILTERED], openscap_proxy_id: 3, pxe_loader: "PXELinux UEFI", initiated_at: "2024-08-30 10:13:00.863692000 +0200", build_errors: nil, creator_id: 5>, :initrd=>"boot/almalinux-garr-HUPoRN6tqM21-initrd.img", :kernel=>"boot/almalinux-garr-HUPoRN6tqM21-vmlinuz", :initrd_uri=>"https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os//images/pxeboot/initrd.img", :kernel_uri=>"https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os//images/pxeboot/vmlinuz", :mediapath=>"url --url https://almalinux.mirror.garr.it/9/BaseOS/x86_64/os/", :osver=>9, :provisioning_type=>"host", :static=>false, :template_name=>"Boot disk Grub2 EFI - generic host"}>.

      • This prevents `pxelinux.efi` from being generated,, TFTP fails, host is not provisioned

      Templates

      When resolving host templates, the following are associated (stock templates, not edited in any way)

      Kind Name
      Boot disk Boot disk Grub2 EFI - generic host
      PXEGrub template Kickstart default PXEGrub
      PXEGrub2 template Kickstart default PXEGrub2
      PXELinux template Kickstart default PXELinux
      Host initial configuration template Linux host_init_config default
      iPXE template Kickstart default iPXE
      Provisioning template Kickstart default

      Similar previous issues

      https://community.theforeman.org/t/unable-to-generate-bootdisks/9707
      https://projects.theforeman.org/issues/22136

       

              rhn-engineering-lstejska Leos Stejskal
              rhn-engineering-lstejska Leos Stejskal
              Shubham Ganar Shubham Ganar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: