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

Change exception when orchestrating VM start #9062

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lucas-a-martins
Copy link
Contributor

Description

When attempting to start a VM, if an error occurs, the exception displayed to users is the same as what is being logged, which can expose information about the environment.

This PR addresses this issue by keeping the current message to be sent to the logs and adding a new one for the exception shown to users.

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)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

Exception before the proposed changes

old-exception

Exception after the proposed changes

new-exception

How Has This Been Tested?

Using a stopped VM, I changed the Compute Offering to a offering with Host Tags incompatible with every host in my environment in order to force the exception, then I tried to start the VM. An exception was thrown as shown in the screenshots above.

I also checked the logs in both cases and the only changes was log level and the removal of a duplicated message at the end of the log related to the exception.

Old log:

2024-05-06T19:19:34,582 WARN [c.c.v.ClusteredVirtualMachineManagerImpl] (Work-Job-Executor-35:[ctx-613c449f, job-326/job-327, ctx-6739b946]) (logid:c2b5e46f) Unable to orchestrate start VM instance {"id":32,"instanceName":"i-2-32-VM","type":"User","uuid":"0447f7cc-d6be-4999-875b-391ecf529fe4"} due to [No suitable host found.]. com.cloud.utils.exception.CloudRuntimeException: No suitable host found.

New log:

2024-05-07T18:26:38,697 ERROR [c.c.v.ClusteredVirtualMachineManagerImpl] (Work-Job-Executor-69:[ctx-73d78bb7, job-563/job-564, ctx-1b492476]) (logid:55146be5) Unable to orchestrate start VM instance {"id":47,"instanceName":"i-2-47-VM","type":"User","uuid":"e07b123d-51b2-4c5e-845c-880da28b7518"} due to [No suitable host found.].

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm. didn't test.

@vishesh92
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] 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
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.

clgtm

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 16.02%. Comparing base (0d8f7d4) to head (7843593).
Report is 5 commits behind head on main.

Files Patch % Lines
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9062      +/-   ##
============================================
+ Coverage     15.28%   16.02%   +0.73%     
- Complexity    11523    11537      +14     
============================================
  Files          5425     5062     -363     
  Lines        474008   444573   -29435     
  Branches      61750    54378    -7372     
============================================
- Hits          72445    71234    -1211     
+ Misses       393518   365414   -28104     
+ Partials       8045     7925     -120     
Flag Coverage Δ
uitests ?
unittests 16.02% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9588

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-10211)

@blueorangutan
Copy link

[SF] Trillian test result (tid-10242)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48430 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9062-t10242-kvm-centos7.zip
Smoke tests completed. 129 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 426.01 test_events_resource.py
test_05_vmschedule_test_e2e Failure 361.87 test_vm_schedule.py

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.

None yet

6 participants