Hello
Despite executing the stop or delete command, an Azure container instance continues to run and is still billed.
Cause
This issue might occur due to potential bugs in the container stop or delete process.
Solution
To resolve this issue, follow these steps:
- Verify that the
stop or delete command was executed.
- Verify that the container instance is still billed.
- Create a new container instance with the same resource ID in the same region. Upon successful creation, the old container instance will be deleted immediately.
Scenario in which Spot containers remain stuck in the Waiting state in Microsoft Azure Container Instances.
Symptoms
Azure Spot containers remain stuck in the Waiting state for an extended amount of time (30 minutes or more).
VM was Evicted
Containers typically become stuck in the Waiting state because the underlying Spot virtual machine (VM) was evicted. This action forces all containers within the container group to wait for a new VM node to be assigned. Azure Spot VMs can be evicted at any time for any of the following reasons:
- Resource constraints on the host VM (for example, because of insufficient CPU cores or memory).
- Capacity adjustments that can cause worker VM nodes to be evicted at any time from a virtual machine scale set and, therefore, require your container group to be moved to another VM node. These capacity adjustments include the following scenarios.
|
Eviction scenario |
Effect on the container group |
|
A node in a cluster gets evicted. |
The container group has to be moved to another node in the same cluster (if present). |
|
All nodes in a cluster get evicted. |
The container group has to be moved to a node in another cluster (if present). |
|
All nodes in all clusters get evicted. |
A Spot Restore occurs, and the container group has to be moved to a new node in any cluster. |
Network related Problems
Network-related problems cause containers to remain in the Waiting state.
Follow these steps to gather troubleshooting information and apply possible solutions for the problem:
Retrieve container logs and events by running the following az container logs command:
Azure CLI
az container logs --resource-group
Check the container logs for any error messages or events about image pulling, networking, or other container-specific problems.
Check for eviction events.
Make sure that your container deployment settings fall within the parameters that are defined in the Resource availability & quota limits for Azure Container Instances.
Consider specifying lower CPU and memory settings for the container.
If the problem persists, consider deploying your container to a different Azure region.
If the problem is related to capacity adjustments, consider deploying your containers during off-peak hours.
By following these steps, you can identify the cause of the Waiting state problem for your Azure Spot containers and take the appropriate action to resolve the problem. Remember to monitor your containers and adjust your deployment strategy as necessary to reduce disruptions.
Thanks,
Manish Deshpande