Terraform-provider-libvirt: Capabilities error

Created on 2 May 2018  路  13Comments  路  Source: dmacvicar/terraform-provider-libvirt

Hello

After creating some resources on libvirt, I made some changes to .tf file. And after that calling terraform plan which causes error:

  • libvirt_domain.minio[3]: libvirt_domain.minio.3: [WARN] Cannot find machine type pc-i440fx-rhel7.4.0 for hvm/x86_64 in {{ capabilities}.....
 [WARN] Cannot find machine type pc-i440fx-rhel7.4.0 for hvm/x86_64 in {{ capabilities} {0031c2e4-1e15-e711-906e-0012795d96dd 0xc4204bec00 0xc4203bf860 [{selinux 0 [{kvm system_u:system_r:svirt_t:s0} {qemu system_u:system_r:svirt_tcg_t:s0}]} {dac 0 [{kvm +107:+107} {qemu +107:+107}]}]} [{hvm {alpha 64 /usr/bin/qemu-system-alpha [{clipper 4 <nil>}] [{qemu  []}]} 0xc4204d6e70} {hvm {armv7l 32 /usr/bin/qemu-system-arm [{borzoi 1 <nil>} {virt 4 <nil>} {midway 4 <nil>} {tosa 1 <nil>} {cheetah 1 <nil>} {realview-pb-a8 1 <nil>} {collie 1 <nil>} {n800 1 <nil>} {highbank 4 <nil>} {kzm 1 <nil>} {integratorcp 1 <nil>} {sx1-v1 1 <nil>} {smdkc210 2 <nil>} {akita 1 <nil>} {canon-a1100 1 <nil>} {spitz 1 <nil>} {verdex 1 <nil>} {xilinx-zynq-a9 1 <nil>} {realview-eb-mpcore 4 <nil>} {nuri 2 <nil>} {vexpress-a15 4 <nil>} {n810 1 <nil>} {terrier 1 <nil>} {mainstone 1 <nil>} {musicpal 1 <nil>} {realview-pbx-a9 4 <nil>} {lm3s6965evb 1 <nil>} {vexpress-a9 4 <nil>} {cubieboard 1 <nil>} {realview-eb 1 <nil>} {sx1 1 <nil>} {connex 1 <nil>} {z2 1 <nil>} {lm3s811evb 1 <nil>} {versatilepb 1 <nil>} {versatileab 1 <nil>}] [{qemu  []}]} 0xc4204d6e80} {hvm {cris 32 /usr/bin/qemu-system-cris [{axis-dev88 1 <nil>}] [{qemu  []}]} 0xc4204d6e90} {hvm {i686 32 /usr/bin/qemu-system-i386 [{pc-i440fx-2.0 255 <nil>} {pc 255 0xc4204d6ea0} {pc-0.12 255 <nil>} {pc-1.3 255 <nil>} {pc-q35-1.6 255 <nil>} {pc-q35-1.5 255 <nil>} {pc-i440fx-1.6 255 <nil>} {pc-i440fx-1.7 255 <nil>} {pc-0.11 255 <nil>} {pc-0.10 255 <nil>} {pc-1.2 255 <nil>} {isapc 1 <nil>} {pc-q35-1.4 255 <nil>} {pc-0.15 255 <nil>} {pc-0.14 255 <nil>} {pc-i440fx-1.5 255 <nil>} {pc-q35-2.0 255 <nil>} {q35 255 0xc4204d6eb0} {pc-i440fx-1.4 255 <nil>} {pc-1.1 255 <nil>} {pc-q35-1.7 255 <nil>} {pc-1.0 255 <nil>} {pc-0.13 255 <nil>}] [{qemu  []} {kvm /usr/libexec/qemu-kvm [{pc-i440fx-rhel7.4.0 240 <nil>} {pc 240 0xc4204d6ec0} {pc-i440fx-rhel7.0.0 240 <nil>} {rhel6.3.0 240 <nil>} {rhel6.4.0 240 <nil>} {rhel6.0.0 240 <nil>} {pc-i440fx-rhel7.1.0 240 <nil>} {pc-i440fx-rhel7.2.0 240 <nil>} {pc-q35-rhel7.3.0 255 <nil>} {rhel6.5.0 240 <nil>} {pc-q35-rhel7.4.0 384 <nil>} {q35 384 0xc4204d6ed0} {rhel6.6.0 240 <nil>} {rhel6.1.0 240 <nil>} {rhel6.2.0 240 <nil>} {pc-i440fx-rhel7.3.0 240 <nil>}]}]} 0xc4204d6ee0} {hvm {lm32 32 /usr/bin/qemu-system-lm32 [{lm32-evr 1 <nil>} {milkymist 1 <nil>} {lm32-uclinux 1 <nil>}] [{qemu  []}]} 0xc4204d6ef0} {hvm {m68k 32 /usr/bin/qemu-system-m68k [{mcf5208evb 1 <nil>} {dummy 1 <nil>} {an5206 1 <nil>}] [{qemu  []}]} 0xc4204d6f00} {hvm {microblaze 32 /usr/bin/qemu-system-microblaze [{petalogix-s3adsp1800 1 <nil>} {petalogix-ml605 1 <nil>}] [{qemu  []}]} 0xc4204d6f10} {hvm {microblazeel 32 /usr/bin/qemu-system-microblazeel [{petalogix-s3adsp1800 1 <nil>} {petalogix-ml605 1 <nil>}] [{qemu  []}]} 0xc4204d6f20} {hvm {mips 32 /usr/bin/qemu-system-mips [{malta 16 <nil>} {mipssim 1 <nil>} {magnum 1 <nil>} {pica61 1 <nil>} {mips 1 <nil>}] [{qemu  []}]} 0xc4204d6f30} {hvm {mipsel 32 /usr/bin/qemu-system-mipsel [{malta 16 <nil>} {mipssim 1 <nil>} {magnum 1 <nil>} {pica61 1 <nil>} {mips 1 <nil>}] [{qemu  []}]} 0xc4204d6f40} {hvm {mips64 64 /usr/bin/qemu-system-mips64 [{malta 16 <nil>} {mipssim 1 <nil>} {magnum 1 <nil>} {mips 1 <nil>} {pica61 1 <nil>}] [{qemu  []}]} 0xc4204d6f50} {hvm {mips64el 64 /usr/bin/qemu-system-mips64el [{malta 16 <nil>} {fulong2e 1 <nil>} {magnum 1 <nil>} {mipssim 1 <nil>} {mips 1 <nil>} {pica61 1 <nil>}] [{qemu  []}]} 0xc4204d6f60} {hvm {openrisc 32 /usr/bin/qemu-system-or32 [{or32-sim 1 <nil>}] [{qemu  []}]} 0xc4204d6f70} {hvm {s390x 64 /usr/bin/qemu-system-s390x [{s390-virtio 255 <nil>} {s390 255 0xc4204d6f80} {s390-ccw-virtio 255 <nil>} {s390-ccw 255 0xc4204d6f90}] [{qemu  []}]} 0xc4204d6fa0} {hvm {sh4 32 /usr/bin/qemu-system-sh4 [{shix 1 <nil>} {r2d 1 <nil>}] [{qemu  []}]} 0xc4204d6fb0} {hvm {sh4eb 64 /usr/bin/qemu-system-sh4eb [{shix 1 <nil>} {r2d 1 <nil>}] [{qemu  []}]} 0xc4204d6fc0} {hvm {unicore32 32 /usr/bin/qemu-system-unicore32 [{puv3 1 <nil>}] [{qemu  []}]} 0xc4204d6fd0} {hvm {x86_64 64 /usr/bin/qemu-system-x86_64 [{pc-i440fx-2.0 255 <nil>} {pc 255 0xc4204d6fe0} {pc-1.3 255 <nil>} {pc-0.12 255 <nil>} {pc-q35-1.6 255 <nil>} {pc-q35-1.5 255 <nil>} {pc-i440fx-1.6 255 <nil>} {pc-i440fx-1.7 255 <nil>} {pc-0.11 255 <nil>} {pc-1.2 255 <nil>} {pc-0.10 255 <nil>} {isapc 1 <nil>} {pc-q35-1.4 255 <nil>} {pc-0.15 255 <nil>} {pc-0.14 255 <nil>} {pc-i440fx-1.5 255 <nil>} {pc-i440fx-1.4 255 <nil>} {pc-q35-2.0 255 <nil>} {q35 255 0xc4204d6ff0} {pc-1.1 255 <nil>} {pc-q35-1.7 255 <nil>} {pc-1.0 255 <nil>} {pc-0.13 255 <nil>}] [{qemu  []}
  {kvm /usr/libexec/qemu-kvm [{pc-i440fx-rhel7.4.0 240 <nil>} {pc 240 0xc4204d7000} {pc-i440fx-rhel7.0.0 240 <nil>} {rhel6.3.0 240 <nil>} {rhel6.4.0 240 <nil>} {rhel6.0.0 240 <nil>} {pc-i440fx-rhel7.1.0 240 <nil>} {pc-i440fx-rhel7.2.0 240 <nil>} {pc-q35-rhel7.3.0 255 <nil>} {rhel6.5.0 240 <nil>} {pc-q35-rhel7.4.0 384 <nil>} {q35 384 0xc4204d7010} {rhel6.6.0 240 <nil>} {rhel6.1.0 240 <nil>} {rhel6.2.0 240 <nil>} {pc-i440fx-rhel7.3.0 240 <nil>}]}]} 0xc4204d7020} {hvm {xtensa 32 /usr/bin/qemu-system-xtensa [{sim 4 <nil>} {lx60 4 <nil>} {kc705 4 <nil>} {ml605 4 <nil>} {lx200 4 <nil>}] [{qemu  []}]} 0xc4204d7030} {hvm {xtensaeb 32 /usr/bin/qemu-system-xtensaeb [{sim 4 <nil>} {kc705 4 <nil>} {ml605 4 <nil>} {lx200 4 <nil>} {lx60 4 <nil>}] [{qemu  []}]} 0xc4204d7040}]}

Version Reports:

Distro version of host:

Centos7

Terraform Version Report

Terraform v0.11.7

Libvirt version

3.2.0

terraform-provider-libvirt plugin version (git-hash)commit 5d724d3f761c2b5af7a652fdfd38a853548dc474


Description of Issue/Question

Setup

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)



