You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (StringUtils.isNotBlank(bootMode) && !bootMode.equalsIgnoreCase("bios")
3224
-
&& "secure".equalsIgnoreCase(bootType)
3225
-
&& Boolean.parseBoolean(virtualTPMEnabled)) {
3226
-
logger.debug("Adding Virtual TPM device");
3222
+
if (Boolean.parseBoolean(virtualTPMEnabled)) {
3223
+
if (StringUtils.isBlank(bootMode) || !bootMode.equalsIgnoreCase("uefi")) {
3224
+
thrownewException("VM instance with Virtual TPM must use UEFI boot mode");
3225
+
}
3227
3226
for (VirtualDevicedevice : vmMo.getAllDeviceList()) {
3228
3227
if (deviceinstanceofVirtualTPM) {
3228
+
logger.debug("Virtual TPM device has already been added, returning");
3229
3229
return;
3230
3230
}
3231
3231
}
3232
+
logger.debug("Adding Virtual TPM device");
3232
3233
addVirtualTPMDevice(vmConfigSpec);
3234
+
} elseif (virtualTPMEnabled == null) {
3235
+
logger.debug("Virtual TPM device is neither enabled nor disabled, skipping");
3233
3236
} else {
3234
-
logger.debug(String.format("Virtual TPM device is not enabled. It is only enabled when boot type is SECURE (actually %s) and vTPM is enabled (actually %s)", bootType, virtualTPMEnabled));
3237
+
logger.debug(String.format("Virtual TPM device is disabled. It is enabled when boot mode is UEFI (actually %s) and vTPM is enabled (actually %s)", bootMode, virtualTPMEnabled));
3235
3238
for (VirtualDevicedevice : vmMo.getAllDeviceList()) {
3236
3239
if (deviceinstanceofVirtualTPM) {
3240
+
logger.debug("Removing Virtual TPM device as it is disabled");
0 commit comments