[PATCH v3 10/36] terraform/oci: Enable preemptible compute instances

Chuck Lever <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Chuck Lever <[email protected]>

Enabling instance preemption allows the provider to destroy the
instance if it needs the resources. The benefit is a 50%
reduction in price.

Typically, there's nothing on these instances that can't be
re-cloned or reproduced.

This should really be a Kconfig setting.

Reviewed-by: Luis Chamberlain <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
---
 terraform/oci/main.tf | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index 1d2d0f82e00f..45a4b4bc0c63 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -37,6 +37,13 @@ resource "oci_core_instance" "kdevops_instance" {
     ssh_authorized_keys = file(var.ssh_config_pubkey_file)
   }
 
+  preemptible_instance_config {
+    preemption_action {
+      type                 = "TERMINATE"
+      preserve_boot_volume = false
+    }
+  }
+
   preserve_boot_volume = false
 }
 
-- 
2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.