dmacvicar / terraform-provider-libvirt

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

Error removing DNS local_only section #577

Open richiejp opened 5 years ago

richiejp commented 5 years ago

System Information

Local intel workstation

Linux distribution

Tumbleweed

Terraform version

Terraform v0.11.11

Provider and libvirt versions

terraform-provider-libvirt was not built correctly Compiled against library: libvirt 4.0.0 Using library: libvirt 4.10.0 Running hypervisor: QEMU 3.1.0 Running against daemon: 4.10.0

If that gives you "was not built correctly", get the Git commit hash from your local provider repository: I am using the Tumbleweed package!

Checklist

Description of Issue/Question

Main problem is that the diff failed when disabling/removing dns::local_only. Secondary problem is that dns::local_only = true appears to be ignored (the DNS is still available from 10.1.0.1) which is why I decided to remove it (I thought it might interfere, but it doesn't so this is not important to me).

Being frank, this is really not an important bug for me at the moment. However the error log says to submit it so I am and also it might be useful for someone else. Please don't investigate this purely on my behalf.

Setup

variable "image" {
  default = "sle-15-SP1-x86_64-205.7-terraform@64bit.qcow2"
}

variable "basename" {
  default = "sle-12-SP1-x86_64-205.7"
}

provider "libvirt" {
     uri = "qemu:///system"
}

resource "libvirt_volume" "client" {
  name = "qatrfm-vdisk-${var.basename}.qcow2"
  source = "${var.image}"
  format = "qcow2"
}

resource "libvirt_volume" "AD-controller" {
  name = "qatrfm-vdisk-AD-controller.qcow2"
  # If you need to recreate the windows VMs, comment out source and uncomment
  # size
  source = "/var/lib/libvirt/images/AD-controller.qcow2"
  # size = 50000000000
  format = "qcow2"
}

resource "libvirt_volume" "DFS-host-A" {
  name = "qatrfm-vdisk-DFS-host-A.qcow2"
  source = "/var/lib/libvirt/images/DFS-host-A.qcow"
  # size = 50000000000
  format = "qcow2"
}

resource "libvirt_volume" "DFS-host-B" {
  name = "qatrfm-vdisk-DFS-host-B.qcow2"
  source = "/var/lib/libvirt/images/DFS-host-B.qcow"
  # size = 50000000000
  format = "qcow2"
}

resource "libvirt_network" "my-net" {
  name = "qatrfm-my-net"
  addresses = ["10.1.0.0/24"]
}

resource "libvirt_domain" "sle" {
  name = "qatrfm-vm-${var.basename}"
  memory = 1024
  vcpu = 2

  network_interface {
    network_id = "${libvirt_network.my-net.id}"
    addresses = ["10.1.0.5"]
    mac = "DE:AD:BE:EF:00:04"

   # Add dns { local_only = true } here
  }

  disk {
   volume_id = "${libvirt_volume.client.id}"
  }

  console {
    type        = "pty"
    target_port = "0"
    target_type = "serial"
  }

  console {
      type        = "pty"
      target_type = "virtio"
      target_port = "1"
  }

  graphics {
    type = "vnc"
    listen_type = "address"
    autoport = "true"
  }
}

resource "libvirt_domain" "AD-controller" {
  name = "qatrfm-vm-AD-controller"
  memory = 3072
  vcpu = 2

  network_interface {
    network_id = "${libvirt_network.my-net.id}"
    addresses = ["10.1.0.2"]
    mac = "DE:AD:BE:EF:00:01"
  }

  disk = [
    {
      volume_id = "${libvirt_volume.AD-controller.id}"
    },
    # Actually defined in second-iso.xsl (see the xml block below)
    #{file = "en_windows_server_2016_x64_dvd_9327751.iso"},
    #{file = "virtio-win-0.1.164.iso"}
  ]

  graphics {
    type = "vnc"
    listen_type = "address"
    autoport = "true"
  }

  xml {
    # Add a QXL video card device which is not supported in older libvirt
    # terraform providers
    xslt = "${file("video.xsl")}"
    # Add two iso drives with bootindex set as well as the video card. This is
    # only needed if you are reinstalling Windows.
    # xslt = "${file("second-iso.xsl")}"
  }
}

resource "libvirt_domain" "DFS-host-A" {
  name = "qatrfm-vm-DFS-host-A"
  memory = 1024
  vcpu = 2

  network_interface {
    network_id = "${libvirt_network.my-net.id}"
    addresses = ["10.1.0.3"]
    mac = "DE:AD:BE:EF:00:02"
  }

  disk = [
    {
      volume_id = "${libvirt_volume.DFS-host-A.id}"
    },
    #{file = "en_windows_server_2016_x64_dvd_9327751.iso"},
    #{file = "virtio-win-0.1.164.iso"}
  ]

  graphics {
    type = "vnc"
    listen_type = "address"
    autoport = "true"
  }

  xml {
    xslt = "${file("video.xsl")}"
    # xslt = "${file("second-iso.xsl")}"
  }
}

resource "libvirt_domain" "DFS-host-B" {
  name = "qatrfm-vm-DFS-host-B"
  memory = 1024
  vcpu = 2

  network_interface {
    network_id = "${libvirt_network.my-net.id}"
    addresses = ["10.1.0.4"]
    mac = "DE:AD:BE:EF:00:03"
  }

  disk = [
    {
      volume_id = "${libvirt_volume.DFS-host-B.id}"
    },
    #{file = "en_windows_server_2016_x64_dvd_9327751.iso"},
    #{file = "virtio-win-0.1.164.iso"}
  ]

  graphics {
    type = "vnc"
    listen_type = "address"
    autoport = "true"
  }

  xml {
    xslt = "${file("video.xsl")}"
    # xslt = "${file("second-iso.xsl")}"
  }
}

video.xsl:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/domain/devices">
    <devices>
      <xsl:apply-templates select="node()|@*"/>

      <video>
        <model type="qxl"></model>
      </video>
    </devices>
  </xsl:template>

</xsl:stylesheet>

second-iso.xsl:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/domain/devices">
    <devices>
      <xsl:apply-templates select="node()|@*"/>

      <video>
        <model type="qxl">
        </model>
      </video>

      <disk type="file" device="cdrom" snapshot="no">
        <source file="/home/rich/terraform/qatrfm-tests/storage/cifs/en_windows_server_2016_x64_dvd_9327751.iso" />
        <target dev="hda" bus="ide" />
        <boot order="2" />
      </disk>

      <disk type="file" device="cdrom" snapshot="no">
        <source file="/home/rich/terraform/qatrfm-tests/storage/cifs/virtio-win-0.1.164.iso" />
        <target dev="hdb" bus="ide" />
        <boot order="3" />
      </disk>
    </devices>
  </xsl:template>

  <xsl:template match="/domain/devices/disk[@type='volume'][@device='disk']">
    <disk type='volume' device='disk'>
      <xsl:apply-templates select="node()|@*"/>

      <boot order="1" />
    </disk>
  </xsl:template>

</xsl:stylesheet>

Steps to Reproduce Issue

I guess; create a setup with the appropriate DNS settings and some domains with IPs assigned, apply it and then remove the DNS setting, then apply it again.

terraform apply
libvirt_volume.DFS-host-A: Refreshing state... (ID: /var/lib/libvirt/images/qatrfm-vdisk-DFS-host-A.qcow2)
libvirt_volume.client: Refreshing state... (ID: /var/lib/libvirt/images/qatrfm-vdisk-sle-12-SP5-x86_64-0127.qcow2)
libvirt_volume.AD-controller: Refreshing state... (ID: /var/lib/libvirt/images/qatrfm-vdisk-AD-controller.qcow2)
libvirt_volume.DFS-host-B: Refreshing state... (ID: /var/lib/libvirt/images/qatrfm-vdisk-DFS-host-B.qcow2)
libvirt_network.my-net: Refreshing state... (ID: f25095a2-f96f-4e6f-a2ae-717fd8c6712f)
libvirt_domain.DFS-host-A: Refreshing state... (ID: 85833621-f30f-402d-b7d1-5b45d1a9930f)
libvirt_domain.AD-controller: Refreshing state... (ID: a416d0f4-7c00-4c9e-84b0-4dea62ea9db7)
libvirt_domain.DFS-host-B: Refreshing state... (ID: adbd2956-f291-4cca-bcb7-d851ccc70157)
libvirt_domain.sle: Refreshing state... (ID: 34c7f9d6-ecb8-49da-ae7d-1fa78b818dc5)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

-/+ libvirt_domain.AD-controller (new resource required)
      id:                               "a416d0f4-7c00-4c9e-84b0-4dea62ea9db7" => <computed> (forces new resource)
      arch:                             "x86_64" => <computed>
      disk.#:                           "1" => "1"
      disk.0.scsi:                      "false" => "false"
      disk.0.volume_id:                 "/var/lib/libvirt/images/qatrfm-vdisk-AD-controller.qcow2" => "/var/lib/libvirt/images/qatrfm-vdisk-AD-controller.qcow2"
      emulator:                         "/usr/bin/qemu-system-x86_64" => <computed>
      graphics.#:                       "1" => "1"
      graphics.0.autoport:              "true" => "true"
      graphics.0.listen_type:           "address" => "address"
      graphics.0.type:                  "vnc" => "vnc"
      machine:                          "pc" => <computed>
      memory:                           "3072" => "3072"
      name:                             "qatrfm-vm-AD-controller" => "qatrfm-vm-AD-controller"
      network_interface.#:              "1" => "1"
      network_interface.0.addresses.#:  "0" => "1"
      network_interface.0.addresses.0:  "" => "10.1.0.2"
      network_interface.0.hostname:     "qatrfm-vm-AD-controller" => <computed>
      network_interface.0.mac:          "DE:AD:BE:EF:00:01" => "DE:AD:BE:EF:00:01"
      network_interface.0.network_id:   "f25095a2-f96f-4e6f-a2ae-717fd8c6712f" => "${libvirt_network.my-net.id}"
      network_interface.0.network_name: "qatrfm-my-net" => <computed>
      qemu_agent:                       "false" => "false"
      running:                          "true" => "true"
      vcpu:                             "2" => "2"
      xml.#:                            "1" => "1"
      xml.0.xslt:                       "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\">\n\t</model>\n      </video>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/en_windows_server_2016_x64_dvd_9327751.iso\" />\n\t<target dev=\"hda\" bus=\"ide\" />\n\t<boot order=\"2\" />\n      </disk>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/virtio-win-0.1.164.iso\" />\n\t<target dev=\"hdb\" bus=\"ide\" />\n\t<boot order=\"3\" />\n      </disk>\n    </devices>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices/disk[@type='volume'][@device='disk']\">\n    <disk type='volume' device='disk'>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <boot order=\"1\" />\n    </disk>\n  </xsl:template>\n\n</xsl:stylesheet>\n" => "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\"></model>\n      </video>\n    </devices>\n  </xsl:template>\n\n</xsl:stylesheet>\n" (forces new resource)

-/+ libvirt_domain.DFS-host-A (new resource required)
      id:                               "85833621-f30f-402d-b7d1-5b45d1a9930f" => <computed> (forces new resource)
      arch:                             "x86_64" => <computed>
      disk.#:                           "1" => "1"
      disk.0.scsi:                      "false" => "false"
      disk.0.volume_id:                 "/var/lib/libvirt/images/qatrfm-vdisk-DFS-host-A.qcow2" => "/var/lib/libvirt/images/qatrfm-vdisk-DFS-host-A.qcow2"
      emulator:                         "/usr/bin/qemu-system-x86_64" => <computed>
      graphics.#:                       "1" => "1"
      graphics.0.autoport:              "true" => "true"
      graphics.0.listen_type:           "address" => "address"
      graphics.0.type:                  "vnc" => "vnc"
      machine:                          "pc" => <computed>
      memory:                           "1024" => "1024"
      name:                             "qatrfm-vm-DFS-host-A" => "qatrfm-vm-DFS-host-A"
      network_interface.#:              "1" => "1"
      network_interface.0.addresses.#:  "1" => "1"
      network_interface.0.addresses.0:  "10.1.0.3" => "10.1.0.3"
      network_interface.0.hostname:     "qatrfm-vm-DFS-host-A" => <computed>
      network_interface.0.mac:          "DE:AD:BE:EF:00:02" => "DE:AD:BE:EF:00:02"
      network_interface.0.network_id:   "f25095a2-f96f-4e6f-a2ae-717fd8c6712f" => "${libvirt_network.my-net.id}"
      network_interface.0.network_name: "qatrfm-my-net" => <computed>
      qemu_agent:                       "false" => "false"
      running:                          "true" => "true"
      vcpu:                             "2" => "2"
      xml.#:                            "1" => "1"
      xml.0.xslt:                       "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\">\n\t</model>\n      </video>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/en_windows_server_2016_x64_dvd_9327751.iso\" />\n\t<target dev=\"hda\" bus=\"ide\" />\n\t<boot order=\"2\" />\n      </disk>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/virtio-win-0.1.164.iso\" />\n\t<target dev=\"hdb\" bus=\"ide\" />\n\t<boot order=\"3\" />\n      </disk>\n    </devices>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices/disk[@type='volume'][@device='disk']\">\n    <disk type='volume' device='disk'>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <boot order=\"1\" />\n    </disk>\n  </xsl:template>\n\n</xsl:stylesheet>\n" => "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\"></model>\n      </video>\n    </devices>\n  </xsl:template>\n\n</xsl:stylesheet>\n" (forces new resource)

-/+ libvirt_domain.DFS-host-B (new resource required)
      id:                               "adbd2956-f291-4cca-bcb7-d851ccc70157" => <computed> (forces new resource)
      arch:                             "x86_64" => <computed>
      disk.#:                           "1" => "1"
      disk.0.scsi:                      "false" => "false"
      disk.0.volume_id:                 "/var/lib/libvirt/images/qatrfm-vdisk-DFS-host-B.qcow2" => "/var/lib/libvirt/images/qatrfm-vdisk-DFS-host-B.qcow2"
      emulator:                         "/usr/bin/qemu-system-x86_64" => <computed>
      graphics.#:                       "1" => "1"
      graphics.0.autoport:              "true" => "true"
      graphics.0.listen_type:           "address" => "address"
      graphics.0.type:                  "vnc" => "vnc"
      machine:                          "pc" => <computed>
      memory:                           "1024" => "1024"
      name:                             "qatrfm-vm-DFS-host-B" => "qatrfm-vm-DFS-host-B"
      network_interface.#:              "1" => "1"
      network_interface.0.addresses.#:  "1" => "1"
      network_interface.0.addresses.0:  "10.1.0.4" => "10.1.0.4"
      network_interface.0.hostname:     "qatrfm-vm-DFS-host-B" => <computed>
      network_interface.0.mac:          "DE:AD:BE:EF:00:03" => "DE:AD:BE:EF:00:03"
      network_interface.0.network_id:   "f25095a2-f96f-4e6f-a2ae-717fd8c6712f" => "${libvirt_network.my-net.id}"
      network_interface.0.network_name: "qatrfm-my-net" => <computed>
      qemu_agent:                       "false" => "false"
      running:                          "true" => "true"
      vcpu:                             "2" => "2"
      xml.#:                            "1" => "1"
      xml.0.xslt:                       "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\">\n\t</model>\n      </video>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/en_windows_server_2016_x64_dvd_9327751.iso\" />\n\t<target dev=\"hda\" bus=\"ide\" />\n\t<boot order=\"2\" />\n      </disk>\n\n      <disk type=\"file\" device=\"cdrom\" snapshot=\"no\">\n\t<source file=\"/home/rich/terraform/qatrfm-tests/storage/cifs/virtio-win-0.1.164.iso\" />\n\t<target dev=\"hdb\" bus=\"ide\" />\n\t<boot order=\"3\" />\n      </disk>\n    </devices>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices/disk[@type='volume'][@device='disk']\">\n    <disk type='volume' device='disk'>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <boot order=\"1\" />\n    </disk>\n  </xsl:template>\n\n</xsl:stylesheet>\n" => "<?xml version=\"1.0\" ?>\n<xsl:stylesheet version=\"1.0\"\n                xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"/domain/devices\">\n    <devices>\n      <xsl:apply-templates select=\"node()|@*\"/>\n\n      <video>\n\t<model type=\"qxl\"></model>\n      </video>\n    </devices>\n  </xsl:template>\n\n</xsl:stylesheet>\n" (forces new resource)

-/+ libvirt_domain.sle (new resource required)
      id:                               "34c7f9d6-ecb8-49da-ae7d-1fa78b818dc5" => <computed> (forces new resource)
      arch:                             "x86_64" => <computed>
      console.#:                        "2" => "2"
      console.0.target_port:            "0" => "0"
      console.0.target_type:            "serial" => "serial"
      console.0.type:                   "pty" => "pty"
      console.1.target_port:            "1" => "1"
      console.1.target_type:            "virtio" => "virtio"
      console.1.type:                   "pty" => "pty"
      disk.#:                           "1" => "1"
      disk.0.scsi:                      "false" => "false"
      disk.0.volume_id:                 "/var/lib/libvirt/images/qatrfm-vdisk-sle-12-SP5-x86_64-0127.qcow2" => "${libvirt_volume.client.id}"
      emulator:                         "/usr/bin/qemu-system-x86_64" => <computed>
      graphics.#:                       "1" => "1"
      graphics.0.autoport:              "true" => "true"
      graphics.0.listen_type:           "address" => "address"
      graphics.0.type:                  "vnc" => "vnc"
      machine:                          "pc" => <computed>
      memory:                           "1024" => "1024"
      name:                             "qatrfm-vm-sle-12-SP5-x86_64-0127" => "qatrfm-vm-sle-12-SP1-x86_64-205.7" (forces new resource)
      network_interface.#:              "1" => "1"
      network_interface.0.addresses.#:  "1" => "1"
      network_interface.0.addresses.0:  "10.1.0.5" => "10.1.0.5"
      network_interface.0.hostname:     "qatrfm-vm-sle-12-SP5-x86_64-0127" => <computed>
      network_interface.0.mac:          "DE:AD:BE:EF:00:04" => "DE:AD:BE:EF:00:04"
      network_interface.0.network_id:   "f25095a2-f96f-4e6f-a2ae-717fd8c6712f" => "${libvirt_network.my-net.id}"
      network_interface.0.network_name: "qatrfm-my-net" => <computed>
      qemu_agent:                       "false" => "false"
      running:                          "true" => "true"
      vcpu:                             "2" => "2"

-/+ libvirt_network.my-net (new resource required)
      id:                               "f25095a2-f96f-4e6f-a2ae-717fd8c6712f" => <computed> (forces new resource)
      addresses.#:                      "1" => "1"
      addresses.0:                      "10.1.0.0/24" => "10.1.0.0/24"
      bridge:                           "virbr4" => <computed>
      dns.#:                            "1" => "0" (forces new resource)
      dns.0.local_only:                 "true" => "false"
      mode:                             "nat" => "nat"
      name:                             "qatrfm-my-net" => "qatrfm-my-net"

-/+ libvirt_volume.client (new resource required)
      id:                               "/var/lib/libvirt/images/qatrfm-vdisk-sle-12-SP5-x86_64-0127.qcow2" => <computed> (forces new resource)
      format:                           "qcow2" => "qcow2"
      name:                             "qatrfm-vdisk-sle-12-SP5-x86_64-0127.qcow2" => "qatrfm-vdisk-sle-12-SP1-x86_64-205.7.qcow2" (forces new resource)
      pool:                             "default" => "default"
      size:                             "42949672960" => <computed>
      source:                           "sle-12-SP5-x86_64-0127-terraform@64bit.qcow2" => "sle-15-SP1-x86_64-205.7-terraform@64bit.qcow2" (forces new resource)

Plan: 6 to add, 0 to change, 6 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

libvirt_domain.DFS-host-B: Destroying... (ID: adbd2956-f291-4cca-bcb7-d851ccc70157)
libvirt_domain.AD-controller: Destroying... (ID: a416d0f4-7c00-4c9e-84b0-4dea62ea9db7)
libvirt_domain.DFS-host-A: Destroying... (ID: 85833621-f30f-402d-b7d1-5b45d1a9930f)
libvirt_domain.sle: Destroying... (ID: 34c7f9d6-ecb8-49da-ae7d-1fa78b818dc5)
libvirt_domain.DFS-host-B: Destruction complete after 1s
libvirt_domain.AD-controller: Destruction complete after 1s
libvirt_domain.DFS-host-A: Destruction complete after 2s
libvirt_domain.sle: Destruction complete after 2s
libvirt_volume.client: Destroying... (ID: /var/lib/libvirt/images/qatrfm-vdisk-sle-12-SP5-x86_64-0127.qcow2)
libvirt_network.my-net: Destroying... (ID: f25095a2-f96f-4e6f-a2ae-717fd8c6712f)
libvirt_volume.client: Destruction complete after 4s
libvirt_volume.client: Creating...
  format: "" => "qcow2"
  name:   "" => "qatrfm-vdisk-sle-12-SP1-x86_64-205.7.qcow2"
  pool:   "" => "default"
  size:   "" => "<computed>"
  source: "" => "sle-15-SP1-x86_64-205.7-terraform@64bit.qcow2"
libvirt_network.my-net: Destruction complete after 5s
libvirt_volume.client: Creation complete after 4s (ID: /var/lib/libvirt/images/qatrfm-vdisk-sle-12-SP1-x86_64-205.7.qcow2)

Error: Error applying plan:

1 error(s) occurred:

* libvirt_network.my-net: libvirt_network.my-net: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.11
    Resource ID: libvirt_network.my-net
    Mismatch reason: attribute mismatch: dns.0.local_only
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"name":*terraform.ResourceAttrDiff{Old:"qatrfm-my-net", New:"qatrfm-my-net", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "mode":*terraform.ResourceAttrDiff{Old:"nat", New:"nat", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "addresses.#":*terraform.ResourceAttrDiff{Old:"1", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "addresses.0":*terraform.ResourceAttrDiff{Old:"10.1.0.0/24", New:"10.1.0.0/24", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "dns.#":*terraform.ResourceAttrDiff{Old:"1", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "dns.0.local_only":*terraform.ResourceAttrDiff{Old:"true", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "bridge":*terraform.ResourceAttrDiff{Old:"virbr4", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"mode":*terraform.ResourceAttrDiff{Old:"", New:"nat", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"qatrfm-my-net", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "bridge":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "addresses.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "addresses.0":*terraform.ResourceAttrDiff{Old:"", New:"10.1.0.0/24", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
MalloZup commented 5 years ago

Thx 💯

facorazza commented 9 months ago

I think I'm experiencing a similar error. Toggling between dns { enabled = true/false } doesn't update the network config and terraform plan always show that the update is yet to be applied.

scabala commented 1 month ago

It might be related to #1069