multiple vm's in a vagrant file

36 views
Skip to first unread message

dbren...@pivotal.io

unread,
Mar 3, 2016, 10:09:45 AM3/3/16
to Vagrant
Good morning....

I am very new with vagrant so please bear with me....

i can create a cluster of 4 centos vm's. it works great and even i can do it.

however what i need is to be able to create the same cluster with each of the vm's allocated a different amount of memory.

is that possible??

thank you in advance for your guidance.

danab

Alvaro Miranda Aguilera

unread,
Mar 3, 2016, 1:00:26 PM3/3/16
to vagra...@googlegroups.com
Hello,

Can you share your Vagrantfile?

basically, when you define a new box, you can put the customization block inside.

ie:

Vagrant.configure("2") do |config|
  config.vm.provision "shell", inline: "echo Hello"

  config.vm.define "web" do |web|
    web.vm.provider "virtualbox" do |v|
      v.memory = 1024
      v.cpus = 2
    end

    web.vm.box = "apache"
  end

  config.vm.define "db" do |db|
    db.vm.provider "virtualbox" do |v|
      v.memory = 2048
      v.cpus = 2
    end
    db.vm.box = "mysql"
  end
end

Alvaro.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/b94fdb00-b06d-4d8d-9d79-b7472ffb9f30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dana Brenneman

unread,
Mar 3, 2016, 1:16:51 PM3/3/16
to vagra...@googlegroups.com
good afernoon sir....

got it sorted out.....exactly as you have described.

thank you for your posts as well as following up.

greatly appreciated.

take care

You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/37woVynD8eg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exo1JNm_mGHBwWNbAT_gbsxdbGojiOZ6R5Bz_%3DL0LWJ7g%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Thank you

Best wishes

Dana Brenneman
Pivotal Education
508 864-6489
Reply all
Reply to author
Forward
0 new messages