Differential D19762 Diff 47220 src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php
Show All 39 Lines | if (!$bindings) { | ||||
// If there are no devices bound to the services for this blueprint, | // If there are no devices bound to the services for this blueprint, | ||||
// we can not allocate resources. | // we can not allocate resources. | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldAllocateSupplementalResource( | |||||
DrydockBlueprint $blueprint, | |||||
DrydockResource $resource, | |||||
DrydockLease $lease) { | |||||
// We want to use every host in an Almanac service, since the amount of | |||||
// hardware is fixed and there's normally no value in packing leases onto a | |||||
// subset of it. Always build a new supplemental resource if we can. | |||||
return true; | |||||
} | |||||
public function canAllocateResourceForLease( | public function canAllocateResourceForLease( | ||||
DrydockBlueprint $blueprint, | DrydockBlueprint $blueprint, | ||||
DrydockLease $lease) { | DrydockLease $lease) { | ||||
// We will only allocate one resource per unique device bound to the | // We will only allocate one resource per unique device bound to the | ||||
// services for this blueprint. Make sure we have a free device somewhere. | // services for this blueprint. Make sure we have a free device somewhere. | ||||
$free_bindings = $this->loadFreeBindings($blueprint); | $free_bindings = $this->loadFreeBindings($blueprint); | ||||
if (!$free_bindings) { | if (!$free_bindings) { | ||||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |