[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#837992: Vagrant NFS bug



>> I see three possibility fo fix this:
>>  A) switch to NFSv4 by default via a Vagrant configuration option
>> NFSv4 does not requires the rpc.statd service to run before mounting a
>> NFS share
>>  B) force the rpcbind server to start earlier by patching stuff in /etc
>>  C) switch to rsync as the default file sharing mecanismus ( or maybe
>> p9fs) for libvirt boxes. Rsync has also the advantage of not requiring
>> the root password for each vagrant up.
>>
>>
>> I would propose to work this bug around in order of preferences via C)
> or A)

> A) seems cleaner.

the attach patch should fix the NFS mounts on startup
it fixes the issue when being applied locally on a Vagrantfile

however I am not confident applying it, since all libvirt boxes I build
hang detecting the IP adress of the libvirt guest

VAGRANT_LOG=debug vagrant up

0x000000023fd700>
DEBUG wait_till_up: Searching for IP for MAC address: 52:54:00:cd:84:16
 INFO interface: info: Waiting for domain to get an IP address...
 INFO interface: info: ==> default: Waiting for domain to get an IP
address...
==> default: Waiting for domain to get an IP address...
 INFO retryable: Retryable exception raised:
#<Fog::Errors::TimeoutError: The specified wait_for timeout (2 seconds)
was exceeded>
 INFO retryable: Retryable exception raised:
#<Fog::Errors::TimeoutError: The specified wait_for timeout (2 seconds)
was exceeded>
 INFO retryable: Retryable exception raised:
#<Fog::Errors::TimeoutError: The specified wait_for timeout (2 seconds)
was exceeded>
 INFO retryable: Retryable exception raised:
#<Fog::Errors::TimeoutError: The specified wait_for timeout (2 seconds)
was exceeded>

and so on ...

if I start some network activity in the guest via virt-manager then
vagrant is able to detect the IP adress of the guest and then go on with
the rest of the vagrant up sequence but you need to this manually
I have no clue here

> wrt C):
> 
> - I have tried p9fs before and it is not so easy to make it work
>   correctly, because you cannot get the uid mapping between host and vm
>   correct all the time; it's "easy" to get it working if the share is
>   read-only from the PoV of the VM, but not so easy otherwise.
> 
> - rsync seems like a terrible regression on how vagrant is supposed to
>   work. you expect to change something from the host and it being
>   immediately reflected on the VM, but when sharing via rsync you need
>   to re-provision the VM to have your changes reflected, which sucks
> 

did you see the vagrant rsync-auto command ?

if you start vagrant rsync-auto in the same directory in another shell
window, vagrant will start a background rsync process who watchers via
inotify the changes to your current dir and push them to the vagrant guest
it is only one way sync though

but yes NFS works better becaure of the two way sync
commit e434330d46f473e9bc6f5888c3bb260afb87f887
Author: Emmanuel Kasper <emmanuel@libera.cc>
Date:   Sat Sep 17 16:18:26 2016 +0200

    vmdebootstrap-libvirt-vagrant: use NFSv4 by default
    
    workaround for #837992

diff --git a/vmdebootstrap-libvirt-vagrant/Vagrantfile.in b/vmdebootstrap-libvirt-vagrant/Vagrantfile.in
index a34b797..ff47146 100644
--- a/vmdebootstrap-libvirt-vagrant/Vagrantfile.in
+++ b/vmdebootstrap-libvirt-vagrant/Vagrantfile.in
@@ -27,6 +27,11 @@ Vagrant.configure("2") do |config|
     #test_vm.vm.network :public_network, :ip => '10.20.30.41'
   #end
 
+  # workaround for #837992
+  # use nfsv4 mode by default since rpcbind is not available on startup
+  # we need to force tcp because udp is not availaible for nfsv4
+  config.vm.synced_folder ".", "/vagrant", type: "nfs", nfs_version: "4", nfs_udp: false
+
   # Options for libvirt vagrant provider.
   config.vm.provider :libvirt do |libvirt|
 

Reply to: