Skip to content

agent: Detect existing hosts with UEFI support#6139

Merged
nvazquez merged 4 commits into
apache:mainfrom
shapeblue:get-uefi-from-host
Apr 5, 2022
Merged

agent: Detect existing hosts with UEFI support#6139
nvazquez merged 4 commits into
apache:mainfrom
shapeblue:get-uefi-from-host

Conversation

@davidjumani
Copy link
Copy Markdown
Contributor

Description

Fixes #6087
Adds support to detect existing hosts with UEFI capability

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

  • Bring up a 4.13 env with VMware 6.5 (anything that supports UEFI)
  • Upgrade to latest main
  • Try to deploy a VM with UEFI
  • Deployment now passes Previously failed to find a suitable host as none were UEFI compatible

Before :

MariaDB [cloud]> select * from host_details where name = 'host.uefi.enable' \G
Empty set (0.00 sec)

After :

MariaDB [cloud]> select * from host_details where name = 'host.uefi.enable' \G
*************************** 1. row ***************************
     id: 34
host_id: 1
   name: host.uefi.enable
  value: true
*************************** 2. row ***************************
     id: 40
host_id: 2
   name: host.uefi.enable
  value: true
2 rows in set (0.00 sec)

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@nvazquez nvazquez added this to the 4.17.0.0 milestone Mar 18, 2022
Comment thread engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java Outdated
details.put("url", hostMo.getHostName());
details.put("username", username);
details.put("password", password);
boolean uefiLegacySupported = hostMo.isUefiLegacySupported();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these could be kept, same for other discoverers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be redundant as the code to check the UEFI support is subsequently called while adding a host

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2930

@nvazquez
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

tested on centos7, works fine

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3664)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31374 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3664-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3671)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32668 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3671-vmware-65u2.zip
Intermittent failure detected: /marvin/tests/smoke/test_usage.py
Intermittent failure detected: /marvin/tests/smoke/test_iso.py

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan help

@davidjumani davidjumani changed the title agent: Pass uefi support status as part of ready command agent: Detect existing hosts with UEFI support Mar 22, 2022
@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan help

@blueorangutan
Copy link
Copy Markdown

@davidjumani I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv]
Mgmt OS options: ['suse15', 'centos7', 'centos6', 'alma8', 'ubuntu18', 'ubuntu20', 'rocky8']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-alma8', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the matrix command.
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.

Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'nvazquez', 'borisstoyanov', 'DaanHoogland', 'shwstppr', 'andrijapanicsb', 'Pearl1594', 'davidjumani', 'harikrishna-patnala', 'vladimirpetrov', 'sureshanaparti', 'weizhouapache', 'NuxRo']

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 vmware-67u3

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 xcpng82

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + xcpng82) has been kicked to run smoke tests

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 xenserver-71

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + xenserver-71) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3691)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server 7
Total time taken: 27824 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3691-xcpng82.zip
Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
Intermittent failure detected: /marvin/tests/smoke/test_metrics_api.py

@nvazquez
Copy link
Copy Markdown
Contributor

@blueorangutan test centos7 xcpng82

@nvazquez nvazquez marked this pull request as draft March 22, 2022 14:07
@blueorangutan
Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + xcpng82) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3690)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 28196 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3690-vmware-67u3.zip
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3692)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 27656 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3692-xenserver-71.zip
Intermittent failure detected: /marvin/tests/smoke/test_diagnostics.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3698)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42933 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3698-xcpng82.zip
Smoke tests completed. 91 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_12_resize_volume_with_only_size_parameter Error 1.06 test_volumes.py

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3004

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3748)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31855 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6139-t3748-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez nvazquez marked this pull request as ready for review April 1, 2022 15:37
Copy link
Copy Markdown
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

LGTM - manually tested upgrading a 4.13 Vmware env with 2 hosts to 4.17:

Before upgrading:

MariaDB [cloud]> select * from host_details where name like '%uefi%';
Empty set (0.00 sec)

After upgrade:

MariaDB [cloud]> select * from host_details where name like '%uefi%';
+----+---------+------------------+-------+
| id | host_id | name             | value |
+----+---------+------------------+-------+
| 24 |       2 | host.uefi.enable | true  |
| 30 |       1 | host.uefi.enable | true  |
+----+---------+------------------+-------+
2 rows in set (0.00 sec)

@nvazquez nvazquez merged commit 5ab4309 into apache:main Apr 5, 2022
@Hudratronium
Copy link
Copy Markdown

Will the check take place on every "upgrade" from now on?

}

private boolean hostSupportsUefi() {
String cmd = "rpm -qa | grep -i ovmf";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cc @davidjumani @weizhouapache @DaanHoogland we may need to fix this as we support both EL and Ubuntu, rpm isn't installed by default on Ubuntu. Probably just check if /sys/firmware/efi using File::exists?

@Hudratronium
Copy link
Copy Markdown

Just as an idea:
Maybe checking via 'dpkg' should work for ubuntu - and even better - as well as for other debian derivate.

shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Mar 13, 2023
… hosts (apache#6423) (apache#221)

* Do not allow UEFI deployments on non UEFI enabled hosts

* Fix UEFI detection on KVM

* Refactor

* Improvement

agent: Detect existing hosts with UEFI support (apache#6139)

* agent: Pass uefi enabled status as part of ready command

* Cleanup

* Fix checkstyle

* Save uefi status if different

Co-authored-by: Marcus Sorensen <mls@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

UEFI hosts capability not detected after upgrade

7 participants