Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speeding up provisioning #4

Open
jchodera opened this issue Nov 4, 2014 · 9 comments
Open

Speeding up provisioning #4

jchodera opened this issue Nov 4, 2014 · 9 comments

Comments

@jchodera
Copy link
Member

jchodera commented Nov 4, 2014

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.

@rmcgibbo
Copy link

You can export the provisioned VM as a new .box file.

@jchodera
Copy link
Member Author

You can export the provisioned VM as a new .box file.

Awesome! Is this

vagrant package --base my-virtual-machine

?

@rmcgibbo
Copy link

Just vagrant package should work fine, assuming your current directory contains the vagrantfile.

@jchodera
Copy link
Member Author

I've packaged a vanilla provisioned vagrant box. Any idea of the simplest way to use this to create new vagrant VMs?

@rmcgibbo
Copy link

just declare it as the base in your vagrantfile.

@jchodera
Copy link
Member Author

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.

@kyleabeauchamp
Copy link
Contributor

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?

@rmcgibbo
Copy link

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 halting and restarting the same VM, because you know you're always starting from a known good image.

@jchodera
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants