diff --git a/pkg/controller/plan/adapter/vsphere/builder.go b/pkg/controller/plan/adapter/vsphere/builder.go index 6ab8461d2..e2bb8c66c 100644 --- a/pkg/controller/plan/adapter/vsphere/builder.go +++ b/pkg/controller/plan/adapter/vsphere/builder.go @@ -462,6 +462,7 @@ func (r *Builder) VirtualMachine(vmRef ref.Ref, object *cnv.VirtualMachineSpec, r.mapMemory(vm, object) r.mapClock(host, object) r.mapInput(object) + r.mapTpm(vm, object) err = r.mapNetworks(vm, object) if err != nil { return @@ -639,6 +640,13 @@ func (r *Builder) mapDisks(vm *model.VM, persistentVolumeClaims []core.Persisten object.Template.Spec.Domain.Devices.Disks = kDisks } +func (r *Builder) mapTpm(vm *model.VM, object *cnv.VirtualMachineSpec) { + if vm.TpmEnabled { + persistData := true + object.Template.Spec.Domain.Devices.TPM = &cnv.TPMDevice{Persistent: &persistData} + } +} + // Build tasks. func (r *Builder) Tasks(vmRef ref.Ref) (list []*plan.Task, err error) { vm := &model.VM{}