With libvirt-1.2.11, libvirt no longer uses lease files for dnsmasq,
which makes the existing method of fetching the ip of a vm incorrect.
This change introduces a version agnostic method to get the IP of VM
using arp cache instead.
Fixes#298
Currently the domain template as defined in domain.xml.erb hard-codes the arch
attribute under OS tag to x86_64. This is really not required since the
'arch' attribute is automatically populated by libvirt
<type arch='x86_64'>hvm</type>
This prevents using this plugin to manage non-x86_64 architecture like
Power(ppc64) and Arm.
This patch removes the 'arch' attribute from the domain template
I'm not entirely happy with this, because we only really need a lock
when multiple VMs are using the same base box. If they are using
different boxes, we could safely upload in parallel. I did not see an
obvious way to implement that, so this will work. Parallel uploads are
likely not a performance improvement, anyway.
We should use define_storage pool_xml instead of create_storage_pool_xml
so that
* the pool is permanent
* pool creation succeeds if the directory does not already exist
The presence of quotes in the command to spawn caused ruby to run it via
a shell instead of running it directly. This broke our code for
killing the ssh processes when the VM is halted.
Closes#265
Fix use of the `:path` parameter to the `storage` directive:
config.vm.provider :libvirt do |libvirt|
libvirt.storage :file, :path => 'my-disk.qcow2'
end
The value of the `:path` parameter was being correctly used in
`domain.xml.erb` for defining the VM, but it was not passed to libvirt
via fog's volume creation mechanism:
lib/fog/libvirt/models/compute/templates/volume.xml.erb
Instead, libvirt determines the backing file from the `<name>` element,
so we ensure that the `:name` parameter contains the correct filename.
As per #158, vagrant-libvirt depends on ruby-libvirt transitively
through fog. Since fog/fog#2706 was resolved, fog now requires
ruby-libvirt ~> 0.5.0, therefore vagrant-libvirt should allow both 0.4.x
and 0.5.x. Furthermore, according to semantic versioning, we currently
have no good reason to reject anything newer below 1.x. If such a
restriction is required in the future (e.g. < 0.7.0) then it is likely
that fog's .gemspec will take care of that on our behalf anyway.
Closes#158.
This monkey-patching of Vagrant::Environment#default_provider breaks
with Vagrant 1.7.0, since the method's signature changed. In any case
Vagrant should do the right thing without "help" from vagrant-libvirt.