Skip to content

Remove Hyper-V support from core code - #14554

Open
DaanHoogland wants to merge 5 commits into
mainfrom
removeHyperv
Open

DaanHoogland wants to merge 5 commits into
mainfrom
removeHyperv

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

Removes Hyper-V support from core code now that the Hyper-V plugin is no longer built (see #12500). This is the first PR of a stack on main:

  1. this PR: remove Hyper-V support from core code
  2. remove Ovm/Ovm3 leftovers from core code (based on this branch)
  3. code-style cleanups (based on 2)

The first four commits are #12500 ported to main, so this branch builds without the plugins. Once 4.22 is merged forward they become empty.

Behaviour / API changes

  • listTrafficTypes, addTrafficType and updateTrafficType responses no longer include hypervnetworklabel. The hypervnetworklabel request parameter is @Deprecated and ignored.
  • Removed the settings router.template.hyperv, hyperv.public.network.device, hyperv.private.network.device and hyperv.guest.network.device. schema-42300to2400.sql deletes them, along with ucs.sync.blade.interval.
  • The hypervisor.list default no longer contains Hyperv. Existing values set by admins are left untouched.
  • Hyper-V specific branches are removed from HA, live migration, the control NIC, the VR boot args, storage pool and zone-wide pool handling, system VM template registration and the rdpconsole CLI.

Deliberately kept

  • HypervisorType.Hyperv (now @Deprecated). HypervisorTypeConverter uses valueOf(), which throws on unknown names, and existing installations have Hyperv rows (for example the seeded guest_os_hypervisor mappings). Removing the constant would make loading those rows fail.
  • Historic upgrade paths (Upgrade41500to41510, schema-410to420.sql, schema-41520to41600.sql) are unchanged.
  • The console-proxy RDP path. It keys off the agent's VNC port -9, not off the hypervisor type, and the new Hyper-V extension (extensions/HyperV) may rely on it.

Possible follow-ups (not in this PR): UI Hyper-V options, hyperv_network_label column and NetworkService label parameters, appliance build scripts, marvin test data, setup/db/templates.sql.

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)

How Has This Been Tested?

Unit tests updated: ApiResponseHelperTest, SystemVmTemplateRegistrationTest, SecondaryStorageManagerTest, ManagementServerImplTest.

🤖 Generated with Claude Code

Daan Hoogland and others added 5 commits November 2, 2026 12:26
Hyper-V plugin is no longer built. HypervisorType.Hyperv is kept (deprecated) so existing DB records still convert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removing the ServerResource exclusion breaks the root RAT license check because remaining files lack required license headers, even when their Maven modules are disabled.

1 open issue
What changed in this PR

Removes legacy Hyper-V handling from CloudStack’s core, following the plugin build removal in #12500. It preserves the deprecated hypervisor type for existing database records and leaves the console-proxy RDP path intact.

Changes:

  • Removes Hyper-V-specific networking, storage, migration, HA, and system VM behavior.
  • Deprecates and ignores traffic-label inputs, removes the response field, and deletes obsolete configuration settings.
  • Updates plugin packaging, template downloads, API descriptions, and related tests.
