Can vagrant start multiple VMs in parallel?

982 views
Skip to first unread message

Yiliang Bao

unread,
May 16, 2014, 3:10:17 PM5/16/14
to vagra...@googlegroups.com
Hi,

I am using vagrant to start many VMs for a test setup. Currently I am using virtualbox, and it takes about 25 seconds to start a VM. It takes about 8 seconds for Ubuntu server guest to boot, but there is some other overhead. 

Since I may need to start many VMs, I am wondering if there is anything I can do to speed it up. For example, is it possible to start VMs in parallel. I do not mind to switch to other virtualization platform, like VMware, if the virtualization platform is the limitation. 

Thanks,
Yiliang

Sebastian Otaegui

unread,
May 16, 2014, 3:12:13 PM5/16/14
to vagra...@googlegroups.com
If you used docker it would probably be much faster, but is not virtualization.

Do you need a virtualization environment?




--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Those who do not understand Unix are condemned to reinvent it, poorly.
Any sufficiently recent Microsoft OS contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Unix.

Yiliang Bao

unread,
May 16, 2014, 4:12:27 PM5/16/14
to vagra...@googlegroups.com
Hi Sebastian,

Thanks for the quick help. Are you referring to the latest support of Docker inside vagrant? I will take a look at Docker anyways. 

I do not understand what "virtualization environment" means in your email. I assume you are not talking about the virtualization provided by virtualbox or VMware, since that is what I using now.

Thanks again!
Yiliang

Sebastian Otaegui

unread,
May 16, 2014, 5:10:10 PM5/16/14
to vagra...@googlegroups.com
What I mean is that vmware and virtual box differ from docker/lxc in that vmware and virtual box virtualize hardware (create a software emulation of the hardware) while docker is a container.

In Vmware and Virtualbox your guest os boots as if it was a machine while on docker the kernel is already instantiated and docker/lxc create an isolated compartment within, that is, there is no "real" boot process in docker.

But I do not know what you are trying to do.


Regards

Yiliang Bao

unread,
May 16, 2014, 5:40:31 PM5/16/14
to vagra...@googlegroups.com
What I try to do is to create a virtual cluster with 4 nodes in one physical machine. Currently each node is a virtualbox VM. The cluster may be scaled to include many more nodes later. 

With the configuration file I have (part of Vagrantfile is shown below), VMs are started sequentially. It takes a lot of time to start the complete cluster, since every VM goes through a boot process as you pointed out. I am wondering if there is any way to speed it up. I figure one possible solution is that VMs are started in parallel.

  (1..4).each do |i|
    config.vm.define "node-#{i}" do |node|
      node.vm.box = "base-node"
      node.vm.provider :virtualbox do |v|
        v.name = "node-#{i}"
        v.customize ["modifyvm", :id, "--memory", "640"]
      end
    end
  end

The main reason that I use virtualbox is I know virtualbox better and it works well with vagrant. Going with a container is definitely an option. I will look into this if I cannot make the current setup (based on virtualbox) faster.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages