VMware boot disk

Problem:
I’m looking at using the bootdisk plugin to automatically provision VMware hosts. It works fine in BIOS mode, but I’m hoping to use EFI. I’m thinking this doesn’t currently work because the provisioning process gets forced to use the minimal host image, but to be usable on EFI it would need the full host image. Is there a way as a user to force this automated workflow to use the full host image as opposed to the minimal one?

Foreman and Proxy versions:
2.1

Distribution and version:
CentOS 7.8

Full host bootdisk is EFI compatible.

1 Like

Right. But can I use it in the automated provisioning workflow? I don’t see an option to choose which image, it just seems to use the minimal host image no matter what

What’s minimal host image? Can you paste some screenshots or CLI commands with expectations how things should work?

Absolutely. So I go through the workflow to create a host on my VMware compute resource:

Then I switch to the OS tab and select boot disk:

I’ll also show EFI selected in the VM tab:

Then I go ahead and click submit and get a host in VMware, but see this:

image

I believe this is because it’s using a per-host image as opposed to a full host image (sorry if the nomenclature I used earlier was wrong). I’m unclear if there’s a way to force it to use a full host image.

Try this patch (untested):

https://github.com/theforeman/foreman_bootdisk/pull/99

Thanks for looking into this! I’m not sure I know the proper way to apply this patch to an existing foreman installation. I tried anyway, ended up with this error:

Revert the patch, apply again (I rebased an overlook).

New error this time:

I don’t have VMWare so I can’t reproduce it here, can you revert and apply again? This time I added a logging message to find out what kind of object is this called on. Ruby can be sometimes terribly confusing when objects are extended and the context is not clear. Send me the info log line that reads ISO IMAGE OBJECT.

Here you go:

2020-10-14T05:15:18 [I|app|0e239341] ISO IMAGE OBJECT: #<Host::Managed id: nil, name: “felix-winfrey.jeff.dev”, last_compile: nil, last_report: nil, updated_at: nil, created_at: nil, root_pass: [FILTERED], architecture_id: 1, operatingsystem_id: 1, environment_id: nil, ptable_id: 116, medium_id: 1, build: true, comment: “”, disk: “”, installed_at: nil, model_id: nil, hostgroup_id: 1, owner_id: 4, owner_type: “User”, enabled: true, puppet_ca_proxy_id: nil, managed: true, use_image: nil, image_file: nil, uuid: “501ffe9f-a53d-3a56-d59e-939f763e1f54”, compute_resource_id: 1, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: “Host::Managed”, otp: nil, realm_id: nil, compute_profile_id: 1, provision_method: “bootdisk”, grub_pass: “$5$T3Ho9bookfZCZedd$g7aXK9eQAxrVSmGe34HW4lQ141lzYF…”, global_status: 0, lookup_value_matcher: [FILTERED], pxe_loader: “None”, initiated_at: nil, build_errors: nil>

Do you still see the same error? Then I need to see the backtrace, because this comes probably from different code than I thought.

I do see the same error. Was something supposed to have changed since yesterday? Code looks the same to me. Thanks

No changes I just need to see ruby stacktrace to find out the code which actually fails with this error.

I’m not great with ruby, so not really sure how to provide that stacktrace

When you encounter the error you showed on the screenshot, go to production.log and there should be an error message with many .rb files and line numbers. Pastebin me that.

Here you go: https://pastebin.com/TRS4xM4U

Damn, the stacktrace is swallowed. Can you try again now with debug logging turned on? Foreman core should log the backtrace for rolled transactions in INFO log, I wonder why this does not work.

Just before trying again do one additional patch:

diff --git a/app/models/concerns/foreman_bootdisk/orchestration/compute.rb b/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
index dfed569..5809bf4 100644
--- a/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
+++ b/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
@@ -71,6 +71,7 @@ module ForemanBootdisk
       def setGenerateIsoImage
         bootdisk_generate_iso_image
       rescue StandardError => e
+        Rails.logger.info "BT (#{exception.class}): #{exception.message}\n" + backtrace.join("\n")
         failure format(_('Failed to generate ISO image for instance %{name}: %{message}'), name: name, message: e.message), e
       end
 

Sure, here you go: https://pastebin.com/wWUTAiDt

I made a typo when I was doing the last patch :slight_smile: It should have been:

diff --git a/app/models/concerns/foreman_bootdisk/orchestration/compute.rb b/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
index dfed569..058a597 100644
--- a/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
+++ b/app/models/concerns/foreman_bootdisk/orchestration/compute.rb
@@ -71,6 +71,7 @@ module ForemanBootdisk
       def setGenerateIsoImage
         bootdisk_generate_iso_image
       rescue StandardError => e
+        Rails.logger.info "BT (#{e.class}): #{e.message}\n" + backtrace.join("\n")
         failure format(_('Failed to generate ISO image for instance %{name}: %{message}'), name: name, message: e.message), e
       end
 

It’s exception vs e :stuck_out_tongue: