our vagrant box takes ~1h provision when vagrant up run first time, @ end of provisioning process package box image in local folder can used base box next time needs rebuilt. i'm using vagrant-triggers plugin place code right @ end of :up process.
relevant (shortened) vagrantfile:
pre_built_box_file_name = 'image.vagrant' pre_built_box_path = 'file://' + file.join(dir.pwd, pre_built_box_file_name) pre_built_box_exists = file.file?(pre_built_box_path) vagrant.configure(2) |config| config.vm.box = 'ubuntu/trusty64' config.vm.box_url = pre_built_box_path if pre_built_box_exists config.trigger.after :up if not pre_built_box_exists system("echo 'building gett vagrant image re-use...'; vagrant halt; vagrant package --output #{pre_built_box_file_name}; vagrant up;") end end end the problem vagrant locks machine while current (vagrant up) process running:
an action 'halt' attempted on machine 'gett', process executing action on machine. vagrant locks each machine access 1 process @ time. please wait until other vagrant process finishes modifying machine, try again. i understand dangers of 2 processes provisioning or modifying machine @ 1 given time, special case i'm provisioning has completed.
how can manually "unlock" vagrant machine during provisioning can run vagrant halt; vagrant package; vagrant up; within config.trigger.after :up?
or there @ least way start vagrant up without locking machine?
vagrant
this issue has been fixed in gh #3664 (2015). if still happening, it's related plugins (such aws). try without plugins.
vagrant-aws
if you're using aws, follow bug/feature report: #428 - unable ssh instance during provisioning, pending.
however there pull request fixes issue:
so apply fix manually, or waits until it's fixed in next release.
in case you've got error related machines aren't valid, try running vagrant global-status --prune command.
Comments
Post a Comment