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

[Hyper-v platform] Use data disk as LISA working directory on Hyper-v host #3626

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SRIKKANTH
Copy link
Collaborator

@SRIKKANTH SRIKKANTH commented Feb 3, 2025

The default lisa working path on Hyper-v hosts is under 'C:/' which is not ideal for large data.
This change initializes an attached disk, creates a partition, formats it, and mounts it to the lisa working directory.
This change expects an un-initialized (RAW) disk to be available on Hyper-V.

@SRIKKANTH SRIKKANTH changed the title [Hyper-v platform] Use data disk as LISA working directory [Hyper-v platform] Use data disk as LISA working directory on Hyper-v host Feb 3, 2025
@@ -33,6 +33,9 @@ def _internal_run(self) -> Dict[str, Any]:
# Enable Hyper-V
hv = self._node.tools[HyperV]

# Configure lisa working path to use free disk.
hv.use_raw_disk_for_lisa_working_dir()
Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be the default way. What happened, if it's running on Azure?

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 is written and tested on azure. My use case is also Azure only

Copy link
Member

Choose a reason for hiding this comment

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

I see. Please make it optional. Only if give a path in config, then create the data disk.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also use_raw_disk_for_lisa_working_dir() will skip if there is not raw disk available on the Host.

Copy link
Member

@squirrelsc squirrelsc Feb 4, 2025

Choose a reason for hiding this comment

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

It's not flexible enough. Please create configurations in the runbook. For example,

data_disk: # a list.
    - source: # new/exist/raw
      path: # for new or exist. It must be a file name for exist. It can be file name or path for new. If it ends with vhd, it means a file name, otherwise a path. If it's not set, use lisa working path for new.

@@ -445,6 +445,71 @@ def enable_internal_dhcp(self, dhcp_scope_name: str = "DHCPInternalNAT") -> None
# Restart the DHCP server to apply the changes
service.restart_service("dhcpserver")

# The default lisa working path is under 'C:/' which is not ideal for large data.
Copy link
Member

Choose a reason for hiding this comment

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

Use a configurable path, instead of use the LISA working path. The big files should be tracked separately.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These big files are vhds used as OS and data disks. They are stored by default under relevant test log folder. Its easier if we leave them that way so that its easier to map them to the test runs and clean them up once the tests are finished.

Copy link
Member

Choose a reason for hiding this comment

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

You can use LISA working path as the default path, but it should be configurable for lab environments.

)
# If no un-initialized disk is found, log a warning and return
if not raw_disks:
self._log.warning("No un-initialized disk found.")
Copy link
Member

Choose a reason for hiding this comment

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

  1. Don't print warning, either print info or raise exception.
  2. The following log line should be merged into one line, so people always know they are logged together.

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