Skip to content

Conversation

@adityagarg0911
Copy link
Collaborator

  • Add Testsuite for Dynamic Memory tests on a Linux VM over HyperV
  • Add option to enable Dynamic Memory while provisioning VM over hyperV
  • Add Hugepages memory stress in stres-ng tool
  • Add TestLimit tool to put Memory pressure on windows host

@adityagarg0911 adityagarg0911 marked this pull request as ready for review January 6, 2026 11:35
@adityagarg0911 adityagarg0911 self-assigned this Jan 7, 2026
@adityagesh adityagesh requested a review from anirudhrb January 7, 2026 08:57
@adityagarg0911 adityagarg0911 removed their assignment Jan 7, 2026

def _get_host_pressure_mb(self, ctx: DynamicMemoryTestContext) -> int:
host_total_memory_mb = ctx.hyperv.get_host_total_memory_mb()
return math.ceil(host_total_memory_mb / 45)
Copy link
Collaborator

Choose a reason for hiding this comment

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

add comments for the value 45

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok

)

def _read_kernel_config(self, node: Node, kernel_version: str, config: str) -> bool:
config_path = f"/boot/config-{kernel_version}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

try to use tool kernelconfig

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay

).is_less_than_or_equal_to(ctx.host_guest_tolerance_mb)

def _read_meminfo_value(self, node: Node, key: str) -> int:
content = node.execute("cat /proc/meminfo", sudo=False).stdout
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we use Free tool?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function has been called 4 times to get value of "AnonHugePages", and 1 time get value of "MemTotal".
I think I can get total memory from Free tool but for AnonHugePages this function has to stay.

Should I use Free tool to get total memory or keep it as is?

def _ensure_debugfs_mounted(self, node: Node) -> None:
if not self._check_debugfs_mounted(node):
node.execute(
"mount -t debugfs debugfs /sys/kernel/debug",
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we leverage the mount tool?

Copy link
Collaborator Author

@adityagarg0911 adityagarg0911 Jan 8, 2026

Choose a reason for hiding this comment

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

Yes, I think we can
Will do this

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a comprehensive Dynamic Memory test suite for Linux VMs running on Hyper-V, along with the necessary infrastructure changes to support dynamic memory provisioning and testing. The changes add the ability to configure and validate Hyper-V's dynamic memory feature, which allows VMs to dynamically adjust their memory allocation based on demand.

Key changes:

  • Adds a new test suite with 7 test cases validating dynamic memory hot add, balloon up/down, and memory limit behaviors
  • Implements dynamic memory configuration support in the Hyper-V orchestrator for VM provisioning
  • Adds TestLimit tool for applying memory pressure on Windows hosts

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
lisa/microsoft/testsuites/hyperv/dynamic_memory.py New test suite with 7 test cases validating dynamic memory hot add, ballooning, and limit enforcement under various stress conditions
lisa/tools/hyperv.py Adds dynamic memory configuration dataclass, VM creation parameters for dynamic memory, and helper methods to retrieve memory information from host and guest
lisa/tools/testlimit.py New tool that downloads and runs Sysinternals TestLimit to apply memory pressure on Windows hosts
lisa/tools/stress_ng.py Adds async hugepage memory stressor method for testing huge page allocation scenarios
lisa/sut_orchestrator/hyperv/schema.py Adds schema for dynamic memory configuration parameters (min, max, startup, buffer, priority)
lisa/sut_orchestrator/hyperv/platform_.py Integrates dynamic memory schema into VM provisioning flow, passing parameters to HyperV.create_vm
lisa/tools/unzip.py Updates imports from relative to absolute imports for better code organization
lisa/tools/init.py Exports TestLimit tool for external use

Test Suggestions (Required per Guideline 1000000):

Key Test Cases:
verify_dynamic_memory_hot_add|verify_dynamic_memory_hot_add_hugepages|verify_dynamic_memory_upper_limit|verify_dynamic_memory_balloon_up|verify_dynamic_memory_balloon_down

Impacted LISA Features:
Resize, StartStop, SerialConsole

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
  • redhat rhel 9_5 latest
  • debian debian-12 12-gen2 latest

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.

4 participants