Skip to content

Fix UEFI detection on KVM and prevent deployments on non UEFI enabled hosts#6423

Merged
nvazquez merged 4 commits intoapache:mainfrom
shapeblue:fixuefimismatch
May 31, 2022
Merged

Fix UEFI detection on KVM and prevent deployments on non UEFI enabled hosts#6423
nvazquez merged 4 commits intoapache:mainfrom
shapeblue:fixuefimismatch

Conversation

@nvazquez
Copy link
Copy Markdown
Contributor

@nvazquez nvazquez commented May 30, 2022

Description

This PR fixes 2 issues:

  • Prevent UEFI deployments on non UEFI enabled hosts (do not assume the host detail will always be present in case of not enabled)
  • Fix the UEFI detection on KVM (uefi.properties file check was missing)

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 or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Tested on KVM - one UEFI enabled host, one disabled

@nvazquez nvazquez added this to the 4.17.0.0 milestone May 30, 2022
@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@nvazquez nvazquez requested review from davidjumani and yadvr May 30, 2022 18:31
@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@nvazquez 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.

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.

code lgtm

@blueorangutan
Copy link
Copy Markdown

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

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

s_logger.debug("agent.hooks.libvirt_vm_on_stop.method is " + _agentHooksVmOnStopMethod);
}

public boolean isUefiPropertiesFileSet() {
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.

@nvazquez UEFI properties are loaded from this file while configuring the resource, no need to check again for this file, instead check for properties loaded or not. Also, re-use this method in loadUefiProperties() method below for the same condition. Thanks.

Suggested change
public boolean isUefiPropertiesFileSet() {
public boolean isUefiPropertiesLoaded() {
return _uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null
}

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.

Done, thanks - nice catch

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.

Have actually simplified the check

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@acs-robot
Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6423 (SL-JID-1643)

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@nvazquez 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 3507

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@nvazquez 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.

@acs-robot
Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@acs-robot
Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6423 (SL-JID-1644)

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6423 (SL-JID-1645)

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_DeployVmAffinityGroup Error 1.17 test_affinity_groups.py
test_DeployVmAntiAffinityGroup Error 1.14 test_affinity_groups.py
ContextSuite context=TestDeployVM>:setup Error 0.00 test_vm_life_cycle.py
test_01_secure_vm_migration Error 0.01 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 0.01 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 0.01 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 0.01 test_vm_life_cycle.py
ContextSuite context=TestVMLifeCycle>:setup Error 2.67 test_vm_life_cycle.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setup Error 0.00 test_affinity_groups_projects.py
test_01_snapshot_root_disk Error 907.68 test_snapshots.py
ContextSuite context=TestRVPCSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcRemoteAccessVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
test_01_nic Error 51.42 test_nic.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestLBRuleUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestNatRuleUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestPublicIPUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestSnapshotUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestVmUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestVolumeUsage>:setup Error 0.00 test_usage.py
ContextSuite context=TestVpnUsage>:setup Error 0.00 test_usage.py
test_09_project_suspend Error 1.07 test_projects.py
test_10_project_activation Error 1.06 test_projects.py
ContextSuite context=TestRouterIpTablesPolicies>:setup Error 0.00 test_routers_iptables_default_policy.py
ContextSuite context=TestVPCIpTablesPolicies>:setup Error 0.00 test_routers_iptables_default_policy.py
ContextSuite context=TestVPCNics>:setup Error 0.00 test_vpc_router_nics.py
test_01_cancel_host_maintenace_with_no_migration_jobs Error 0.04 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 0.04 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 0.04 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Error 0.01 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Error 0.01 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Error 0.01 test_host_maintenance.py

@blueorangutan
Copy link
Copy Markdown

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

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 1 Code Smell

12.9% 12.9% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

code LGTM

Copy link
Copy Markdown
Contributor

@slavkap slavkap left a comment

Choose a reason for hiding this comment

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

code looks good

@nvazquez nvazquez merged commit 82e0d5d into apache:main May 31, 2022
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.

6 participants