File Description
services/​secondary-storage/​controller/​src/​test/​java/​org/​apache/​cloudstack/​secondarystorage/​SecondaryStorageManagerTest.java Updates management-NIC expectations.
services/​secondary-storage/​controller/​src/​main/​java/​org/​apache/​cloudstack/​secondarystorage/​SecondaryStorageManagerImpl.java Removes Hyper-V SSH NIC selection.
services/​console-proxy/​rdpconsole/​src/​main/​java/​common/​Client.java Removes Hyper-V CLI mode and options.
server/​src/​test/​java/​com/​cloud/​server/​ManagementServerImplTest.java Removes Hyper-V from migration test cases.
server/​src/​test/​java/​com/​cloud/​api/​ApiResponseHelperTest.java Updates traffic-label response assertions.
server/​src/​main/​java/​com/​cloud/​vm/​UserVmManagerImpl.java Removes Hyper-V migration support.
server/​src/​main/​java/​com/​cloud/​storage/​StorageManagerImpl.java Removes Hyper-V pool and template handling.
server/​src/​main/​java/​com/​cloud/​storage/​listener/​StoragePoolMonitor.java Removes Hyper-V host connection handling.
server/​src/​main/​java/​com/​cloud/​server/​ManagementServerImpl.java Excludes Hyper-V from live migration.
server/​src/​main/​java/​com/​cloud/​network/​vpc/​VpcManagerImpl.java Removes Hyper-V from supported VPC hypervisors.
server/​src/​main/​java/​com/​cloud/​network/​router/​VirtualNetworkApplianceManagerImpl.java Removes Hyper-V router settings and boot arguments.
server/​src/​main/​java/​com/​cloud/​network/​router/​VirtualNetworkApplianceManager.java Removes the Hyper-V router template setting.
server/​src/​main/​java/​com/​cloud/​network/​router/​NetworkHelperImpl.java Removes Hyper-V router template mapping.
server/​src/​main/​java/​com/​cloud/​network/​NetworkModelImpl.java Removes Hyper-V traffic-label lookups.
server/​src/​main/​java/​com/​cloud/​network/​guru/​ControlNetworkGuru.java Restricts special control-NIC handling to VMware.
server/​src/​main/​java/​com/​cloud/​ha/​HighAvailabilityManagerImpl.java Removes Hyper-V-specific HA exclusions.
server/​src/​main/​java/​com/​cloud/​consoleproxy/​ConsoleProxyManagerImpl.java Removes Hyper-V SSH NIC override.
server/​src/​main/​java/​com/​cloud/​configuration/​ConfigurationManagerImpl.java Updates the valid-hypervisor documentation comment.
server/​src/​main/​java/​com/​cloud/​configuration/​Config.java Removes obsolete settings and the Hyper-V default entry.
server/​src/​main/​java/​com/​cloud/​api/​ApiResponseHelper.java Stops populating the Hyper-V traffic label.
server/​src/​main/​java/​com/​cloud/​api/​ApiDBUtils.java Removes Hyper-V inference for VHD volumes.
pom.xml Removes Hyper-V license-check exclusions.
plugins/​pom.xml Disables Hyper-V and UCS Maven modules.
plugins/​network-elements/​internal-loadbalancer/​src/​main/​java/​org/​apache/​cloudstack/​network/​lb/​InternalLoadBalancerVMManagerImpl.java Removes Hyper-V load-balancer template selection.
packaging/​package.sh Removes Hyper-V from template-option help.
engine/​storage/​src/​main/​java/​org/​apache/​cloudstack/​storage/​endpoint/​DefaultEndPointSelector.java Removes Hyper-V migration endpoint special handling.
engine/​schema/​templateConfig.sh Removes the Hyper-V template download entry.
engine/​schema/​src/​test/​java/​com/​cloud/​upgrade/​SystemVmTemplateRegistrationTest.java Removes the Hyper-V guest OS assertion.
engine/​schema/​src/​main/​resources/​META-INF/​db/​schema-42300to2400.sql Deletes obsolete Hyper-V and UCS settings.
engine/​schema/​src/​main/​java/​com/​cloud/​upgrade/​SystemVmTemplateRegistration.java Removes Hyper-V system VM registration mappings.
engine/​schema/​src/​main/​java/​com/​cloud/​network/​dao/​PhysicalNetworkTrafficTypeDaoImpl.java Removes Hyper-V network-tag selection.
engine/​schema/​pom.xml Removes Hyper-V template download and checksum handling.
engine/​orchestration/​src/​main/​java/​org/​apache/​cloudstack/​engine/​orchestration/​VolumeOrchestrator.java Removes Hyper-V volume-format handling.
engine/​orchestration/​src/​main/​java/​com/​cloud/​vm/​VirtualMachineManagerImpl.java Removes Hyper-V sequencing and HA exceptions.
client/​pom.xml Removes Hyper-V and UCS plugin dependencies.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​response/​TrafficTypeResponse.java Removes the Hyper-V label response field.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​admin/​usage/​UpdateTrafficTypeCmd.java Deprecates and ignores Hyper-V label input.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​admin/​usage/​AddTrafficTypeCmd.java Deprecates and ignores Hyper-V label input.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​admin/​host/​ListHostsCmd.java Removes Hyper-V from parameter documentation.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​admin/​cluster/​AddClusterCmd.java Removes Hyper-V from parameter documentation.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​ApiConstants.java Removes UCS API constants.
api/​src/​main/​java/​com/​cloud/​hypervisor/​Hypervisor.java Deprecates Hyper-V while preserving database compatibility.
.github/​boring-cyborg.yml Removes automatic Hyper-V component labeling.

Review effort: Balanced

Comment thread pom.xml
<exclude>plugins/hypervisors/hyperv/conf/agent.properties</exclude>
<exclude>plugins/hypervisors/hyperv/conf/uefi.properties</exclude>
<exclude>plugins/hypervisors/hyperv/DotNet/ServerResource/**</exclude>
<exclude>scripts/installer/windows/acs_license.rtf</exclude>
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.43478% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.85%. Comparing base (d6390bd) to head (6b21b6b).

Files with missing lines Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 3 Missing ⚠️
...ava/com/cloud/network/guru/ControlNetworkGuru.java 0.00% 2 Missing ⚠️
...-proxy/rdpconsole/src/main/java/common/Client.java 0.00% 2 Missing ⚠️
...ack/api/command/admin/usage/AddTrafficTypeCmd.java 0.00% 1 Missing ⚠️
.../api/command/admin/usage/UpdateTrafficTypeCmd.java 0.00% 1 Missing ⚠️
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 50.00% 1 Missing ⚠️
...stack/engine/orchestration/VolumeOrchestrator.java 0.00% 1 Missing ⚠️
...tack/storage/endpoint/DefaultEndPointSelector.java 0.00% 1 Missing ⚠️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% 1 Missing ⚠️
...ork/router/VirtualNetworkApplianceManagerImpl.java 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14554      +/-   ##
============================================
+ Coverage     20.76%   20.85%   +0.08%     
- Complexity    21903    21906       +3     
============================================
  Files          6496     6470      -26     
  Lines        591612   589089    -2523     
  Branches      72585    72223     -362     
============================================
- Hits         122851   122845       -6     
+ Misses       455424   452908    -2516     
+ Partials      13337    13336       -1     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.17% <30.43%> (+0.10%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
21.2% Coverage on New Code (required ≥ 40%)
11.8% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 26.02%
Branch coverage 20.30%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

This branch has not been deployed

No deployments
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.

2 participants