vagrant-libvirt: VM creation fails 2nd time

Steps to reproduce

  1. vagrant up
  2. vagrant destroy
  3. vagrant up

Expected behaviour

VM properly setup, with SSH and internet connectivity.

Actual behaviour

VM only works 1st time, not 2nd.

Workaround 1: logout, login. Then it works again 1st time.

Workaround 2: randomize vm name, because it works always the 1st time per vm name.

System configuration

OS/Distro version:: Fedora 34 Silverblue.

Libvirt version: libvirt-daemon-7.0.0-6.fc34.x86_64

Output of vagrant version; vagrant plugin list: Installed Version: 2.2.16

Vagrant was unable to check for the latest version of Vagrant. Please check manually at https://www.vagrantup.com vagrant-libvirt (0.5.3, system)

Attach Output of VAGRANT_LOG=debug vagrant ... --provider=libvirt >vagrant.log 2>&1

up-destroy-up.log

A Vagrantfile to reproduce the issue:

Vagrant.configure('2') do |config|
  if Vagrant.has_plugin?('vagrant-cachier')
    
    config.cache.scope = 'machine'
    
  end

  config.vm.define "server0" do |c|
    ##
    # Box definition
    ##
    c.vm.box = "generic/ubuntu2004"
    
    ##
    # Config options
    ##
    c.vm.synced_folder ".", "/vagrant", disabled: true
    c.ssh.insert_key = true
    c.vm.hostname = "server0"

    ##
    # Network
    ##
    
    c.vm.network "public_network", dev: "virbr0", mode: "bridge", type: "bridge"
    
    ##
    # Provider
    ##
    c.vm.provider "libvirt" do |libvirt, override|
      libvirt.memory = 512
      libvirt.cpus = 2
      libvirt.management_network_autostart = true
      libvirt.management_network_mode = "open"
      libvirt.qemu_use_session = true
    end
  end
end

Are you using upstream vagrant package or your distros package? Distro

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Ah sorry, I went looking into the wrong commits and found them untagged. cc @joao-p-marques