Pretty stock Vagrantfile from https://github.com/coreos/coreos-vagrant.git:

# -*- mode: ruby -*-
# # vi: set ft=ruby :

require 'fileutils'

Vagrant.require_version ">= 1.6.0"

CLOUD_CONFIG_PATH = File.join(File.dirname(__FILE__), "user-data")
CONFIG = File.join(File.dirname(__FILE__), "config.rb")

# Defaults for config options defined in CONFIG
$num_instances = 3
$update_channel = "stable"
$enable_serial_logging = false
$vb_gui = false
$vb_memory = 1024
$vb_cpus = 1

# Attempt to apply the deprecated environment variable NUM_INSTANCES to
# $num_instances while allowing config.rb to override it
if ENV["NUM_INSTANCES"].to_i > 0 && ENV["NUM_INSTANCES"]
  $num_instances = ENV["NUM_INSTANCES"].to_i
end

if File.exist?(CONFIG)
  require CONFIG
end

Vagrant.configure("2") do |config|
  # always use Vagrants insecure key
  config.ssh.insert_key = false

  config.vm.box = "coreos-%s" % $update_channel
  config.vm.box_version = ">= 308.0.1"
  config.vm.box_url = 
"http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json";
 
% $update_channel

  config.vm.provider :vmware_fusion do |vb, override|
    override.vm.box_url = 
"http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json";
 
% $update_channel
  end

  config.vm.provider :virtualbox do |v|
    # On VirtualBox, we don't have guest additions or a functional vboxsf
    # in CoreOS, so tell Vagrant that so it can be smarter.
    v.check_guest_additions = false
    v.functional_vboxsf     = false
  end

  # plugin conflict
  if Vagrant.has_plugin?("vagrant-vbguest") then
    config.vbguest.auto_update = false
  end

  (1..$num_instances).each do |i|
    config.vm.define vm_name = "core-%02d" % i do |config|
      config.vm.hostname = vm_name

      if $enable_serial_logging
        logdir = File.join(File.dirname(__FILE__), "log")
        FileUtils.mkdir_p(logdir)

        serialFile = File.join(logdir, "%s-serial.txt" % vm_name)
        FileUtils.touch(serialFile)

        config.vm.provider :vmware_fusion do |v, override|
          v.vmx["serial0.present"] = "TRUE"
          v.vmx["serial0.fileType"] = "file"
          v.vmx["serial0.fileName"] = serialFile
          v.vmx["serial0.tryNoRxLoss"] = "FALSE"
        end

        config.vm.provider :virtualbox do |vb, override|
          vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
          vb.customize ["modifyvm", :id, "--uartmode1", serialFile]
        end
      end

      if $expose_docker_tcp
        config.vm.network "forwarded_port", guest: 2375, host: 
($expose_docker_tcp + i - 1), auto_correct: true
      end

      config.vm.provider :vmware_fusion do |vb|
        vb.gui = $vb_gui
      end

      config.vm.provider :virtualbox do |vb|
        vb.gui = $vb_gui
        vb.memory = $vb_memory
        vb.cpus = $vb_cpus
      end

      ip = "172.17.8.#{i+100}"
      config.vm.network :private_network, ip: ip

      # Uncomment below to enable NFS for sharing the host machine into the 
coreos-vagrant VM.
      config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => 
true, :mount_options => ['nolock,vers=3,udp']

      if File.exist?(CLOUD_CONFIG_PATH)
        config.vm.provision :file, :source => "#{CLOUD_CONFIG_PATH}", 
:destination => "/tmp/vagrantfile-user-data"
        config.vm.provision :shell, :inline => "mv 
/tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true
      end

    end
  end
end

The VMs should have IP addresses of 172.17.8 101, 172.17.8.102, etc. but 
they typically come up first with something like 172.17.8.153.




On Monday, January 19, 2015 at 3:00:28 PM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> sample vagrantfile ?
>
> On Tue, Jan 20, 2015 at 10:30 AM, Tony Perez <[email protected] 
> <javascript:>> wrote:
>
>> Hello,
>>
>> I'm running Vagrant 1.7.2 on Mac OS X 10.10.1 with version 3.2.0 of the 
>> vagrant-vmware-fusion plugin.  I've noticed that all of my CoreOS guest VMs 
>> acquire the wrong private IP address after their first vagrant up.  Running 
>> vagrant reload always fixes the problem by assigning the proper private IP 
>> address, but I need the IP address to be correct every time because I'm 
>> syncing to an NFS export on the host.
>>
>> What am I doing wrong?
>>
>> Tony
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to