Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-43662

[Bug] Persistent vTPM doesn't work when VM names have dots in them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • CNV v4.14.7
    • CNV v4.14.6
    • CNV Virtualization
    • None
    • Urgent
    • No

      Description of problem:

      When setting up persistent vTPM for Openshift-Virt, the setup will fail if the guest hostname has dots in it:
      
      Using the instructions at:
      
      [https://www.redhat.com/en/blog/running-windows-11-and-2022-server-virtual-machines-red-hat-openshift-persistent-vtpm|https://www.redhat.com/en/blog/running-windows-11-and-2022-server-virtual-machines-red-hat-openshift-persistent-vtpm]
      
      The configuration works properly, but if the guest VM name has dots in it, the persistent-tpm volume creation fails:
      
      {code:java}
      [20240701 07:18:41]❯ oc get vm/fedora.test.vm -o yaml
      apiVersion: kubevirt.io/v1
      kind: VirtualMachine
      ...
        name: fedora.test.vm
      ...
                tpm:
                  persistent: true
      ...
        - lastProbeTime: null
          lastTransitionTime: "2024-06-28T22:45:11Z"
          message: 'failed to create virtual machine pod: Pod "virt-launcher-fedora.test.vm-n6l5j"
            is invalid: [spec.volumes[8].name: Invalid value: "fedora.test.vm-tpm": must
            not contain dots, spec.containers[0].volumeMounts[9].name: Not found: "fedora.test.vm-tpm",
            spec.containers[0].volumeMounts[10].name: Not found: "fedora.test.vm-tpm"]'
          reason: FailedCreate
          status: "False"
          type: Synchronized
      
      Version-Release number of selected component (if applicable):{code:none}
      OCP 4.14
      Openshift-Virt: 4.14.6
      

      How reproducible:

      Always
      
      

      Steps to Reproduce:

      1. Set up cluster for persistent vTPM
      2. Create VM with a name which has dots in it
      3. Enable persistent vTPM for VM
      

      Actual results:

      
      

      Expected results:

      
      

      Additional info:

      
      

              ffossemo@redhat.com Federico Fossemo
              rhn-support-fhirtz Frank Hirtz
              Kedar Bidarkar Kedar Bidarkar
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: