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

[2182172] Cannot add ssh key to existing VM in the GUI


      Description of problem:
      Cannot add an SSH key to an existing VM.

      Version-Release number of selected component (if applicable):
      Virtualization 4.12.1

      How reproducible:

      Steps to Reproduce:
      1. Create a VM using the GUI (create RHEL or Fedora)
      2. Do not specify an ssh public key if customizing the VM.
      3. After the VM is created, go to the Scripts tab under the VM details.
      4. Edit the Authorized SSH Key
      5. Edit the secret and upload an ssh public key or attach and existing secret.
      6. save the key
      7. restart or stop/start the VM using the GUI (do not issue a shutdown or restart command in the OS)

      Actual results:
      The VMs yaml gets updated with the secret information.

      • sshPublicKey:
        configDrive: {}
        secretName: rhel9-test-ssh-key-anbr6q

      But the authorized_key file does not get updated.

      The virt-launcher pod does get recreated during the restart process.

      Expected results:
      The users .ssh/authorized_key file gets updated.

      Additional info:

      Adding the ssh public key using the Scripts tab works during the initial creation of the VM.

      Section " Scripts tab" of the following document makes it sound like adding the key after the VMs creation is possible.

      Also, adding a key in the GUI mentions a restart of the VM is required for the key to be added. It shows the following messsage after making changes:
      "Warning alert:Restart required to apply changes. The changes you have made require this VirtualMachine to be restarted."

      After saving the changes, a banner at the top of the VMs page shows the following:
      "Warning alert:Pending Changes
      The following areas have pending changes that will be applied when this VirtualMachine is restarted.

      • Scripts > Authorized SSH Key"

      All of this makes it look possible to add the keys after the VMs creation.

            upalatuc@redhat.com Ugo Palatucci
            joherr John Herr
            0 Vote for this issue
            2 Start watching this issue