feat(vm): add VNC screenshot subresource#2641
Open
fl64 wants to merge 1 commit into
Open
Conversation
Add virtualmachines/screenshot subresource to the aggregated apiserver. It proxies a plain GET to the kubevirt vnc/screenshot endpoint and returns an image/png of the VM console. Supports the moveCursor query parameter. Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
virtualmachines/screenshotsubresource to the aggregated virtualization apiserver. It returns a PNG snapshot of the VM graphical console. Under the hood it proxies a plain GET to the KubeVirtvnc/screenshotendpoint (which already ships in our virt-api), so no node-side changes are required. ThemoveCursorquery parameter is supported to wake a blanked screen before the frame is captured.Why do we need it, and what problem does it solve?
There was no way to grab a still image of a VM screen through the platform API — users had to open an interactive VNC session just to see the current display state. A screenshot subresource lets tools and UIs fetch the current screen as an image (e.g. to show a VM preview or to diagnose a VM that is stuck at a boot/login screen) without a full VNC session.
What is the expected result?
On a running VM:
GET /apis/subresources.virtualization.deckhouse.io/v1alpha2/namespaces/<ns>/virtualmachines/<name>/screenshotreturns
Content-Type: image/pngwith the current screen. Adding?moveCursor=truenudges the pointer first so a blanked display wakes up. Access is granted by the existingaccess_remote_displayuse-capability.Checklist
Changelog entries