I am trying to create an OpenStack instance using Terraform but I'm getting the following error:
Error applying plan:
1 error(s) occurred:
* openstack_compute_instance_v2.basic: Error creating OpenStack server: Invalid
request due to incorrect syntax or missing required parameters.
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
but the same Terraform code does successfully create the security group, key pair and volume in my OpenStack account
Here is my Terraform code:
provider "openstack" {
user_name = "admin"
tenant_name = "admin"
password = "admin"
auth_url = "http://my_IP():5000/v2.0"
}
resource "openstack_blockstorage_volume_v1" "myvol" {
name = "myvol"
size = 1
}
resource "openstack_compute_instance_v2" "basic" {
name = "basic"
image_id = "8ce1c922-ad0-81a3-823ea1b0af9b"
flavor_id = "2"
key_pair = "tf-keypair-1"
security_groups = ["default"]
metadata {
this = "that"
}
network {
name = "8b510300-610a--9cc3-6e76e33395b4"
}
volume {
volume_id = "${openstack_blockstorage_volume_v1.myvol.id}"
}
}
This message was quite hard to debug up until recently. In version 0.8.8 of Terraform (more specifically the Enable HTTP Logging improvement for the OpenStack Terraform provider), the team added OS_DEBUG environmental variable to help provide more information in cases like these. One way to use it is as follows:
TF_LOG=DEBUG OS_DEBUG=1 terraform apply ...
Once I had this message because I had forgotten to add the ssh key in the OpenStack for the user I was using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With