-
Bug
-
Resolution: Done-Errata
-
None
-
0.42
-
False
-
-
False
-
CLOSED
-
---
-
---
-
-
-
No
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:
Always
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.
~~~
spec:
template:
spec:
accessCredentials:
- sshPublicKey:
propagationMethod:
configDrive: {}
source:
secret:
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 "4.3.1.11. Scripts tab" of the following document makes it sound like adding the key after the VMs creation is possible.
https://access.redhat.com/documentation/en-us/openshift_container_platform/4.12/html-single/virtualization/index#ui-virtualmachine-details-scripts_virt-web-console-overview
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.