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

Update get_free_disk_id method for LSO workload #954

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions benchmark_runner/common/oc/oc.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,19 @@ def get_pv_disk_ids(self):

def get_free_disk_id(self, node: str = None):
"""
This method returns free disk per node [workers disk ids - workers pv disk ids]
This method returns a free disk ID for a given node (or all nodes if no node is specified).
It identifies the disk by comparing workers' disk IDs with PV disk IDs.
"""
workers_disk_ids = self.get_worker_disk_ids(node)
workers_pv_disk_ids = self.get_pv_disk_ids()
free_disk_id = f'{self.__worker_disk_prefix}{[disk_id for disk_id in workers_disk_ids if disk_id not in workers_pv_disk_ids][0]}'
if free_disk_id:
return free_disk_id

# Find free disk IDs
free_disks = [disk_id for disk_id in workers_disk_ids if disk_id not in workers_pv_disk_ids]

if free_disks:
return f'{self.__worker_disk_prefix}{free_disks[0]}'
else:
raise ValueError('Missing free disk id')
raise ValueError('No free disk IDs available. All worker disks are already in use.')

@typechecked
def run_debug_node(self, node: str, cmd: str):
Expand Down
Loading