Preemptible Instances
Preemptible instances behave the same as regular compute instances, but the capacity is reclaimed when it's needed elsewhere, and the instances are terminated. If your workloads are fault-tolerant and can withstand interruptions, then preemptible instances can reduce your costs. For example, you can use preemptible instances to optimize costs for workloads that can tolerate interruptions, such as tests that can be stopped and resumed later.
How Preemptible Instances Work
Preemptible instances are designed for short-term usage. The capacity is reclaimed when it's needed elsewhere. The capacity is not guaranteed for a minimum amount of time, so instances can be reclaimed at any time. The benefit is that preemptible capacity costs less than on-demand capacity. Therefore, for workloads that can be interrupted, preemptible capacity can lower your costs.
Using Preemptible Capacity
To use preemptible capacity, follow the standard process for creating an instance, and for Capacity type, select Preemptible capacity.
When preemptible capacity is reclaimed, the instance is terminated. Use the Events service to receive notifications when this event occurs.
Support and Limitations
Preemptible instances have the following limitations and restrictions:
- Preemptible instances can be terminated (deleted) at any time. As a result, they are not suitable for long-running workloads.
- Preemptible capacity cannot be used with capacity reservations or with the dedicated virtual machine host feature.
- Preemptible capacity does not support bare metal instances, burstable instances, or instances that have a minimum billing time.
- When you edit an instance that uses preemptible capacity, only the name of the instance can be changed. You cannot change the shape of the instance after it is launched, and you cannot convert a preemptible instance to an on-demand instance.
- After you create a preemptible instance, you cannot start, stop, or reboot the instance.
- Preemptible instances do not support sending diagnostic interrupts.
- Preemptible instances do not support confidential computing.
- You cannot use preemptible instances to create instance configurations, and preemptible instances cannot be used in instance pools.
- Preemptible instances do not support instance migration after infrastructure maintenance events. During maintenance events that impact the underlying infrastructure, the capacity is reclaimed, and the instance is terminated.
- The standard compute instance service limits and compartment quotas apply to preemptible instances. If your request for compute instances will exceed your service limits, request a service limit increase before you create the instance. For more information, see Service Limits.
- Preemptible instances do not support extended memory VM instances.
Supported Shapes
The following shapes support preemptible instances.
- VM.Standard1 series
- VM.Standard.B1 series
- VM.Standard2 series
- VM.Standard3.Flex
- VM.Standard.E2 series (the VM.Standard.E2.1.Micro series is not supported)
- VM.Standard.E3.Flex
- VM.Standard.E4.Flex
- VM.Standard.E5.Flex
- VM.Standard.A1.Flex
- VM.DenseIO1 series
- VM.DenseIO2 series
- VM.GPU2 series
- VM.GPU3 series
- VM.Optimized3.Flex
Billing and Cost Management
Preemptible capacity costs 50% less than on-demand capacity in all regions.
- To see the costs associated with your capacity usage, view cost and usage reports in the Console, or use the cost analysis feature.
- For more information about billing, see the Oracle Compute Cloud Services section of Oracle PaaS and IaaS Universal Credits Service Descriptions.
- For details about monitoring your costs, see To monitor costs.
Tracking Instance Preemption Events
You can use the Events service to receive notifications when a preemptible instance is terminated. An instancepreemptionaction
event is emitted two minutes before the instance termination begins. For details about instance preemption event types and an example event, see Instance Event Types.
For background information about creating automation to track events and steps to create event notifications, see Getting Started with Events.
To create an event notification for when a preemptible instance is terminated, when you create the event rule, do the following:
- For Condition, select Event Type.
- For Service Name, select Compute.
- For Event Type, select Instance - Preemption Action.
You can also use the Events service to invoke a function when a preemptible instance is terminated.
Required IAM Policy
The policies that let users create instances also allow them to create preemptible instances. For details, see Required IAM Policy for Working with Instances.
Tagging Resources
Apply tags to your resources to help organize them according to your business needs. Apply tags at the time you create a resource, or update the resource later with the wanted tags. For general information about applying tags, see Resource Tags.
Using the Console
Use the Console to manage preemptible instances.
- Perform the initial steps to create an instance.
- In the Placement section, click Show advanced options.
- For Capacity type, select Preemptible capacity.
- Choose whether to permanently delete the attached boot volume when the capacity is reclaimed.
- For Image and shape, choose a shape that supports preemptible instances.
- Finish creating your instance, and then click Create.
When you edit an instance that uses preemptible capacity, only the name of the instance can be changed. You cannot change the shape of the instance after it is launched, and you cannot convert a preemptible instance to an on-demand instance.
- Open the navigation menu and click Compute. Under Compute, click Instances.
- Click the instance that you're interested in.
- Click More Actions, and then click Edit.
- Enter a new name. Avoid entering confidential information.
- Click Save Changes.
Preemptible instances cannot be started, stopped, or rebooted.
You can use the Events service to receive notifications when a preemptible instance is terminated. An instancepreemptionaction
event is emitted two minutes before the instance termination begins. For details about instance preemption event types and an example event, see Instance Event Types.
For background information about creating automation to track events and steps to create event notifications, see Getting Started with Events.
To create an event notification for when a preemptible instance is terminated, when you create the event rule, do the following:
- For Condition, select Event Type.
- For Service Name, select Compute.
- For Event Type, select Instance - Preemption Action.
You can also use the Events service to invoke a function when a preemptible instance is terminated.
In the Console, you can access cost and usage reports to see the breakdown of costs for your preemptible instances, and you can use the cost analysis feature to track and optimize your spending.
- To view cost and usage reports: Open the navigation menu and click Billing & Cost Management. Under Cost Management, click Cost and Usage Reports. For more information, see Accessing Cost and Usage Reports.
- To view cost analysis: Open the navigation menu and click Billing & Cost Management. Under Cost Management, click Cost Analysis. For details instructions explaining how to work with the cost analysis tool, see Cost Analysis Overview.
In the cost and usage report, for preemptible instances, the description column includes the word Preemptible. The report shows the bill rate per hour for each resource. If the capacity is reclaimed in less than a minute, you are not charged for that time.
Using the API
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.
Use these API operations to manage preemptible instances: