Open voroskoi opened 1 year ago
I am stuck here as well. I have added the section below and still get the same error. I've even tried running from x86_64 and aarch64 terraform host.
nvram { file = "/usr/share/AAVMF/AAVMF_VARS.fd" }
I've also tried using the AAVMF_VARS.{ms,snakeoil}.fd files
OK, I think I know what's going on, but don't know how to fix it yet. Since we're passing the values, the generated file for qemu should not have "firmware = efi" in it. This needs to be removed. I'm looking in to how to do that.
So it seems that for now, you have to specify nvram and firmware settings, and remove the "d.OS.Firmware = "efi"" from domain_def.go. This gets past this issue, and brings up another issue where devices are not properly getting
set, so virsh is throwing an error.I'm also investigating... setting "efi" should pick up the right values, so I'm looking into that as well.
OK, so here's progress so far.
Copy /usr/share/AAVMF/AAVMF_VARS.fd to /var/lib/libvirt/qemu/nvram/
So I think the thing to do is have nvram provide a template and a destination, generate the file and put it in the correct spot. I"m going to look through the code and see if I can figure out where that could/should happen. It seems some of this stuff is buried in go bindings, so I'll have to figure that out, too as I've written exactly 1 simple go program in my life.
something like
`firmware = "/usr/share/AAVMF/AAVMF_CODE.fd"
nvram { template="/usr/share/AAVMF/AAVMF_VARS.df" file="/var/lib/libvirt/qemu/nvram/hostname_VARS.fd" }`
file should default to the above and only need to be specified if it should be someplace else.
For now I added the following in my terraform file:
resource "null_resource" "copy_nvram" { provisioner "local-exec" {command = "scp -p VARS.fd root@${var.kvmhost}:/var/lib/libvirt/qemu/nvram/${var.hostname}_VARS.fd"} }
and this does the trick. I now have an aarch64 machine installing from terraform.
System Information
Linux distribution
Terraform version
Provider and libvirt versions
Description of Issue/Question
This is the first time I try using terraform, thank You very much for this provider! I would like to create a simple VM image, my
main.tf
is below.I get the following error message:
Without the
firmware = "/usr/share/AAVMF/AAVMF_CODE.fd"
line I get this error message: (I have to keep increasing the counter inname
to avoid hittingdomain already exists
error.)I have checked the examples here, maybe I should define the
nvram
, but I have no idea where those values come from.Setup
Steps to Reproduce Issue
run
terraform apply
Additional information:
I do not have neither AppArmor, nor SELinux installed. Iptables not running.