Open jchodera opened 9 years ago
You can export the provisioned VM as a new .box
file.
You can export the provisioned VM as a new
.box
file.
Awesome! Is this
vagrant package --base my-virtual-machine
?
Just vagrant package
should work fine, assuming your current directory contains the vagrantfile.
I've packaged a vanilla provisioned vagrant box. Any idea of the simplest way to use this to create new vagrant
VMs?
just declare it as the base in your vagrantfile.
Hm, I imagine we don't want to add or replace the stuff in the virtual machines github repo, but instead want to use local Jenkins scripts to do this.
Maybe I can script something like this:
vagrant box add $HOME/vagrant/provisioned.box --name linux
vagrant init linux
vagrant up
and this could do the trick.
What do we need to resolve Is this issue?
We now use vagrant halt
to resume the VM for most operations, re-provisioning quite rarely. I think the only outstanding component is to occasionally run vagrant package to "freeze" working versions of the VM for quick re-provisioning if necessary? So we might just need an template vagrantfile for using the frozen output?
I'm not 100% sure about this, but I think you want to export the box, after provisioning, as a fixed image. Then for each run, you should create a fresh VM from that image. This is safer than halt
ing and restart
ing the same VM, because you know you're always starting from a known good image.
I'm not 100% sure about this, but I think you want to export the box, after provisioning, as a fixed image.
This is exactly what we want to do. I think we want to have the test-omnia-virtual-machines
project check out the virtual-machines
repo, attempt to provision the vagrant box, and if everything succeeds, roll a new vagrant box from that image and upload it somewhere, replacing our current "working image" somewhere.
It takes a long time to provision these VMs over the network, so I am thinking we either need to either (1) locally share already-provisioned Vagrant boxes, or (2) set up a local mirror for
yum
to use.