Skip to content

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

Closed
shwstppr wants to merge 7 commits into
apache:4.19from
shapeblue:fix-stoppedvm-password
Closed

shwstppr wants to merge 7 commits into
apache:4.19from
shapeblue:fix-stoppedvm-password

Conversation

@shwstppr

Copy link
Copy Markdown
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?

Fixes apache#10294

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr linked an issue Apr 15, 2025 that may be closed by this pull request
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Apr 15, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.63291% with 39 lines in your changes missing coverage. Please review.

Project coverage is 15.17%. Comparing base (f13cf59) to head (e932a1f).
Report is 39 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 60.60% 25 Missing and 1 partial ⚠️
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% 11 Missing ⚠️
...oud/network/element/ConfigDriveNetworkElement.java 0.00% 1 Missing ⚠️
...om/cloud/network/element/VirtualRouterElement.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               4.19   #10720    +/-   ##
==========================================
  Coverage     15.17%   15.17%            
- Complexity    11332    11356    +24     
==========================================
  Files          5415     5415            
  Lines        474893   475790   +897     
  Branches      57920    58118   +198     
==========================================
+ Hits          72046    72203   +157     
- Misses       394792   395519   +727     
- Partials       8055     8068    +13     
Flag Coverage Δ
uitests 4.28% <ø> (+<0.01%) ⬆️
unittests 15.90% <50.63%> (+<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
Copy Markdown

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

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

Comment thread server/src/main/java/com/cloud/vm/UserVmManagerImpl.java Outdated
@blueorangutan

Copy link
Copy Markdown

[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

Comment thread server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Comment thread server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Comment thread server/src/main/java/com/cloud/vm/UserVmManagerImpl.java Outdated
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
shwstppr force-pushed the fix-stoppedvm-password branch from acaf18b to b0036dd Compare May 11, 2025 08:38
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@apache apache deleted a comment from blueorangutan May 11, 2025
@apache apache deleted a comment from blueorangutan May 11, 2025
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13257)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 46814 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10720-t13257-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 <abhishek.mrt22@gmail.com>
@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13277)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 48265 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10720-t13277-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

@shwstppr
shwstppr marked this pull request as ready for review May 13, 2025 09:32
@shwstppr shwstppr closed this May 13, 2025
@shwstppr shwstppr reopened this May 13, 2025
@weizhouapache

Copy link
Copy Markdown
Member

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

thanks @shwstppr for the PR update

to be frank, I thought the fix could be simple like

  • generate a vm password when create the vm
  • when start the vm, generate password only if password is not found

was there any other issues during the fix ?

@shwstppr

Copy link
Copy Markdown
Contributor Author

@weizhouapache I didn't try that part alone.

Password is stored in 2 ways currently:

  • In encrypted form using SSH key if it is present
  • Using normal DB encryption when VR is present but not running (this is cleared VM is next updated)
    For the fix I tried to use the existing flow with an extra check for Implemented network as during create VM it could be the case.
    Happy to close this if you want to explore a simpler solution

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.

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

5 participants