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

Improve guest OS interaction in context packages #95

Open
dgarcia18 opened this issue May 9, 2024 · 1 comment
Open

Improve guest OS interaction in context packages #95

dgarcia18 opened this issue May 9, 2024 · 1 comment
Labels
category: context linux Linux OS contextualization packages type: feature A new feature planned for implementation

Comments

@dgarcia18
Copy link
Contributor

Issue to keep track of the investigation on qemu-ga usage and its integration possibilities within the linux context packages.

VM crashing detection

The current monitoring system can not detect a VM crashing. This was tested with a kernel-panicked VM. With qemu-ga installed in the VM, a crash can be detected by the hypervisor. We can check if the VM has crashed with:
virsh qemu-agent-command one- '{"execute":"guest-ping"}'

The VM is not crashed if the exit code of the command is 0, meaning that the VM is replying to the qemu "ping".

@dgarcia18 dgarcia18 added type: feature A new feature planned for implementation category: context linux Linux OS contextualization packages labels May 9, 2024
@tinova tinova added this to the Release 6.10.0 milestone May 9, 2024
@onenhansen
Copy link

onenhansen commented May 9, 2024

We should try to also include:

Examples:

# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec", "arguments": { "path": "wmic", "arg": ["OS", "GET", "TotalVisibleMemorySize"], "capture-output": true}}'
{"return":{"pid":1340}}

# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec", "arguments": { "path": "wmic", "arg": ["OS", "GET", "FreePhysicalMemory"], "capture-output": true}}'
{"return":{"pid":8372}}

# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec-status", "arguments": { "pid": 1340 }}' | jq -r '.return["out-data"]' | base64 -d
TotalVisibleMemorySize  
16757176                

# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec-status", "arguments": { "pid": 8372 }}' | jq -r '.return["out-data"]' | base64 -d
FreePhysicalMemory  
14303288   
# virsh qemu-monitor-command --hmp one-400 --cmd balloon 4096


# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec", "arguments": { "path": "wmic", "arg": ["OS", "GET", "FreePhysicalMemory"], "capture-output": true}}'
{"return":{"pid":8964}}

# virsh qemu-agent-command --domain one-400 --cmd '{"execute": "guest-exec-status", "arguments": { "pid": 8964 }}' | jq -r '.return["out-data"]' | base64 -d
FreePhysicalMemory  
1712584    

If possible, these values should also be extended to the Prometheus probe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: context linux Linux OS contextualization packages type: feature A new feature planned for implementation
Projects
None yet
Development

No branches or pull requests

4 participants