diff --git a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php --- a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php @@ -871,7 +871,12 @@ if ($resource->getStatus() != DrydockResourceStatus::STATUS_OPEN) { $message = pht( - 'Resource %d did not move into an open status', + 'This lease was dependent on resource %d moving into the '. + 'open status (i.e. there were multiple leases about to '. + 'use the same resource being allocated). However the '. + 'resource did not allocate successfully and has been '. + 'moved into a non-open status. Check the drydock logs '. + 'of that resource to determine the failure reason.', $resource->getID()); $this->log($message); throw new Exception($message); diff --git a/src/applications/drydock/worker/DrydockAllocatorWorker.php b/src/applications/drydock/worker/DrydockAllocatorWorker.php --- a/src/applications/drydock/worker/DrydockAllocatorWorker.php +++ b/src/applications/drydock/worker/DrydockAllocatorWorker.php @@ -356,7 +356,8 @@ $blueprint->allocateResource($resource, $lease); } catch (Exception $ex) { - $resource->delete(); + $resource->setStatus(DrydockResourceStatus::STATUS_BROKEN); + $resource->save(); throw $ex; }