Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup virt-launcher socket directories #421

Closed
davidvossel opened this issue Sep 6, 2017 · 6 comments · Fixed by #663
Closed

cleanup virt-launcher socket directories #421

davidvossel opened this issue Sep 6, 2017 · 6 comments · Fixed by #663

Comments

@davidvossel
Copy link
Member

#337 The directories created for the virt-launcher pods need to be cleaned up after stopping each vm.

@davidvossel
Copy link
Member Author

@rmohr I have no idea if this is really a good idea, but we could use a time lease

virt-launcher would heartbeat the folder every 30 seconds by either renaming a file or touching/removing a file. That changes the directory's last modify time. If the directory hasn't been updated in 'x' amount of time, it could be garbage collected because we can assume the virt-launcher container is gone.

@michalskrivanek
Copy link

IIUC these are in /var/run/kubevirt/default/[VM name]/ ?
If so then this,mechanism not good enough in case of VM restart on the same host
Is there no other way how to make sure something is called on virt-launcher exit/crash? If not then it needs to be done on next launch (only there, or in addition to the periodic cleanup)

@fabiand
Copy link
Member

fabiand commented Jan 22, 2018

@davidvossel please see if this can be closed in the light of #663

@davidvossel
Copy link
Member Author

@fabiand some shared directories are going away with #663 but not all of them. We're depending on a shared directory primarily for the unix sock connections between virt-launcher and virt-handler.

The VM pod that contains virt-launcher doesn't have an IP address because the IP is getting owned by the VM within the Pod. If we figure out a way to both let the Pod and VM in the Pod have separate IP Addresses, then we'll be able to drop all shared directories.

@rmohr
Copy link
Member

rmohr commented Jan 25, 2018

If we figure out a way to both let the Pod and VM in the Pod have separate IP Addresses, then we'll be able to drop all shared directories.

We might get away with simply execing a small socket-proxy-subprocess via nsenter in the right mount namespace which talks to the socket. Then we can communicate via stdin/stout between the parent and the child process.

@davidvossel
Copy link
Member Author

@rmohr how would virt-handler discover the VM pod's namespaces to do nsenter?

@rmohr rmohr closed this as completed in #663 Feb 1, 2018
kubevirt-bot pushed a commit to kubevirt-bot/kubevirt that referenced this issue Nov 6, 2020
mzzgaopeng pushed a commit to mzzgaopeng/kubevirt that referenced this issue Mar 8, 2021
mzzgaopeng pushed a commit to mzzgaopeng/kubevirt that referenced this issue Mar 8, 2021
Portmap doesn't fail if chain doesn't exist
kubevirt-bot pushed a commit to kubevirt-bot/kubevirt that referenced this issue Dec 7, 2021
Signed-off-by: Jed Lejosne <jed@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants