vagrant-libvirt: Cannot undefine domain with nvram attached: Call to virDomainUndefineFlags failed:

hi,

attempting to get windows 11 going (sight), it needs to use UEFI. While that works nicely on debian, it seems i need to use nvram settings on centos8* hosts, unfortunately, i cant undefine a virtual machine if nvram setting is active:

`/home/buildtest/.vagrant.d/gems/2.6.6/gems/fog-libvirt-0.9.0/lib/fog/libvirt/requests/compute/vm_action.rb:7:in `undefine': Call to virDomainUndefineFlags failed: Requested operation is not valid: cannot undefine domain with nvram (Libvirt::Error

Example vagrant file settings:


        domain.loader = "/usr/share/OVMF/OVMF_CODE.secboot.fd"
        domain.nvram = true

Guess thats an issue in fog-libvirt, not setting VIR_DOMAIN_UNDEFINE_NVRAM flag while callling virDomainUndefine

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’d like to mention that fog-libvirt mentioned here has been merged.

Looking forward to get nvram support on aarch64!

@LKHN https://github.com/fog/fog-libvirt/compare/v0.9.0...master shows that the upstream change has merged but not yet been released. I’ll poke the devs to see if they would release what is there. The code in 0.10.8 will pass the flags required if the API accepts it so it will just start working once there is a release of fog-libvirt

#1329 will be available from the next release, but it’ll depend on releases from the two upstream projects before the support is enabled. Just won’t need another release of this project in addition as it’ll automatically pick up the newer API is available.

I think I know what the problem is. The start domain action was improved to detect when the nvram setting has changed or should be unset, and is trying to then undefine the domain to undo the changes you’ve made.

Realistically need to push of getting a fix landed in fog-libvirt