Open skobyda opened 2 years ago
@garrett mind giving your opinion here?
So, you're right: we need to make this friendlier, for sure.
Are the VMs always going to be system (and root), or will some be session (and user)? We can abstract the URL to have the correct protocol, the user@host, and system/session.
This means I think we probably want something like
If we can verify that things are set up properly on the host without having to submit, then we can also have a second set of setting up necessary configuration if it's not correct, otherwise skip it and migrate if it is set up. Kind of like a hybrid wizard concept, where there's only this modal when things are correct, otherwise, it's a two-step modal.
In an ideal world, the Destination URI should be an editable dropdown that is pre-populated with any of the other hosts that are configured in Cockpit (and have cockpit-machines installed).
Here is how virt-manager
handles it utilizing the connections I have set up in it:
Before migrating a VM between source and destination, an SSH key exchange between source and destination needs to be done in order to allow the transition of data between the 2 points. However, it's not really intuitive if you should set up SSH key exchange with other users (who is a sudoer) or root.
Example of a problem: 1) Have source and destination systems. 2) Both have cockpit installed. On both systems, you have user "sysadmin", who has administrative access, so you do SSH key exchange between both users. 3) Login to to cockpit as "sysadmin" with privileges. 4) When yoo attempt to migrate VM from source to destination host using URI
qemu+ssh://[destination_IP]/system
, you get:Cannot recv data: Host key verification failed: Connection reset by peer
The root of the problem: With URI
qemu+ssh://[destination_IP]/system
, libvirt tries to communicate withroot
, sincesystem
connection, which is specified in URI, is defaultly spawned by root. This is conflicting with a usual behavior ofssh
, where if you try to connect withssh [destinationIP]
without specifying user on the destination, ssh will automatically assume there is the user with the same name as the one spawningssh [destinationIP]
on the source.Some ideas what can we do about this problem:
qemu+ssh://[destination_IP]/system
, they need to have key set upexchange with the root.