Skip to content

Conversation

@Pearl1594
Copy link
Contributor

@Pearl1594 Pearl1594 commented Dec 15, 2025

Description

This PR adds support for vTPM for XenServer 8.4/ XCP-ng 8.3

image

Where,
VM: i-2-9-VM : Windows 11 - which automatically comes up with vTPM
VM: i-2-19-VM: Ubuntu 24.04 - template was set with virtual.tpm.enabled = true setting. And vTPM was successfully created for the guest VM.

Note:

Tried using VTPM.create api in the java code like:

final VTPM.Record vTPMRecord = new VTPM.Record();
vTPMRecord.VM = vm;
vTPMRecord.backend = vm;
VTPM.create(conn, vTPMRecord);

but failed with:

2025-12-15 18:57:37,254 WARN  [c.c.h.x.r.w.x.CitrixStartCommandWrapper] (DirectAgent-26:[ctx-8c875387]) (logid:aed6cd60) Failed to configure vTPM for VM i-2-19-VM, continuing without vTPM com.cloud.utils.exception.CloudRuntimeException: Failed to configure vTPM for VM: i-2-19-VM
        at com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.configureVTPM(CitrixResourceBase.java:5881)
        at com.cloud.hypervisor.xenserver.resource.wrapper.xenbase.CitrixStartCommandWrapper.execute(CitrixStartCommandWrapper.java:102)
        at com.cloud.hypervisor.xenserver.resource.wrapper.xenbase.CitrixStartCommandWrapper.execute(CitrixStartCommandWrapper.java:57)
        at com.cloud.hypervisor.xenserver.resource.wrapper.xenbase.CitrixRequestWrapper.execute(CitrixRequestWrapper.java:122)
        at com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.executeRequest(CitrixResourceBase.java:1780)
        at com.cloud.agent.manager.DirectAgentAttache$Task.runInContext(DirectAgentAttache.java:306)
        at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
        at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
        at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: You tried to call a method with the incorrect number of parameters. The fully-qualified method name that you used, and the number of received and expected parameters are returned.

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

Screenshots (if appropriate):

How Has This Been Tested?

In Progress

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

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 0% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.74%. Comparing base (cfe9602) to head (bb56411).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...ervisor/xenserver/resource/CitrixResourceBase.java 0.00% 44 Missing ⚠️
...rce/wrapper/xenbase/CitrixStartCommandWrapper.java 0.00% 6 Missing ⚠️
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12263      +/-   ##
============================================
+ Coverage     17.45%   17.74%   +0.28%     
- Complexity    15513    15892     +379     
============================================
  Files          5913     5914       +1     
  Lines        529385   535782    +6397     
  Branches      64679    67448    +2769     
============================================
+ Hits          92426    95061    +2635     
- Misses       426541   430084    +3543     
- Partials      10418    10637     +219     
Flag Coverage Δ
uitests 3.56% <ø> (-0.03%) ⬇️
unittests 18.81% <0.00%> (+0.30%) ⬆️

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.

@Pearl1594 Pearl1594 force-pushed the support-vtpm-xen-xcp branch from 876e735 to cc8ea1e Compare December 15, 2025 20:43
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

@weizhouapache weizhouapache self-requested a review December 19, 2025 09:03
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.

1 participant