oracle/terraform-examples

Terraform OPC- bootable disk snapshot

Opened this issue · 2 comments

I am working on Oracle public cloud and I used terraform resource "opc_compute_storage_volume_snapshot" to create a snapshot of an existing bootable disk. it went well. After i used "opc_compute_storage_volume" to restore the snapshot using snapshot id and there i have few problems,
a) even though i took snapshot of a boot disk the restoration is not giving a bootable disk
b) during restoration of snapshot, if i give bootable=true then terraform is asking for a image list and image entry and later terraform is not using the snapshot and using that image to create the volume.
can anybody please help me on this.

Please find below my terraform scripts,

boot-snapshot

resource "opc_compute_storage_volume_snapshot" "demo-snap-bt" {
name = "${var.st_snp_bt_name}"
description = "${var.project}_${var.st_snp_bt_name}"
tags = ["${var.st_snp_bt_tags}"]
parent_volume_bootable = true
volume_name = "my volume-disk"
}

#restore boot
resource "opc_compute_storage_volume" "demo-rst-bt" {
name = "${var.st_rst_bt_name}"
description = "${var.project}_${var.st_rst_bt_name}"
size = 20
tags = ["${var.st_snp_bt_tags}"]
snapshot_id = "${opc_compute_storage_volume_snapshot.demo-snap-bt.snapshot_id}"
}

Moved issue to new provider devlopment repo and closing here.
terraform-providers/terraform-provider-opc#16