Assuming you're using services on the Swarm and explicitly reserving memory per container, your service will stick in the 'allocated' state if you try to update it to reserve more memory than you have available.
E.g: docker service create --replicas 1 --name nginx --reserve-memory 256M nginx will succeed and create 1 container with 256MB reserved for it (if you have capacity on your Swarm). Then run docker service update --reserve-memory 300G nginx and Docker will:
- Shutdown the existing container
- Try to schedule a new container with the requested resources
If you don't have a node with 300GB available, the updated service can't be scheduled and it will sit in the Allocated state, so your service won't be running at this point.
The scheduler keeps checking, so if the resources do become available, or if you run a new update command with a lower reserve, then it will create the container as requested.