Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

server: trim autoscale Windows VM hostname #11327

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

Merged
DaanHoogland merged 11 commits into apache:main from shapeblue:fix-autoscalewinvm
Dec 15, 2025

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Jul 29, 2025
edited
Loading

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
edited
Loading

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (ac8c200) to head (d2544d4).
⚠️ Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
...ava/com/cloud/network/as/AutoScaleManagerImpl.java 90.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## main #11327 +/- ##
=========================================
 Coverage 17.56% 17.56% 
+ Complexity 15544 15543 -1 
=========================================
 Files 5909 5909 
 Lines 529059 529074 +15 
 Branches 64617 64620 +3 
=========================================
+ Hits 92941 92944 +3 
- Misses 425664 425675 +11 
- Partials 10454 10455 +1 
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.63% <90.47%> (+<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.

Copy link
Contributor Author

@blueorangutan package

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

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.

Copy link
Member

@shwstppr
is this ready for review ?

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
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 ?

Copy link
Contributor Author

@blueorangutan package

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

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

Copy link
Contributor Author

@blueorangutan package

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

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

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

Copy link
Contributor

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Collaborator

abh1sar commented Sep 30, 2025

@shwstppr I am getting this NPE with a Windows10 qcow2 template. Not sure if I did something wrong.
I have a mixed kvm, vmware env.

Screenshot 2025年09月30日 at 4 11 49 PM Screenshot 2025年09月30日 at 4 10 58 PM

@apache apache deleted a comment from blueorangutan Sep 30, 2025
@apache apache deleted a comment from blueorangutan Sep 30, 2025
Copy link
Contributor Author

@blueorangutan package

shwstppr and others added 6 commits November 6, 2025 20:49
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>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Copy link
Member

discussed with @shwstppr , I made some changes on this PR on the name convention of autoscale Windows VM

now the vm name and display name look like
image

the last 6 letters are the same in the two names. they are generated by RandomStringUtils.random

Copy link
Member

@blueorangutan package

Copy link

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

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

Copy link
Collaborator

RosiKyu commented Dec 10, 2025

@blueorangutan package

Copy link

@rosi-shapeblue 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

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

DaanHoogland reacted with confused emoji

Copy link

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

Copy link
Collaborator

RosiKyu commented Dec 12, 2025

@blueorangutan package

Copy link

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

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

Copy link

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

Copy link
Collaborator

RosiKyu commented Dec 12, 2025

@blueorangutan package

Copy link

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

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

Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

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

LGTM

Test Case Expected Actual Status
Windows hostname ≤ 15 chars as-WinVm-xxxxxx as-WinVm-cifpcf PASS
Windows displayname full autoScaleVm-...-1-xxxxxx autoScaleVm-windows-autoscale-test-1-cifpcf PASS
Linux name = displayname Same value Both autoScaleVm-linux-autoscale-test-1-pjudpx PASS
No regression for Linux Full hostname format Full hostname format PASS

Windows VMs

(localcloud) 🐱 > list virtualmachines listall=true keyword=as-WinVm filter=id,name,displayname,state
{
 "count": 3,
 "virtualmachine": [
 {
 "displayname": "autoScaleVm-windows-autoscale-test-1-cifpcf",
 "id": "b13dd0d8-b424-4d55-979a-797b7cf5040c",
 "name": "as-WinVm-cifpcf",
 "state": "Running"
 },
 {
 "displayname": "autoScaleVm-windows-autoscale-test-2-xgvxsl",
 "id": "0eca7403-7ca9-498f-9eda-7582bb179d6f",
 "name": "as-WinVm-xgvxsl",
 "state": "Running"
 },
 {
 "displayname": "autoScaleVm-windows-autoscale-test-3-cacjld",
 "id": "966ea9c0-a16b-4ff8-9bb6-323660814f95",
 "name": "as-WinVm-cacjld",
 "state": "Running"
 }
 ]
}

Linux VMs

(localcloud) 🐱 > list virtualmachines listall=true keyword=autoScaleVm-linux filter=id,name,displayname,state
{
 "count": 1,
 "virtualmachine": [
 {
 "displayname": "autoScaleVm-linux-autoscale-test-1-pjudpx",
 "id": "24a59eb9-d874-4717-aed0-ecda7ecca4b6",
 "name": "autoScaleVm-linux-autoscale-test-1-pjudpx",
 "state": "Running"
 }
 ]
}

DB Evidence

mysql> SELECT 
 -> v.id,
 -> v.instance_name,
 -> v.name AS hostname,
 -> v.display_name,
 -> v.state,
 -> g.display_name AS guest_os
 -> FROM vm_instance v
 -> LEFT JOIN guest_os g ON v.guest_os_id = g.id
 -> WHERE v.display_name LIKE 'autoScaleVm%'
 -> ORDER BY v.created DESC;
+----+---------------+-------------------------------------------+---------------------------------------------+---------+------------------------------+
| id | instance_name | hostname | display_name | state | guest_os |
+----+---------------+-------------------------------------------+---------------------------------------------+---------+------------------------------+
| 8 | i-2-8-VM | autoScaleVm-linux-autoscale-test-1-pjudpx | autoScaleVm-linux-autoscale-test-1-pjudpx | Running | CentOS 5.5 (64-bit) |
| 7 | i-2-7-VM | as-WinVm-cacjld | autoScaleVm-windows-autoscale-test-3-cacjld | Running | Windows Server 2019 (64-bit) |
| 6 | i-2-6-VM | as-WinVm-xgvxsl | autoScaleVm-windows-autoscale-test-2-xgvxsl | Running | Windows Server 2019 (64-bit) |
| 5 | i-2-5-VM | as-WinVm-cifpcf | autoScaleVm-windows-autoscale-test-1-cifpcf | Running | Windows Server 2019 (64-bit) |
+----+---------------+-------------------------------------------+---------------------------------------------+---------+------------------------------+
4 rows in set (0.00 sec)

UI Evidence

image image

@DaanHoogland DaanHoogland merged commit da1c7ce into apache:main Dec 15, 2025
28 checks passed
@DaanHoogland DaanHoogland deleted the fix-autoscalewinvm branch December 15, 2025 14:52
@DaanHoogland DaanHoogland added this to the 4.23.0 milestone Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DaanHoogland DaanHoogland DaanHoogland approved these changes

@vishesh92 vishesh92 vishesh92 approved these changes

@weizhouapache weizhouapache weizhouapache approved these changes

+2 more reviewers

@abh1sar abh1sar abh1sar approved these changes

@RosiKyu RosiKyu RosiKyu approved these changes

Reviewers whose approvals may not affect merge requirements

Projects

None yet

Milestone

4.23.0

Development

Successfully merging this pull request may close these issues.

Autoscale VM Name Issue with Windows OS

AltStyle によって変換されたページ (->オリジナル) /