provider "libvirt"{
    uri = "qemu+ssh://[email protected]/system"
}

resource "libvirt_volume" "centos-img" {
  name = "centos-img-qcow2"
  pool = "vm-images"
  source = "/srv/images/CentOS-7-x86_64-GenericCloud.qcow2"
  format = "qcow2"
}

resource "libvirt_volume" "volume" {
  name = "minioroot-${count.index}"
  pool = "vm-images"
  base_volume_id = "${libvirt_volume.centos-img.id}"
  count = 4
}

resource "libvirt_network" "minio-net" {
   name = "minio-net"
   addresses = ["10.21.1.0/24"]
}

resource "libvirt_volume" "minio-vol" {
  pool = "vm-images"
  name = "minio-vol"
  format = "qcow2"
  size = 536870912000
}

resource "libvirt_volume" "disk-volume" {
  name = "minio-volume-${count.index}"
  pool = "vm-images"
  base_volume_id = "${libvirt_volume.minio-vol.id}"
  count = 4
}
resource "libvirt_cloudinit" "commoninit" {
   name = "commoninit.iso"
   pool = "vm-images"
   ssh_authorized_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkhNFlLNTzMyr2gq7W4lT6gA8IbbdI9YiIKrH8hTspttRkwYItR................. terra@kvm"
}

