Skip to content

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Jul 29, 2025

Description

Fixes #9505

Trim the generated hostname for Windows VM to 15 characters.
Doc PR: apache/cloudstack-documentation#575

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):

How Has This Been Tested?

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

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 78.78788% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.54%. Comparing base (d60f455) to head (d24ffc3).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
...ava/com/cloud/network/as/AutoScaleManagerImpl.java 78.78% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11327      +/-   ##
============================================
+ Coverage     17.50%   17.54%   +0.03%     
- Complexity    15427    15476      +49     
============================================
  Files          5894     5897       +3     
  Lines        526847   527426     +579     
  Branches      64335    64416      +81     
============================================
+ Hits          92234    92538     +304     
- Misses       424236   424489     +253     
- Partials      10377    10399      +22     
Flag Coverage Δ
uitests 3.60% <ø> (-0.01%) ⬇️
unittests 18.60% <78.78%> (+0.04%) ⬆️

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.

shwstppr added 2 commits July 30, 2025 11:11
Signed-off-by: Abhishek Kumar <[email protected]>
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 14463

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@weizhouapache
Copy link
Member

@shwstppr
is this ready for review ?

@shwstppr
Copy link
Contributor Author

@weizhouapache yes, though I wanted to confirm if it is a good idea to use the last 15 characters of the long generated name. Not using the first 15 as they can turn out to be the same.

@shwstppr shwstppr marked this pull request as ready for review August 25, 2025 11:02
@weizhouapache
Copy link
Member

@weizhouapache yes, though I wanted to confirm if it is a good idea to use the last 15 characters of the long generated name. Not using the first 15 as they can turn out to be the same.

@shwstppr
looks ok to me. I could not find a better solution to be honest.

is it possible the first letter is unaccepted (for example -) after the truncation ?

Signed-off-by: Abhishek Kumar <[email protected]>
if (Character.isLetterOrDigit(hostName.charAt(0))) {
return new Pair<>(hostName, name);
}
String temp = name.substring(0, Math.max(0, name.length() - 15)).replaceAll("[^a-zA-Z0-9]", "");
Copy link
Contributor

Choose a reason for hiding this comment

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

edge case: all of the last 15 chars are special chars or whitespace. I think we better do a replace first and then take the last 15.

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 I don't think this case can happen.
The only user-defined part in the VM name is the name of the autoscale group, and we've checks for that to only contain letters, numbers and hyphen. checkAutoScaleVmGroupName` does that

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 14730

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.

@apache apache deleted a comment from blueorangutan Sep 30, 2025
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 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15239

@shwstppr
Copy link
Contributor Author

@abh1sar please try one again with new packages. Added a change. I didn't realize we store guest OSes with null name.

@weizhouapache
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Collaborator

@abh1sar abh1sar 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 Windows and Linux VM. The Windows VM name is getting truncated correctly.

Image Image

@abh1sar
Copy link
Collaborator

abh1sar commented Oct 1, 2025

@shwstppr please see if we need to add this to documentation?

@shwstppr
Copy link
Contributor Author

shwstppr commented Oct 1, 2025

Thanks @abh1sar. (I've also added minor refactoring to not consider OS as Windows if both name and display_name turn out to be NULL)
Will check and update regarding documentation

shwstppr added a commit to shapeblue/cloudstack-documentation that referenced this pull request Oct 1, 2025
@shwstppr
Copy link
Contributor Author

shwstppr commented Oct 1, 2025

Added doc PR: apache/cloudstack-documentation#575

@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15248

@blueorangutan
Copy link

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

Test Result Time (s) Test File

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.

left some comments.

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

shwstppr commented Oct 8, 2025

@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15341

@weizhouapache
Copy link
Member

Tested on Windows and Linux VM. The Windows VM name is getting truncated correctly.

Image

to be frank, I think the name is a bit confusing

can we use a formatted shortname like asgroup-xxxxxx or asg-xx-xxxxxx instead ?

@DaanHoogland
Copy link
Contributor

@weizhouapache @shwstppr is this not ready yet?

@shwstppr
Copy link
Contributor Author

shwstppr commented Oct 8, 2025

@DaanHoogland based on the latest comments I think we would need changes in naming implementation. I would close this for now for a different solution

@shwstppr shwstppr closed this Oct 8, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Autoscale VM Name Issue with Windows OS

7 participants