adrahon / vagrant-kvm

This project is dead, please use vagrant-libvirt instead! A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant to control and provision KVM/QEMU VM.
MIT License
366 stars 60 forks source link

Fails to bring up new machine after updating to 0.1.9 #264

Open vdloo opened 9 years ago

vdloo commented 9 years ago

There seems to be some kind of routing issue that appeared in the current version, running 'vagrant up' on a new box after updating to 0.1.9 results in an unreachable host. I figured the problem might be in the /etc/libvirt/qemu/networks/vagrant.xml file but after rolling back to 0.1.8 I noticed that the ip in the host entry line previously didn't match the ip address that vagrant tries to ssh to, yet it did succeed in connecting. Now after updating it fails to connect but the host entry seems to be the same as the address vagrant tries to connect to.

So while the host in the vagrant.xml using the 0.1.8 version was the following

<host mac='52:54:00:22:db:1f' name='nic-1413059632' ip='192.168.123.214'/>

vagrant succeeded in connecting using ssh to 192.168.123.7:22. Yet now in the updated version the host entry is the same as the address vagrant tries to ssh to, but it isn't able to connect.

vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant up
Bringing machine 'default' up with 'kvm' provider...
==> default: Importing base box 'CentOSLAMPstag64'...
==> 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.7:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Host unreachable. Retrying...
==> default: Machine booted and ready!
==> default: Creating shared folders metadata...
==> default: Forwarding ports...
==> default: 80 => 9080 (adapter eth0)
==> default: mounting p9 share in guest
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant destroy -f
==> default: Clearing any previously set forwarded ports...
==> default: Forcing shutdown of VM...
[sudo] password for vdloo:
==> default: Destroying VM and associated drives...
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ rm -R .vagrant/
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant plugin list
vagrant-kvm (0.1.8)
  - Version Constraint: 0.1.8
vagrant-login (1.0.1, system)
vagrant-mutate (0.3.1)
vagrant-share (1.1.2, system)
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant plugin install vagrant-kvm --plugin-version 0.1.9
Installing the 'vagrant-kvm --version '0.1.9'' plugin. This can take a few minutes...
Installed the plugin 'vagrant-kvm (0.1.9)'!
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant plugin list
vagrant-kvm (0.1.9)
  - Version Constraint: 0.1.9
vagrant-login (1.0.1, system)
vagrant-mutate (0.3.1)
vagrant-share (1.1.2, system)
vdloo@hypervisor1:~/code/configs/vagrantfiles/LAMP_CentOS_x86_64/staging$ vagrant up
Bringing machine 'default' up with 'kvm' provider...
==> default: Importing base box 'CentOSLAMPstag64'...
==> default: Assigning a new mac address to the VM.
==> 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.117: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...

I tried rebooting, using a different box, restarting libvirtd, messing with my routing table, manually removing all *xml files in /etc/libvirt/qemu and /etc/libvirt/qemu/networks but none of that seemed to fix the problem. Does anybody have any clue on what might be going wrong?

adrahon commented 9 years ago

There were regressions with the changes we introduced to the networking code recently. Prior to https://github.com/adrahon/vagrant-kvm/commit/fea85417f11260728f465fb46def1b164b35119a the dhcp entries weren't cleaned up on vagrant destroy. Best would be to build the rubygem from source, but I am going to publish 0.2.0 as soon as I implement bridge network support.

One way to clean up you networks in the meantime is to do a virsh net-destroy vagrant && virsh net-undefine vagrant (also for any vagrant-xxx network, you can list them with virsh net-list), you need to be root to do that.

vdloo commented 9 years ago

I tried net-destroy and net-undefine yesterday as well on all vagrant related networks but no success. I'll wait until 0.2.0 is released but untill then I'll keep my systems on 0.1.8. Thanks for the quick response, I appreciate it.

On 12 Oct 2014, at 12:08, Alexandre Drahon notifications@github.com wrote:

There were regressions with the changes we introduced to the networking code recently. Prior to fea8541 the dhcp entries weren't cleaned up on vagrant destroy. Best would be to build the rubygem from source, but I am going to publish 0.2.0 as soon as I implement bridge network support.

One way to clean up you networks in the meantime is to do a virsh net-destroy vagrant && virsh net-undefine vagrant (also for any vagrant-xxx network, you can list them with virsh net-list), you need to be root to do that.

— Reply to this email directly or view it on GitHub.