【问题标题】:unable to create google compute disk using terraform无法使用 terraform 创建谷歌计算磁盘
【发布时间】:2021-09-11 16:37:21
【问题描述】:

我想创建一个gcloud计算磁盘所以为了实现我写了下面的代码

resource "google_compute_disk" "default2" {
name  = "test-disk"
type  = "pd-balanced"
zone  = "us-central1-a"
image = "centos-7-v20210609"
physical_block_size_bytes = 20480
}

当我运行 terraform 时,它会显示以下错误

我该如何解决这个问题

【问题讨论】:

  • 您为什么将值20480 用于physical_block_size_bytes?典型值为 4096。

标签: google-cloud-platform terraform terraform-provider-gcp


【解决方案1】:

documentation中所述

physical_block_size_bytes - (可选)永久磁盘的物理块大小,以字节为单位。如果请求中不存在,则使用默认值。目前支持的尺寸为 4096 和 16384,未来可能会添加其他尺寸。如果请求的值不受支持,错误消息将列出调用方项目支持的值。

【讨论】:

    猜你喜欢
    • 2019-10-12
    • 2014-10-17
    • 2023-04-01
    • 2019-02-18
    • 1970-01-01
    • 2018-02-21
    • 1970-01-01
    • 2014-03-11
    • 2020-06-20
    相关资源
    最近更新 更多