+ flavor_name=flavor_name
+ )
+
+ # apply resource limits to container if a resource model is defined
+ if self._resource_model is not None:
+ try:
+ self._resource_model.allocate(d)
+ self._resource_model.write_allocation_log(d, self.resource_log_path)
+ except NotEnoughResourcesAvailable as ex:
+ LOG.warning("Allocation of container %r was blocked by resource model." % name)
+ LOG.info(ex.message)
+ # ensure that we remove the container
+ self.net.removeDocker(name)
+ return None
+