diff --git a/src/fireedge/src/modules/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/bootSchema.js b/src/fireedge/src/modules/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/bootSchema.js index f6bc38488c..57d7b78b39 100644 --- a/src/fireedge/src/modules/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/bootSchema.js +++ b/src/fireedge/src/modules/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/bootSchema.js @@ -19,6 +19,7 @@ import { CPU_ARCHITECTURES, FIRMWARE_TYPES, FIRMWARE_FORMAT_TYPES, + VTPM_TYPES, HYPERVISORS, INPUT_TYPES, SD_DISK_BUSES, @@ -153,7 +154,7 @@ export const FIRMWARE = { export const FIRMWARE_FORMAT = { name: 'OS.FIRMWARE_FORMAT', label: T.FirmwareFormat, - tooltip: T.FirmwareConcept, + tooltip: T.FirmwareFormatConcept, notOnHypervisors: [lxc], type: INPUT_TYPES.AUTOCOMPLETE, optionsOnly: true, @@ -163,7 +164,23 @@ export const FIRMWARE_FORMAT = { .default(() => undefined), dependOf: ['HYPERVISOR', '$general.HYPERVISOR'], values: arrayToOptions(FIRMWARE_FORMAT_TYPES), - grid: { md: 12 }, + grid: { md: 6 }, +} + +export const TPM_MODEL = { + name: 'TPM.MODEL', + label: T.TPM, + tooltip: T.TPMConcept, + notOnHypervisors: [lxc], + type: INPUT_TYPES.AUTOCOMPLETE, + optionsOnly: true, + validation: string() + .trim() + .notRequired() + .default(() => undefined), + dependOf: ['HYPERVISOR', '$general.HYPERVISOR'], + values: arrayToOptions(VTPM_TYPES), + grid: { md: 6 }, } /** @type {Field} Firmware secure field */ @@ -185,6 +202,7 @@ export const BOOT_FIELDS = [ FIRMWARE, FIRMWARE_SECURE, FIRMWARE_FORMAT, + TPM_MODEL, KERNEL_CMD, BOOTLOADER, UUID, diff --git a/src/fireedge/src/modules/constants/translates.js b/src/fireedge/src/modules/constants/translates.js index c78be294d6..20c3756be5 100644 --- a/src/fireedge/src/modules/constants/translates.js +++ b/src/fireedge/src/modules/constants/translates.js @@ -1375,8 +1375,13 @@ module.exports = { UniqueIdOfTheVmConcept: ` It's referenced as machine ID inside the VM. Could be used to force ID for licensing purposes`, + TPM: 'TPM', + TPMConcept: + 'This attribute can be used to add a vTPM to the KVM machine. When doing so, every VM instance will also spawn a companion TPM emulator process (swtpm) in charge of emulating a physical TPM device for its VM.', Firmware: 'Firmware', FirmwareFormat: 'Firmware format', + FirmwareFormatConcept: + 'This attribute can be used to define the format of the UEFI NVRAM image. The NVRAM file will be automatically converted to the specified format if the source file differs.', FirmwareConcept: 'This attribute allows to define the type of firmware used to boot the VM', FirmwareSecure: 'Firmware secure', diff --git a/src/fireedge/src/modules/constants/vmTemplate.js b/src/fireedge/src/modules/constants/vmTemplate.js index b6ea19027d..a7d8c04d2d 100644 --- a/src/fireedge/src/modules/constants/vmTemplate.js +++ b/src/fireedge/src/modules/constants/vmTemplate.js @@ -94,6 +94,8 @@ export const COMMON_RESOLUTIONS = { custom: 'custom', } +export const VTPM_TYPES = ['tpm-crb', 'tpm-tis'] + export const FIRMWARE_TYPES = ['BIOS', 'UEFI'] export const FIRMWARE_FORMAT_TYPES = ['qcow2', 'raw'] @@ -149,7 +151,7 @@ export const MEMORY_RESIZE_OPTIONS = { export const TAB_FORM_MAP = { Storage: ['DISK', 'TM_MAD_SYSTEM'], Network: ['NIC', 'NIC_ALIAS', 'PCI', 'NIC_DEFAULT'], - OsCpu: ['OS', 'CPU_MODEL', 'FEATURES', 'RAW'], + OsCpu: ['OS', 'CPU_MODEL', 'FEATURES', 'RAW', 'TPM'], PciDevices: ['PCI'], InputOutput: ['INPUT', 'GRAPHICS', 'VIDEO'], Context: ['CONTEXT', 'USER_INPUTS', 'INPUTS_ORDER'],