-
Notifications
You must be signed in to change notification settings - Fork 181
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Don't print warning, either print info or raise exception.
- The following log line should be merged into one line, so people always know they are logged together.
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.