resource "libvirt_domain" "minio" {

  name = "minio_${count.index}"
  memory = "2048"
  vcpu = 1

  cloudinit = "${libvirt_cloudinit.commoninit.id}"

  network_interface {
     network_id = "${libvirt_network.minio-net.id}"
     addresses = ["10.21.1.${count.index+2}"]
     wait_for_lease = 1
  }

  network_interface {
     bridge = "br0"
  }

  console {
    type        = "pty"
    target_port = "0"
    target_type = "serial"
  }
  disk {
    volume_id = "${element(libvirt_volume.volume.*.id, count.index)}"
  }
  disk {
    volume_id = "${element(libvirt_volume.disk-volume.*.id, count.index)}"
  }
  count = 4
}
libvirt bug need info

Most helpful comment

I think we can close this issue. Now we are using the centos7 with newer version of provider, and we dont have any problems

All 13 comments

KVM host virsh capabilities

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine maxCpus='255'>pc-i440fx-2.0</machine>
      <machine canonical='pc-i440fx-2.0' maxCpus='255'>pc</machine>
      <machine maxCpus='255'>pc-1.3</machine>
      <machine maxCpus='255'>pc-0.12</machine>
      <machine maxCpus='255'>pc-q35-1.6</machine>
      <machine maxCpus='255'>pc-q35-1.5</machine>
      <machine maxCpus='255'>pc-i440fx-1.6</machine>
      <machine maxCpus='255'>pc-i440fx-1.7</machine>
      <machine maxCpus='255'>pc-0.11</machine>
      <machine maxCpus='255'>pc-1.2</machine>
      <machine maxCpus='255'>pc-0.10</machine>
      <machine maxCpus='1'>isapc</machine>
      <machine maxCpus='255'>pc-q35-1.4</machine>
      <machine maxCpus='255'>pc-0.15</machine>
      <machine maxCpus='255'>pc-0.14</machine>
      <machine maxCpus='255'>pc-i440fx-1.5</machine>
      <machine maxCpus='255'>pc-i440fx-1.4</machine>
      <machine maxCpus='255'>pc-q35-2.0</machine>
      <machine canonical='pc-q35-2.0' maxCpus='255'>q35</machine>
      <machine maxCpus='255'>pc-1.1</machine>
      <machine maxCpus='255'>pc-q35-1.7</machine>
      <machine maxCpus='255'>pc-1.0</machine>
      <machine maxCpus='255'>pc-0.13</machine>
      <domain type='qemu'/>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
        <machine maxCpus='240'>pc-i440fx-rhel7.4.0</machine>
        <machine canonical='pc-i440fx-rhel7.4.0' maxCpus='240'>pc</machine>
        <machine maxCpus='240'>pc-i440fx-rhel7.0.0</machine>
        <machine maxCpus='240'>rhel6.3.0</machine>
        <machine maxCpus='240'>rhel6.4.0</machine>
        <machine maxCpus='240'>rhel6.0.0</machine>
        <machine maxCpus='240'>pc-i440fx-rhel7.1.0</machine>
        <machine maxCpus='240'>pc-i440fx-rhel7.2.0</machine>
        <machine maxCpus='255'>pc-q35-rhel7.3.0</machine>
        <machine maxCpus='240'>rhel6.5.0</machine>
        <machine maxCpus='384'>pc-q35-rhel7.4.0</machine>
        <machine canonical='pc-q35-rhel7.4.0' maxCpus='384'>q35</machine>
        <machine maxCpus='240'>rhel6.6.0</machine>
        <machine maxCpus='240'>rhel6.1.0</machine>
        <machine maxCpus='240'>rhel6.2.0</machine>
        <machine maxCpus='240'>pc-i440fx-rhel7.3.0</machine>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <disksnapshot default='on' toggle='no'/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

