-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Sled reservation loops over a list of sled targets returned by the sled_find_targets_query CTE, which whittles down all available sleds into a list of targets that would satisfy the VMM request., and attempts to insert the sled resources record in sled_insert_resource_query. The sled_find_targets_query CTE accounts for instance affinity and anti-affinity, and the sled resources that would be consumed if the reservation succeeded. In the uncontended case the insert should succeed on the first loop iteration, and in the contended case may require multiple iterations.
If there are local storage allocations to perform as well, this currently occurs in the sled_insert_resource_query CTE, but the sled_find_targets_query is not aware of them and will not whittle the list of available sleds down accordingly. This results in that CTE returning sled targets that may not be valid but will be tried anyway.
Change the sled_find_targets_query CTE to be aware of what local storage allocations need to be performed.