Skip to content

Add VM cache scanning script#388

Open
dinhngtu wants to merge 2 commits intomasterfrom
dnt/scancache
Open

Add VM cache scanning script#388
dinhngtu wants to merge 2 commits intomasterfrom
dnt/scancache

Conversation

@dinhngtu
Copy link
Member

Stale cached VMs will fill up the SR and cause test failures when importing new images.

This script helps detect those. It's non-destructive; deleting the VMs is left to the user.

@dinhngtu dinhngtu requested a review from gduperrey January 23, 2026 13:42
@dinhngtu dinhngtu requested a review from a team as a code owner January 23, 2026 13:42
import contextlib
import re

import XenAPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not in our current dependency. Could it be added in pyproject.toml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added XenAPI to dev dependencies

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
@glehmann
Copy link
Member

I didn't realize that scan_cache.py was meant to be used on an xcp-ng host, not on the dev computer. The XenAPI dependency doesn't make sense in that case: I don't think we plan on cloning xcp-ng-tests on each host.

Apparently, it also requires copying vm_data.py on the host.

I think I would prefer a script that runs locally, on the dev host, and connects to the host.
Could you explain why you preferred a script to copy on the host?

@dinhngtu
Copy link
Member Author

I didn't realize that scan_cache.py was meant to be used on an xcp-ng host, not on the dev computer. The XenAPI dependency doesn't make sense in that case: I don't think we plan on cloning xcp-ng-tests on each host.

Apparently, it also requires copying vm_data.py on the host.

I think I would prefer a script that runs locally, on the dev host, and connects to the host. Could you explain why you preferred a script to copy on the host?

It's better to run it locally on the dev machine rather than on the hosts. I'll make it do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants