Skip to content

server: generate password for VM created in stopped state #10720

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

Draft
wants to merge 2 commits into
base: 4.19
Choose a base branch
from

Conversation

shwstppr
Copy link
Contributor

Description

Fixes #10294

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
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

stopped-vm-pass.mp4

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@shwstppr shwstppr linked an issue Apr 15, 2025 that may be closed by this pull request
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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

codecov bot commented Apr 15, 2025

Codecov Report

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

Project coverage is 15.16%. Comparing base (f13cf59) to head (8b5904e).
Report is 3 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10720      +/-   ##
============================================
- Coverage     15.17%   15.16%   -0.01%     
- Complexity    11332    11333       +1     
============================================
  Files          5415     5415              
  Lines        474893   474918      +25     
  Branches      57920    57927       +7     
============================================
- Hits          72046    72042       -4     
- Misses       394792   394821      +29     
  Partials       8055     8055              
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.89% <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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@borisstoyanov borisstoyanov self-assigned this Apr 15, 2025
@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

Comment on lines 3813 to 3819
VMTemplateVO template = _templateDao.findById(userVm.getTemplateId());
if (template != null && template.isEnablePassword()) {
String password = _mgr.generateRandomPassword();
_vmDao.loadDetails(userVm);
userVm.setPassword(password);
encryptAndStorePassword(userVm, password);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this probably happens somewhere else as well. make a method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DaanHoogland generate and store method are used differently in different place. A refactoring to consolidate can be done in a separate PR

@blueorangutan
Copy link

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

Test Result Time (s) Test File

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

@shwstppr
I did a quick testing. It looks like the password is reset during vm start.

  • create a vm without Start

image

  • start the vm, check the cloudstack VR, it has a different password

image

  • open vm console

the password in step 1 does not work, the password in the VR works

image

@shwstppr
Copy link
Contributor Author

Thanks @weizhouapache for testing. Maybe the start VM code is not considering the stored password. Will check and update

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

Successfully merging this pull request may close these issues.

Password not showing when creating a VM in a powered off state.
5 participants