gpt4 book ai didi

openstack - 无法从 Terraform 启动 Openstack 实例

转载 作者:行者123 更新时间:2023-12-02 11:31:04 27 4
gpt4 key购买 nike

我尝试使用 Terraform 创建 OpenStack 实例,但收到以下错误:

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

但相同的 Terraform 代码确实在我的 OpenStack 帐户中成功创建了安全组、 key 对和卷

这是我的 Terraform 代码:​​

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}"
}
}

最佳答案

直到最近,这条消息还很难调试。在 version 0.8.8 of Terraform (更具体地说 Enable HTTP Logging improvement for the OpenStack Terraform provider) ,团队添加了 OS_DEBUG 环境变量,以帮助在此类情况下提供更多信息。使用它的一种方法如下:

TF_LOG=DEBUG OS_DEBUG=1 terraform apply ...

一旦我收到此消息,因为我忘记在 OpenStack 中为我正在使用的用户添加 ssh key 。

关于openstack - 无法从 Terraform 启动 Openstack 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40651778/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com