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

To start a container instance
  1. In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.
  2. Click the container instance that you're interested in.
  3. Click Start.

    The container instance, and all containers in it, starts.

To stop a container instance
Note

When you stop a container instance, any data on the ephemeral storage is lost.
  1. In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.

  2. Click the container instance that you're interested in.

  3. Click Stop.

    The container instance stops all containers gracefully before stopping the container instance itself.

  4. (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.
  5. Click Stop instance.

To restart a container instance
Note

When you restart a container instance, any data on the ephemeral storage is lost.
  1. In the Console, open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Instances.

  2. Click the container instance that you're interested in.

  3. 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.
  4. Click Restart container instance.