Commit Graph

784 Commits

Author SHA1 Message Date
Dmitry Vasilets
b4a5f2c039 rescue if version of box not defined 2015-04-06 09:15:17 +02:00
Dmitry Vasilets
605498ce2e Merge pull request #294 from dennisklein/honor_box_version
honor the vagrant box version
2015-04-06 09:13:35 +02:00
dima
7a7844f773 close #291 2015-04-04 22:29:21 +02:00
dima
348e66d6f3 Merge branch 'bug/multiple-disks-in-different-provider-calls'
Conflicts:
	lib/vagrant-libvirt/config.rb
2015-04-02 13:30:07 +02:00
Erik van Pienbroek
ce75b9a02e Allow the situation where DHCP is not requested but where it is enabled on the virtual network 2015-04-02 13:12:05 +02:00
dima
3f52dac06d Merge branch 'master' of github.com:pradels/vagrant-libvirt 2015-04-01 09:42:59 +02:00
dima
e45e31fc12 check image file close #320 2015-04-01 09:42:43 +02:00
Dmitry Vasilets
47950170bb Merge pull request #319 from ldx/os-type-attrs
Add 'machine_type' parameter.
2015-03-26 08:15:26 +01:00
dima
c881f98079 support keymap settings close #326 2015-03-26 08:07:27 +01:00
sathlan
ea5d474e0d Multiple disks in different provider call fails.
This

```ruby
Vagrant.configure("2") do |c|
  c.vm.box = "centos-7.0"
  c.vm.hostname = "default-centos-70.vagrantup.com"
  c.vm.provider :libvirt do |p|
    p.storage :file, :size => "5M", :path => "vagrant_vdb.qcow2", :device => "vdb"
    p.storage :file, :size => "5M", :path => "vagrant_vdc.qcow2", :device => "vdc"
  end
end
```

works.

But this fails:

```ruby
def add_block_device(node, port, size)
  node.vm.provider 'libvirt' do |lv|
    port_name = ('b'..'z').to_a[port-1]
    lv.storage :file, :size => "#{size}M", :path => "vagrant_#{node.vm.hostname}_vd#{port_name}.qcow2", :device => "vd#{port_name}"
  end
end

Vagrant.configure("2") do |c|
  c.vm.box = "centos-7.0"
  c.vm.hostname = "default-centos-70.vagrantup.com"
  add_block_device(c, 1, 5)
  add_block_device(c, 2, 5)
end
```

In the second case only the last disk is added:

```
==> default:  -- Disks:         vdc(qcow2,5M)
==> default:  -- Disk(vdc):     /var/lib/libvirt/images/vagrant_default-centos-70.vagrantup.com_vdc.qcow2
```

This patch corrects this.  It is done as the `customize` configuration
is the vagrant code.
2015-03-20 19:50:10 -04:00
Brian Pitts
ac3582ae53 Update version to 0.0.25 2015-03-03 21:44:42 -06:00
Vilmos Nebehaj
b51b563c46 Add 'machine_type' parameter.
This parameter will be used by libvirt to set the machine type qemu will
use.  For example, setting it to `pc-1.0` will generate this `os`
definition:

    <os>
      <type arch='x86_64' machine='pc-1.0'>hvm</type>
    </os>
