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 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 launch a preemptible instance, you cannot start, stop, or reboot the instance.
- Preemptible instances do not support sending diagnostic interrupts.
- You cannot use preemptible instances to create instance configurations, and preemptible instances cannot be used in instance pools.
- Preemptible instances don't 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 exceeds your service limits, request a service limit increase before you create the instance. For more information, see Service Limits.
Supported Shapes and Images
The following shapes support preemptible instances.
- VM.Standard.E3.Flex series (Standard – E3 series)
- VM.Standard2 series (Virtual Machine Standard – X7 series)
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 thirty seconds 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
You can apply tags to your resources to help you organize them according to your business needs. You can apply tags at the time you create a resource, or you can 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.
- 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 Edit.
- Enter a new name. Avoid entering confidential information.
- Click Save Changes.
Preemptible instances cannot be started, stopped, or rebooted.
- To view cost and usage reports: Open the navigation menu and click Governance & Administration. 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 Governance & Administration. 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 APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.
Use these API operations to manage preemptible instances: