Stopping and Starting a Container Instance
You can stop and start a container instance as needed.
Required IAM Policy
To use Oracle Cloud Infrastructure, you must be granted security access in a policy by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment to work in.
For administrators: The policy in Let users create container instances includes the ability to stop or start an existing instance.
If you're new to policies, see Getting Started with Policies and Common Policies. For reference material about writing policies for container instances, cloud networks, or other Core Services API resources, see Details for the Core Services.
Resource Billing for Stopped Instances
For container instances, billing depends on the shape that you use to create the container instance. Container instances use standard shapes which pause billing when a container instance stops. However, stopped and failed instances continue to count toward your service limits.
Using the Console
- In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.
- Click the container instance that you're interested in.
-
Click Start.
The container instance, and all containers in it, starts.
When you stop a container instance, any data on the ephemeral storage is lost.
-
In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.
-
Click the container instance that you're interested in.
-
Click Stop.
The container instance stops all containers gracefully before stopping the container instance itself.
-
(Optional) When you create a container, you can set the amount of time the graceful timeout allows on the container instance. If you do not set a value, the default value is 0 seconds.
Note
If containers take more time to stop than the graceful timeout allows, they are terminated by the service. -
Click Stop instance.
When you restart a container instance, any data on the ephemeral storage is lost.
-
In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.
-
Click the container instance that you're interested in.
-
Click Restart.
Note
If containers take more time to stop than the graceful timeout allows, they are terminated by the service. When a container stops or restarts, any data on the ephemeral storage is lost and the containers are recreated with a new ephemeral storage. -
Click Restart container instance.
Using the API
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.
To manage the lifecycle state of container instances, use these operations: