-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
2
-
False
-
-
False
-
?
-
rhos-ops-day1day2-migrations
-
None
-
-
-
-
Important
Description
The best_match_flavor module currently includes the flavor's root disk size (flavor.Disk) in the distance calculation when finding the best matching flavor. However, since the toolkit exclusively uses boot-from-volume for instance creation, the flavor's root disk property is irrelevant and should be excluded from the matching algorithm.
Problem
The current flavorDistance function calculates the "distance" between a flavor and VM requirements using vCPU, RAM, and disk:
func flavorDistance(flavor *flavors.Flavor, guestInfo *GuestInfo, diskCapacityMb int) int { vcpuDiff := int(math.Abs(float64(flavor.VCPUs - guestInfo.HwProcessorCount))) ramDiff := int(math.Abs(float64(flavor.RAM - guestInfo.HwMemtotalMb))) diskDiff := int(math.Abs(float64(flavor.Disk - diskCapacityMb))) return vcpuDiff + ramDiff + diskDiff }
This causes issues because:
- Boot-from-volume ignores the flavor's root disk: When booting from a Cinder volume, the flavor.Disk value refers to an ephemeral root disk that is never created or used.
- Suboptimal flavor selection: The algorithm may reject or deprioritize a perfectly suitable flavor (correct vCPU and RAM) simply because its disk value doesn't match the VM's disk size.
- Customer confusion: Users report that the toolkit "requires" a flavor with a root disk size matching their VM, even though that disk space is never actually used.