I think this is caused by xml structure of domain:

here is detailed information:
There can be zero or more /guest/arch/machine elements that describe the default types of machines that this guest emulator can emulate. These "machines" typically represent the ABI or hardware interface that a guest can be started with. Note that these machine types can be overridden by the /guest/arch/domain/machine elements (described below) for virtualization technologies that provide alternate machine types. Typical values for this are "pc", and "isapc", meaning a regular PCI based PC, and an older, ISA based PC, respectively.

Same issue, how can I avoid it.

Yes, I have this as well.

For me yum remove qemu-system-x86 helped (leaving qmeu-kvm installed). Though, this broke packer.

i will have a look once i have free time

Do you have this issue only with the centos7 kvm host?

Do you have this issue only with the centos7 kvm host?

I faced this issue only with centos7

@samlabs821 ok thx for info. i remember that i used the centos-image days ago on LEAP15.

At moment to me seem more a libvirt/qemu issue on centos7 KVM-host you are deploying.

From my side i will try to reproduce locally with your image posted, and let you know.

You could try to update your libvirt-pkg and provider and let me know? this would help

# ./terraform-provider-libvirt -version
Compiled against library: libvirt 4.4.0
Using library: libvirt 4.4.0
Running hypervisor: QEMU 3.0.0
Running against daemon: 4.4.0

@samlabs821 so i have a centos7 img with the provider. (kvm host leap15 see https://github.com/dmacvicar/terraform-provider-libvirt/issues/297#issuecomment-431337624)

@ianabc are you running also centos7 ? which pkg do you have installed?

to me seems more a pkg issues on the centos7 side, regarding libvirt components, otherwise i would reproduce it on openSUSE leap15

It might be worth to update with newer pkgs

Maybe some kind of misconfiguration
see:

For me yum remove qemu-system-x86 helped (leaving qmeu-kvm installed). Though, this broke packer.

I think we can close this issue. Now we are using the centos7 with newer version of provider, and we dont have any problems

@samlabs821 ok i close it then. thank you for your time, and feel free to open others, ask question or contribute or hack around ! :+1:

Ciao and thank you!

Was this page helpful?
0 / 5 - 0 ratings