2015-03-02 17:44:01 +01:00
Federico Castagnini
34095882db Sanitize memory and cpu (Fix #313) 2015-02-23 12:36:11 -05:00
Kaushal M
06515b87f3 Use just awk to parse /proc/net/arp 2015-02-04 21:05:40 +05:30
Kaushal M
d7da89db92 Use grep /proc/net/arp instead of the arp command ...
... and use awk instead of cut
2015-02-02 08:58:58 +05:30
Kaushal M
267de056bf Use a version agnostic ip_command
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
2015-01-28 11:33:15 +05:30
Dennis Klein
d0ea35fc88 honor the vagrant box version
As discussed in #85 vagrant-libvirt's image management could
be better. This is only addressing a small aspect of the topic,
but due to its simplicity it could improve vagrant-libvirt in the
meantime until #85 is fully resolved.
2015-01-16 20:15:00 +01:00
Pradipta Kr. Banerjee
540d0a2ee5 Add multi-arch support
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
2014-12-15 22:48:30 +05:30
Brian Pitts
338c486862 Merge pull request #281 from sciurus/fix/lock-pool-creation
Fixes for storage pool creation and base box uploads
2014-12-15 10:20:17 -06:00
Thomas Krille
db7b056931 support use_dhcp_assigned_default_route
Closes #230
2014-12-11 23:03:40 +01:00
Brian Pitts
0da3b232b3 Add lock around base box upload
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.
2014-12-07 16:30:35 -06:00
Brian Pitts
8df13baade Change libvirt method for creating storage pool
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
2014-12-07 14:25:54 -06:00
Brian Pitts
47a21433a5 Add lock around storage pool creation; closes #278 2014-12-07 12:16:05 -06:00
Brian Pitts
916ec6798f Fix indendation 2014-12-07 12:15:46 -06:00
dima
5a73bc075d update version to 0.0.24 2014-12-04 11:11:59 +01:00
dima
8c10fd1a21 Merge branch 'disk-path' of git://github.com/sciurus/vagrant-libvirt 2014-12-04 10:10:56 +01:00
Eohyung Lee
9958e9b915 Support open vSwitch bridge device 2014-11-19 14:22:41 +09:00
Brian Pitts
a5b5e3e800 Do not chance disk path
Mutating path caused vagrant to constatnyl spew errors from #validate
while waiting for ssh to be available. Instead, create a new key.
2014-11-17 22:47:32 -06:00
Brian Pitts
f39797fa6a Check for absolute disk path in #validate 2014-11-17 22:29:29 -06:00
Brian Pitts
086f66dcb2 Merge branch 'master' into bp-disk-path 2014-11-17 21:21:06 -06:00
Brian Pitts
803719d3f6 Fix port forwarding ssh process cleanup
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
2014-11-01 18:54:37 -05:00
Brian Pitts
9e0f0de35e Merge pull request #264 from aspiers/ssh-forward-logging
fix redirection of STDOUT/ERR of ssh port forwarding process (#226)
2014-11-01 18:19:58 -05:00
Brian Pitts
42b9a6364e Merge remote-tracking branch 'upstream/master' into additional_disks_bus
Conflicts:
	README.md
	lib/vagrant-libvirt/config.rb
2014-11-01 17:41:52 -05:00
Adam Spiers
60786e18b5 allow preexisting disk volumes via new option 2014-11-01 22:29:03 +00:00
Brian Pitts
5be5faf294 Merge pull request #263 from aspiers/extra-storage-cache-mode
allow cache mode to be set for additional disks
2014-11-01 17:24:16 -05:00
Adam Spiers
8f6e2326c8 honour path parameter of storage directive
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.
2014-11-01 17:52:46 +00:00
Vil Surkin
6659f4c687 added ability to specify bus for additional disks 2014-10-28 21:31:06 +02:00
Adam Spiers
1f9c7a70ce fix redirection of STDOUT/ERR of ssh port forwarding process (#226)
The existing invocation fails to spawn correctly, and even if that
were the case, redirecting STDOUT/STDERR to /dev/null risks losing
valuable debug, as seen in #225.

Closes #226.

https://github.com/pradels/vagrant-libvirt/issues/226
2014-10-27 10:44:18 +00:00
Adam Spiers
7b38af568c allow cache mode to be set for additional disks 2014-10-26 23:57:11 +00:00
Adam Spiers
e693b017dd don't monkey-patch #default_provider
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.
2014-10-25 14:36:46 +01:00
Adam Spiers
78d033d6c7 remove pry debug 2014-10-16 01:59:46 +01:00
Thomas Boerger
e2fe68768f Replaced a puts with logger 2014-10-08 09:43:21 +02:00
dima
7ec27dd121 0.0.23 2014-10-07 14:40:28 +02:00
Dennis Klein
0dcef5c312 condition for setting default value was wrong
This caused an error:
Error occured while creating new network: Call to virNetworkDefineXML failed: (network_definition):5: Unescaped '<' not allowed in attributes values
  <forward mode="#<Object:0x000000020bb1a0>" />
2014-09-30 20:15:41 +02:00
dima
94a2c675f7 add graphics password 2014-09-29 08:31:23 +02:00
dima
fea98293c2 0.0.22 2014-09-28 22:58:59 +02:00
Brian Pitts
e693e82ed2 Provider does not need to set username
If the user sets this themselves, vagrant will pick it up. If the user
does not set it, vagrant will set a default. All this works without any
code on our end.
2014-09-28 14:49:37 -05:00
Dmitry Vasilets
bb383e7921 Merge pull request #239 from theonewolf/custom-vnc-ports
templatized handling of graphics and video libvirt XML
2014-09-28 17:07:04 +02:00
Wolfgang Richter
17d9850684 automatically set autoport to properly support legacy behavior 2014-09-28 11:00:39 -04:00
Dmitry Vasilets
44951a1f17 Merge pull request #217 from sstrato/add_management_network_mode
add management network mode selection
2014-09-28 16:19:57 +02:00