I understand now. I'm following 
https://medium.com/oracledevs/two-birds-with-one-home-cloned-vagrant-multi-machines-2ee5ba75fad8
and I see that a master VM is created that never gets started.
Vagrant uses VirtualBox linked clones to create new VMs.
So if I want to update the master,  I have to update the base box it is 
based on.


On Wednesday, 15 April 2020 12:52:21 UTC-4, Dennis Chang wrote:
>
> Hi all,
>
> I'm not sure how linked clones work. So please correct my misunderstanding.
>
> I have a Vagrantfile
> ```
> $setup = <<-SETUP
>   echo "Running as $(id)"
>   yum update -y
>   yum install -y java-1.8.0-openjdk-devel
> SETUP
>
> Vagrant.configure("2") do |config|
>
>   config.vm.define "master-01" do |master|
>     master.vm.box = "centos/7"
>     master.vm.provider "virtualbox" do |v|
>       v.cpus = 1
>       v.memory = 1024
>       v.linked_clone = true
>     end
>     master.vm.provision "shell", inline: $setup
>   end
>
>   config.vm.define "clone-01" do |clone|
>     clone.vm.box = "centos/7"
>     clone.vm.provider "virtualbox" do |v|
>       v.cpus = 2
>       v.memory = 2048
>       v.linked_clone = true
>     end
>     master.vm.provision "shell", inline: <<-INLINE
>       # download and start application (depends on Java)
>     INLINE
>   end
> ```
>
> So ideally, I only run yum update only once (I noticed that the VM 
> snapshot blows up to 1.5 GB) because it takes time. But in my example, when 
> I spinup clone-01, clone-01 doesn't have Java already installed and it 
> fails (to startup).
>
> So my question is, how *should* I define a Vagrantfile for multi-machines 
> where one machine is a linked clone of another where I only need to run yum 
> update -y once?.
> Can you tell me what I'm doing wrong here?
>
> Thanks,
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/ea5ec569-77a1-4f9f-abbd-99a7149b8a1d%40googlegroups.com.

Reply via email to