-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError during 'vagrant up' #161
Comments
Resolved by adding some missing defines in ruby-libvirtd and rebuilding it |
@Dantix - Can you please share your solution with us? I ran into the same problem in Arch Linux. Thanks! |
@tatsuya6502, I have patched vagrant's copy of ruby-libvirt, but now I know that there is no real need in it. You can install "ruby-libvirt" package from AUR and replace vagrant's ruby-libvirt with it.
Vagrant's copy can be found here - ~/.vagrant.d/gems/gems |
@Dantix, thanks a lot! It solved the problem. It seems AUR is just a plain ruby-libvirt 0.5.2 (PKGBUILD), so I think we will need ruby-libvirt 0.5.2 on any Linux distributions to run vagrant-kvm against the latest libvirtd (1.2.1).
|
We are planed to keep ruby-libvirt 0.4.0 in release 0.1.5, and update it to 0.5.2 in vagrant-kvm 0.1.6 and after. I've already used ruby-libvirt 0.5.2, and it works fine in my development tree(https://github.com/miurahr/vagrant-kvm/tree/next) for 0.1.6. It may be necessary to prepare a test environment for ArchLinux. |
Thanks, but I think we don't have to rush this. At this moment, this only seem to affect Arch Linux who has a newer version of libvirt. And this one is easy to fix at user side. I would prefer to have vagrant-kvm 0.1.5 released very soon (without upgrading ruby-libvirt to 0.5.2), because 0.1.4 does not support latest Vagrant 1.4.x (#158). I think #158 has more impact to users than this. |
Now you can test with master HEAD, 0.1.6dev, that is using ruby-libvirt 0.5.2. |
Need some document for Arch user. |
@miurahr - Thanks. I'm playing with Veewee now for creating an Arch box. Once I'm done with it, I can test 0.1.6-dev. Also, I'm thinking to contribute a Vagrantfile for the Arch box that acts as a vagrant-kvm host (like the ones for Ubuntu and Fedora under the spec directory) so that anyone can test it. |
I could work on that. What kind of docs do you need? |
It is worth providing to users. Arch use it. Ubuntu Trusty(14.04) also bundle libvirt 1.2.1. or consult work around with vagrant-kvm 0.1.5.x. such as downloading source, edit gemspec, build gem and install using local build package. |
sorry ubuntu trusty use libvirt 1.2.2. |
OK. Got it. A quick update -- I tried vagrant-kvm 0.1.6.dev on Arch Linux but the problem remains. So this should not be a ruby-libvirt version issue but would be an Arch specific installation issue. More on next comment. |
I used Veewee to create an Arch base box with the latest packages and tested vagrant-kvm 0.1.6.dev on that virtual machine (nested KVM). Like Ubuntu 14.04 beta, libvirt version was 1.2.2 and I verified that vagrant-kvm installed ruby-libvirt 0.5.2 under But I was surprised because this does not solve the problem in the first comment. So this does not seem a ruby-libvirt version issue (0.4.0 vs 0.5.2) anymore. (Although we still need to check whether vagrant-kvm 0.1.5 with ruby-libvirt 0.4.0 works on Ubuntu 14.04 with libvirt 1.2.2 or not.) Then I installed ruby-libvirt package from AUR (Arch User Repository) and compared its contents against the one installed by vagrant-kvm. I found that ruby-libvirt 0.5.2 installed by vagrant-kvm [vagrant@default ~]$ grep ACTIVE ~/.vagrant.d/gems/gems/ruby-libvirt-0.5.2/ext/libvirt/extconf.h
#define HAVE_CONST_VIR_INTERFACE_XML_INACTIVE 1
#define HAVE_CONST_VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE 1
#define HAVE_CONST_VIR_NETWORK_XML_INACTIVE 1
#define HAVE_CONST_VIR_STORAGE_XML_INACTIVE 1 ruby-libvirt 0.5.2 from AUR [vagrant@default ~]$ grep ACTIVE /lib/ruby/gems/2.1.0/gems/ruby-libvirt-0.5.2/ext/libvirt/extconf.h
#define HAVE_VIRSTORAGEPOOLISACTIVE 1
#define HAVE_VIRNETWORKISACTIVE 1
#define HAVE_VIRINTERFACEISACTIVE 1
#define HAVE_VIRDOMAINISACTIVE 1
#define HAVE_CONST_VIR_INTERFACE_XML_INACTIVE 1
#define HAVE_CONST_VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE 1
#define HAVE_CONST_VIR_NETWORK_XML_INACTIVE 1
#define HAVE_CONST_VIR_STORAGE_XML_INACTIVE 1
When I installed vagrant-kvm, I added
I will look into this issue, and try to figure out the root cause and a solution. Also if anybody could test the current release version vagrant-kvm 0.1.5 against Ubuntu 14.04 beta, that would be great. |
Have to take a closer look at this. It will explain how |
Here is what is happening on Arch Linux. libvirt (installed via pacman) is built against the system curl library, but vagrant is trying to use the embedded curl library in If I try to install vagrant-kvm with this command,
building ruby-libvirt will fail at
If I try to install vagrant-kvm with this command,
building ruby-libvirt will not fail but mkmf
I have not figured out how to make the embedded ruby-libvirt to refer to the system curl library. So for now, workarounds would be:
|
No volunteers? |
Will do in few hours UPD: Seems like "not today" |
@Dantix - Thank you! |
I tested Vagrant 1.5.2 + vagrant-kvm 0.1.6 against Ubuntu 14.04 beta 2, and verified it worked. So this is an Arch Linux specific issue and the workarounds on this comment should work. @miurahr, @adrahon please close this issue. I will get the workarounds documented in the Wiki (not Arch Wiki but vagrant-kvm Wiki). Tested Version:
Result:
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ uname -a
Linux vagkvm-u2 3.13.0-23-generic #45-Ubuntu SMP Fri Apr 4 06:58:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu Trusty Tahr (development branch)"
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ libvirtd -V
libvirtd (libvirt) 1.2.2
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant -v
Vagrant 1.5.2
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant plugin list
vagrant-kvm (0.1.6)
vagrant-login (1.0.1, system)
vagrant-share (1.0.1, system) tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant up --provider=kvm
Bringing machine 'default' up with 'kvm' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
VagrantPlugins::ProviderKvm::Config:
* The following settings shouldn't exist: memory
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vi Vagrantfile
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ git diff
diff --git a/spec/fedora/Vagrantfile b/spec/fedora/Vagrantfile
index 19b7ccd..7c5dd5d 100644
--- a/spec/fedora/Vagrantfile
+++ b/spec/fedora/Vagrantfile
@@ -1,7 +1,7 @@
Vagrant.configure('2') do |config|
config.vm.provider :kvm do |kvm, override|
kvm.gui = true
- kvm.memory = '512MB'
+ # kvm.memory = '512MB'
override.vm.box = 'fedora19'
override.vm.box_url = 'https://vagrant-kvm-boxes.s3.amazonaws.com/fedora19-amd64-kvm.box'
end
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant up --provider=kvm
Bringing machine 'default' up with 'kvm' provider...
==> default: Importing base box 'fedora19'...
/home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/driver/driver.rb:105:in `create_volume': undefined method `create_volume_xml' for nil:NilClass (NoMethodError)
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/import.rb:111:in `import_volume'
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/import.rb:57:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/set_name.rb:25:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builtin/call.rb:51:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/init_storage_pool.rb:16:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/set_name.rb:25:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /home/tatsuya/.vagrant.d/gems/gems/vagrant-kvm-0.1.6/lib/vagrant-kvm/action/check_kvm.rb:18:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/machine.rb:157:in `action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/batch_action.rb:72:in `block (2 levels) in run'
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant up --provider=kvm
Bringing machine 'default' up with 'kvm' provider...
==> default: Importing base box 'fedora19'...
==> default: Matching MAC address for NAT networking...
==> default: Preparing network interfaces based on configuration...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.123.10:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
...
default: Warning: Host unreachable. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant halt
==> default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM...
[sudo] password for tatsuya:
tatsuya@vagkvm-u2:~/vagrant-kvm/spec/fedora$ vagrant up
Bringing machine 'default' up with 'kvm' provider...
==> default: Preparing network interfaces based on configuration...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.123.10:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
default: Warning: Host unreachable. Retrying...
==> default: Machine booted and ready!
==> default: Creating shared folders metadata...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
nfsd not running
* Exporting directories for NFS kernel daemon... [ OK ]
* Starting NFS kernel daemon [ OK ]
==> default: Mounting NFS shared folders...
==> default: Running provisioner: shell...
default: Running: inline script
++ sudo yum install -y libvirt-daemon-kvm.x86_64 |
Confirmed close it. |
Well, I looked up in documentation - there is such method. So I wrote simple script
I've run it with my system ruby and it printed "true" as it should. My pool configuration looks like this:
Any suggestions how to make it work?
The text was updated successfully, but these errors were encountered: