Skip to content

Commit

Permalink
vm resize: filter vm size with disk controller type
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Nov 14, 2024
1 parent 4ec8c8d commit 73597ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lisa/sut_orchestrator/azure/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,11 @@ def _select_vm_size(
for feature in current_vm_size.capability.features
if feature.type == VhdGenerationSettings.type
]
assert current_vm_size.capability.disk
assert current_vm_size.capability.disk.disk_controller_type
current_disk_controller_type = (
current_vm_size.capability.disk.disk_controller_type
)
# Loop removes candidate vm sizes if they can't be resized to or if the
# change in cores resulting from the resize is undesired
for candidate_size in avail_eligible_intersect[:]:
Expand All @@ -2097,6 +2102,17 @@ def _select_vm_size(
if candidate_arch[0].arch != current_arch[0].arch:
avail_eligible_intersect.remove(candidate_size)
continue
assert candidate_size.capability.disk
assert candidate_size.capability.disk.disk_controller_type
candidate_disk_controller_type = (
candidate_size.capability.disk.disk_controller_type
)
if not any(
dc_type in candidate_disk_controller_type
for dc_type in current_disk_controller_type
):
avail_eligible_intersect.remove(candidate_size)
continue

candidate_gen = [
feature
Expand Down

0 comments on commit 73597ad

Please sign in to comment.