hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.27k stars 4.43k forks source link

Enhancement Request: Vagrant lock: allow multiple vagrant processes on the same machine on Hyper-V provider #11943

Open Wenzel opened 4 years ago

Wenzel commented 4 years ago

Is your feature request related to a problem? Please describe. I'm using vagrant provision to provision my VMs on Hyper-V, and some tasks are taking a long time to complete. I would like to monitor/interact with the VM in the meantime with vagrant ssh.

However, this isn't possible due to Vagrant locks.

PS C:\Users\Wenzel\Projets\kvm-vmi\vagrant> vagrant ssh                                                                                                                                                                                      An action 'read_state' was attempted on the machine 'kvmi',
but another process is already executing an action on the machine.
Vagrant locks each machine for access by only one process at a time.
Please wait until the other Vagrant process finishes modifying this
machine, then try again.

If you believe this message is in error, please check the process
listing for any "ruby" or "vagrant" processes and kill them. Then
try again.

I'm used to this workflow on Linux with the libvirt provider, which doesn't have a lock.

Describe the solution you'd like Allow multiple vagrant ssh connection alongside a vagrant provision process already running on Hyper-V provider

Describe alternatives you've considered None

Additional context

I'm trying to expand a Vagrant project from Linux to Windows support with Hyper-V provider https://github.com/KVM-VMI/kvm-vmi/

Thanks !

chrisroberts commented 4 years ago

This looks like we are being a bit aggressive with our locking strategy. Ideally we should check the lock based on intention and allow read-only actions to be allowed while preventing modification behaviors until the lock is released.