Notes vagrant

Install du module pour KVM/Libvirt
Voir https://github.com/vagrant-libvirt/vagrant-libvirt

sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev vagrant plugin install vagrant-libvirt

Test avec CentOS7

vagrant init centos/7 # Semble être ignoré. ''--provider=libvirt'' Nécessaire #export VAGRANT_DEFAULT_PROVIDER=libvirt export LIBVIRT_DEFAULT_URI="qemu:///system" vagrant up --provider=libvirt

Pb

vagrant up --provider=libvirt

Bringing machine 'default' up with 'libvirt' provider...
/home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:32:in `info': Call to virStorageVolGetInfo failed: Storage volume not found: no storage vol with matching path '/tmp/systemd-private-04e45e030a974efa97ce503d7fb920ce-cups.service-AQNzoq' (Libvirt::RetrieveError)
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:32:in `volume_to_attributes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:10:in `block (2 levels) in list_volumes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:9:in `each'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:9:in `block in list_volumes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:44:in `block in raw_volumes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:42:in `each'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:42:in `raw_volumes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/list_volumes.rb:8:in `list_volumes'
from /home/jean/.vagrant.d/gems/gems/fog-libvirt-0.0.3/lib/fog/libvirt/models/compute/volumes.rb:11:in `all'
from /home/jean/.vagrant.d/gems/gems/vagrant-libvirt-0.0.33/lib/vagrant-libvirt/action/handle_box_image.rb:63:in `block in call'
from /home/jean/.vagrant.d/gems/gems/vagrant-libvirt-0.0.33/lib/vagrant-libvirt/action/handle_box_image.rb:60:in `synchronize'
from /home/jean/.vagrant.d/gems/gems/vagrant-libvirt-0.0.33/lib/vagrant-libvirt/action/handle_box_image.rb:60:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builtin/handle_box.rb:56:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /home/jean/.vagrant.d/gems/gems/vagrant-libvirt-0.0.33/lib/vagrant-libvirt/action/handle_storage_pool.rb:50:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /home/jean/.vagrant.d/gems/gems/vagrant-libvirt-0.0.33/lib/vagrant-libvirt/action/set_name_of_domain.rb:35:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:95:in `block in finalize_action'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builtin/call.rb:53:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builtin/config_validate.rb:25:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:196:in `action_raw'
from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:173:in `block in action'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:440:in `lock'
from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:161:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:161:in `action'
from /usr/lib/ruby/vendor_ruby/vagrant/batch_action.rb:82:in `block (2 levels) in run'

Solution

https://kushaldas.in/posts/storage-volume-error-in-libvirt-with-vagrant.html

virsh pool-list

Name State Autostart
-------------------------------------------
default active yes
presseed active yes
tmp active yes

virsh pool-refresh tmp virsh pool-refresh default

Connexion à la machine

vagrant ssh-config >> ~/.ssh/config