Search code examples
ubuntuvagrant

Measuring time taken for 'vagrant up'


Is there any way to measure the time taken between executing vagrant up to actually being able to vagrant ssh into the machine? We use a shared ubuntu dev environment that takes a long time to spin up and I was considering switching the apt-get install commands to apt-fast install but unless there is a significant improvement I wouldn't be so inclined.


Solution

  • Prepend your vagrant up with time.

    $ time vagrant up

    Just before the script finishes you will see output like this:

    real    0m17.844s
    user    0m2.251s
    sys 0m0.643s
    

    If you want to exclude time for importing the box, setting up network interfaces, port forwards, shared folders mounting etc then measure only time that is needed for provisioning:

    1. Bring the box up (without provisioning)

      $ time vagrant up --no-provision

    2. Measure provisioning time

      $ time vagrant provision