resource "openstack_blockstorage_volume_v1" "db_system" {
name = "db_system"
size = 30
image_id = "${var.IMAGE_ID}"
description = "System volume for MySQL"
}
resource "openstack_blockstorage_volume_v1" "db_data" {
region = ""
name = "db_data"
description = "data volume for MySQL"
size = 50
}
resource "openstack_compute_instance_v2" "database" {
name = "db01"
flavor_name = "${var.INSTANCE_TYPE}"
key_pair = "${openstack_compute_keypair_v2.ssh-keypair.name}"
security_groups = ["${openstack_networking_secgroup_v2.local_ssh.name}",
"${openstack_networking_secgroup_v2.local_mysql.name}"]
block_device {
uuid = "${openstack_blockstorage_volume_v1.db_system.id}"
source_type = "volume"
boot_index = 0
volume_size = "${openstack_blockstorage_volume_v1.db_system.size}"
destination_type = "volume"
delete_on_termination = true
}
volume {
volume_id = "${openstack_blockstorage_volume_v1.db_data.id}"
}
network {
name = "${openstack_networking_network_v2.dmz.name}"
}
}~ openstack_compute_instance_v2.database
volume.#: "2" => "1"
volume.481488857.volume_id: "1e242a36-be4e-4afa-b9ad-26066f12fa31" => "1e242a36-be4e-4afa-b9ad-26066f12fa31"
Plan: 0 to add, 1 to change, 0 to destroy.Error applying plan:
1 error(s) occurred:
* openstack_compute_instance_v2.database: Expected HTTP response code [202 204] when accessing [DELETE https://beta.openstack.skyscapecloud.com:13774/v2.1/51c7ec94d0a1420f9f55113dadbf2ec4/servers/02cee6da-298a-4f7e-968a-3ce81a0ebc4e/os-volume_attachments/1292ef21-3fa7-491c-ae93-c56131950cf8], but got 403 instead
{"forbidden": {"message": "Can't detach root device volume", "code": 403}}After some more digging, it seems that if I remove the 2nd volume and just boot from the db_system volume, everything works as expected - it's something to do with having the additional volume attached to the VM that triggers the issue.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/66c8ebdf-5360-4762-9252-5eff47bbfd9c%40googlegroups.com.