dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

Which domain attributes not require replacement? #1069

Open zolia opened 4 months ago

zolia commented 4 months ago

System Information

Linux distribution

Debian 12

Terraform version

$ tf -v
Terraform v1.6.2
on darwin_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.7.1

Provider and libvirt versions

libvirt v0.7.1

Qemu version:

root@kvm5006:~# /usr/bin/qemu-system-x86_64 -version
QEMU emulator version 7.2.4 (Debian 1:7.2+dfsg-7+deb12u1)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

Description of Issue/Question

Setup

Here is my domain:

  # libvirt_domain.my-domain must be replaced
-/+ resource "libvirt_domain" "my-domain" {
      ~ arch        = "x86_64" -> (known after apply)
      ~ autostart   = true -> (known after apply)
      - cmdline     = [] -> null
      ~ emulator    = "/usr/bin/qemu-system-x86_64" -> (known after apply)
      ~ id          = "5d9d1f00-23ea-4cf3-ba4f-54e037514340" -> (known after apply)
      ~ machine     = "pc" -> (known after apply)
      ~ memory      = 512 -> 2048 # forces replacement
        name        = "ea-fota"
        # (5 unchanged attributes hidden)
...

Does libvirt provider support memory change for a domain? If so, how can I do it? Maybe some workarounds to make it work?

Steps to Reproduce Issue

The increased memory size of a domain and terraform attempts to recreate it.