Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37823 - Add Secure Boot and Virtual TPM support for VMware #10324

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

nofaralfasi
Copy link
Contributor

@nofaralfasi
Copy link
Contributor Author

While testing this PR, I discovered a pre-existing bug on the compute_attributes form where the Automatic firmware option is not functioning correctly. I’ve created a new issue to track and address this problem: Issue #37834.

- Implement Secure Boot and Virtual TPM functionality for VMware.
- Move default firmware setting from `create_vm` to `parse_args`.
Copy link
Contributor

@stejskalleos stejskalleos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The combination BIOS+PXELinux BIOS works fine, but UEFI + Grub2 UEFI or Secure Boot always fails with:

2024-12-05T04:43:11 [W|app|41503fe0] Failed to create a compute vmware (VMware) instance molly-haugland.rhos-01.prod.psi.rdu2.redhat.com: RuntimeFault: RuntimeFault.summary
 41503fe0 |  
2024-12-05T04:43:11 [I|app|41503fe0] Backtrace for 'Failed to create a compute vmware (VMware) instance molly-haugland.rhos-01.prod.psi.rdu2.redhat.com: RuntimeFault: RuntimeFault.summary
 41503fe0 |  ' error (RbVmomi::Fault): RuntimeFault: RuntimeFault.summary
 41503fe0 | /usr/share/gems/gems/rbvmomi2-3.7.1/lib/rbvmomi/vim/Task.rb:15:in `wait_for_completion'
 41503fe0 | /usr/share/gems/gems/fog-vsphere-3.7.0/lib/fog/vsphere/requests/compute/create_vm.rb:71:in `create_vm_on_storage_pod'
 41503fe0 | /usr/share/gems/gems/fog-vsphere-3.7.0/lib/fog/vsphere/requests/compute/create_vm.rb:39:in `create_vm'
 41503fe0 | /usr/share/gems/gems/fog-vsphere-3.7.0/lib/fog/vsphere/models/compute/server.rb:314:in `save'
 41503fe0 | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:518:in `create_vm'

Tested on the latest stream, changes deployed with packit. I'll share instance details in PM.


test 'returns false and no errors when firmware is EFI and virtual_tpm is disabled' do
assert_equal false, @cr.send(:validate_tpm_compatibility, '0', 'efi')
assert_empty @cr.errors.full_messages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert_empty @cr.errors.full_messages
assert_empty @cr.errors

Nit: Isn't this enough to check?

Copy link
Contributor

@stejskalleos stejskalleos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous error was caused by a lack of configuration on the Vcenter side.

🍏 Now it works as expected.

@stejskalleos stejskalleos merged commit df3dd72 into theforeman:develop Dec 9, 2024
51 checks passed
@stejskalleos
Copy link
Contributor

Thanks @nofaralfasi and everyone involved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants