Skip to content

Commit bb56411

Browse files
committed
add log for windows 11 or other such guests OSs that require vtpm
1 parent cc8ea1e commit bb56411

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5847,6 +5847,16 @@ public void configureVTPM(Connection conn, VM vm, VirtualMachineTO vmSpec) throw
58475847
}
58485848

58495849
String vtpmEnabled = vmSpec.getDetails().getOrDefault(VmDetailConstants.VIRTUAL_TPM_ENABLED, null);
5850+
5851+
final Map<String, String> platform = vm.getPlatform(conn);
5852+
if (platform != null) {
5853+
final String guestRequiresVtpm = platform.get("vtpm");
5854+
if (guestRequiresVtpm != null && Boolean.parseBoolean(guestRequiresVtpm) && !Boolean.parseBoolean(vtpmEnabled)) {
5855+
logger.warn("Guest OS requires vTPM by default, even if VM details doesn't have the setting: {}", vmSpec.getName());
5856+
return;
5857+
}
5858+
}
5859+
58505860
if (!Boolean.parseBoolean(vtpmEnabled)) {
58515861
return;
58525862
}
@@ -5858,11 +5868,10 @@ public void configureVTPM(Connection conn, VM vm, VirtualMachineTO vmSpec) throw
58585868
logger.warn("vTPM requires UEFI boot mode. Skipping vTPM configuration for VM: {}", vmSpec.getName());
58595869
return;
58605870
}
5861-
5862-
if (!ApiConstants.BootMode.SECURE.name().equals(bootMode)) {
5863-
logger.warn("vTPM requires UEFI Secure Boot to be enabled. Skipping vTPM configuration for VM: {}", vmSpec.getName());
5864-
return;
5865-
}
5871+
// if (!ApiConstants.BootMode.SECURE.name().equals(bootMode)) {
5872+
// logger.warn("vTPM requires UEFI Secure Boot to be enabled. Skipping vTPM configuration for VM: {}", vmSpec.getName());
5873+
// return;
5874+
// }
58665875

58675876
try {
58685877
Set<VTPM> existingVtpms = vm.getVTPMs(conn);

0 commit comments

Comments
 (0)