有没有办法通过 terraform 增加 Azure 虚拟机的操作系统磁盘大小?

huangapple go评论52阅读模式
英文:

Is there a way to increase Azure VM OS disk size via terraform

问题

Azure VM 是通过 Terraform 代码创建的,OS 磁盘大小设置为 256 GB。

是否有办法在不重新创建 VM 的情况下增加 OS 磁盘空间(使用 Terraform)?

我的当前 Terraform 代码是:

os_disk {
    name                 = "disk23"
    disk_size_gb         = 256
    caching              = "ReadWrite"
    storage_account_type = "StandardSSD_LRS"
  }
英文:

The Azure VM was created via terraform code with OS disk size set as 256 GB.

Is there a way to increase the OS disk space (using terraform) without recreating the VM?

My current terraform code is

os_disk {
    name                 = "disk23"
    disk_size_gb         = 256
    caching              = "ReadWrite"
    storage_account_type = "StandardSSD_LRS"
  } 

答案1

得分: 0

更改 disk_size_gb 的值并运行 terraform plan,不会显示销毁操作,只会显示一个新的更改。
已更改为所需的值。

英文:

Changing the value on disk_size_gb and running terraform plan shows no destruction but just a new change.
Changed to the desired value.

huangapple
  • 本文由 发表于 2023年6月8日 04:32:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76426921.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定