{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/7533","repository_url":"https://api.github.com/repos/mitchellh/vagrant","labels_url":"https://api.github.com/repos/mitchellh/vagrant/issues/7533/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/vagrant/issues/7533/comments","events_url":"https://api.github.com/repos/mitchellh/vagrant/issues/7533/events","html_url":"https://github.com/mitchellh/vagrant/issues/7533","id":163014415,"number":7533,"title":"Error setting hostname when setting up a centos-7.2 box","user":{"login":"peetkes","id":550788,"avatar_url":"https://avatars.githubusercontent.com/u/550788?v=3","gravatar_id":"","url":"https://api.github.com/users/peetkes","html_url":"https://github.com/peetkes","followers_url":"https://api.github.com/users/peetkes/followers","following_url":"https://api.github.com/users/peetkes/following{/other_user}","gists_url":"https://api.github.com/users/peetkes/gists{/gist_id}","starred_url":"https://api.github.com/users/peetkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peetkes/subscriptions","organizations_url":"https://api.github.com/users/peetkes/orgs","repos_url":"https://api.github.com/users/peetkes/repos","events_url":"https://api.github.com/users/peetkes/events{/privacy}","received_events_url":"https://api.github.com/users/peetkes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/guest/redhat","name":"guest/redhat","color":"5319e7"}],"state":"closed","locked":false,"assignee":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"assignees":[{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mitchellh/vagrant/milestones/17","html_url":"https://github.com/mitchellh/vagrant/milestones/1.8.5","labels_url":"https://api.github.com/repos/mitchellh/vagrant/milestones/17/labels","id":1827672,"number":17,"title":"1.8.5","description":"","creator":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":20,"state":"closed","created_at":"2016-06-14T21:56:48Z","updated_at":"2016-07-19T04:39:09Z","due_on":"2016-09-01T06:00:00Z","closed_at":"2016-07-19T04:39:09Z"},"comments":8,"created_at":"2016-06-29T20:05:59Z","updated_at":"2016-07-26T10:53:36Z","closed_at":"2016-07-19T01:44:47Z","body":"### Vagrant version\r\nvagrant version 1.8.4\r\n\r\n### Host operating system\r\nMacOS 10.11.4\r\n\r\n### Guest operating system\r\nCentOS 7.2\r\n\r\n### Vagrantfile\r\n```ruby\r\n# -*- mode: ruby -*-\r\n# vi: set ft=ruby :\r\n# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!\r\nVAGRANTFILE_API_VERSION = \"2\"\r\n\r\n# Vagrant by default saves VM info in a .vagrant/ folder next to where Vagrantfile lives.\r\n# You can however start vagrant from a subfolder, in which case VM info from different VMs\r\n# could get mixed up. Make sure to put .vagrant/ in CWD rather than next to Vagrantfile\r\n# if there is no Vagrantfile in CWD.\r\nVAGRANTFILE = ENV[\"VAGRANT_VAGRANTFILE\"] || \"Vagrantfile\"\r\nVAGRANTFILE_PATH = Dir.getwd + \"/\" + VAGRANTFILE\r\n\r\n@command = ARGV[0]\r\n\r\nif @command != \"global-status\" && # skip this for global-status\r\n  !(File.exists? VAGRANTFILE_PATH) && # Vagrantfile must be in a higher dir\r\n    ENV[\"VAGRANT_DOTFILE_PATH\"].nil? # and .vagrant location is not set explicitly\r\n\r\n  VAGRANT_DOTFILE_PATH = Dir.getwd + \"/.vagrant\"\r\n  puts \"Setting VAGRANT_DOTFILE_PATH to \" + VAGRANT_DOTFILE_PATH\r\n  puts \"\"\r\n\r\n  ENV[\"VAGRANT_DOTFILE_PATH\"] = VAGRANT_DOTFILE_PATH\r\n  system \"vagrant \" + ARGV.join(\" \")\r\n  ENV[\"VAGRANT_DOTFILE_PATH\"] = nil # for good measure\r\n\r\n  abort \"Finished\"\r\nend\r\n\r\ndef load_properties(properties_filename, prefix = \"\")\r\n  properties = {}\r\n\r\n  if File.exists? properties_filename\r\n    File.open(properties_filename, \"r\") do |properties_file|\r\n      properties_file.read.each_line do |line|\r\n        line.strip!\r\n        if (line[0] != ?#) && (line[0] != ?=) && (line[0] != \"\")\r\n          i = line.index(\"=\")\r\n          if i\r\n            key = prefix + line[0..i - 1].strip.upcase\r\n            value = line[i + 1..-1].strip\r\n            value.gsub!(/^\"(.*)\"$/, '\\1')\r\n            properties[key] = value\r\n          end\r\n        end\r\n      end\r\n    end\r\n  else\r\n    puts \"WARN: Properties file #{properties_filename} not found..\" unless @command == \"global-status\"\r\n  end\r\n\r\n  properties\r\nend\r\n\r\ndef get_vm_name(i)\r\n  name = \"#{@vm_name}\"\r\n  name.gsub!(/\\{project_name\\}/, @project_name)\r\n  name.gsub!(/\\{vm_version\\}/, @vm_version)\r\n  name.gsub!(/\\{ml_version\\}/, @ml_version)\r\n  name.gsub!(/\\{i\\}/, i.to_s)\r\n  name\r\nend\r\n\r\ndef inc_ip(ip, i)\r\n  newip = \"#{ip}\"\r\n  nr = \"#{ip}\"\r\n  nr.gsub!(/^(.*\\.)+/, \"\").to_i\r\n  newip.gsub!(/\\.\\d+$/, \".#{nr + i}\")\r\n  newip\r\nend\r\n\r\n@properties = load_properties(\"project.properties\")\r\n@project_name = ENV[\"MLV_PROJECT_NAME\"] || @properties[\"PROJECT_NAME\"] || File.basename(Dir.getwd)\r\n\r\n@vm_name = ENV[\"MLV_VM_NAME\"] || @properties[\"VM_NAME\"] || \"{project_name}-ml{i}\"\r\n@vm_version = ENV[\"MLV_VM_VERSION\"] || @properties[\"VM_VERSION\"] || \"6.7\"\r\n@ml_version = ENV[\"MLV_ML_VERSION\"] || @properties[\"ML_VERSION\"] || \"8\"\r\n@nr_hosts = (ENV[\"MLV_NR_HOSTS\"] || @properties[\"NR_HOSTS\"] || \"3\").to_i\r\n@master_memory = (ENV[\"MLV_MASTER_MEMORY\"] || @properties[\"MASTER_MEMORY\"] || \"2048\").to_i\r\n@master_cpus = (ENV[\"MLV_MASTER_CPUS\"] || @properties[\"MASTER_CPUS\"] || \"2\").to_i\r\n@slave_memory = (ENV[\"MLV_SLAVE_MEMORY\"] || @properties[\"SLAVE_MEMORY\"] || @master_memory.to_s).to_i\r\n@slave_cpus = (ENV[\"MLV_SLAVE_CPUS\"] || @properties[\"SLAVE_CPUS\"] || @master_cpus.to_s).to_i\r\n@ml_installer = ENV[\"MLV_ML_INSTALLER\"] || @properties[\"ML_INSTALLER\"] || \"\"\r\n@mlcp_installer = ENV[\"MLV_MLCP_INSTALLER\"] || @properties[\"MLCP_INSTALLER\"] || \"\"\r\n@public_network = ENV[\"MLV_PUBLIC_NETWORK\"] || @properties[\"PUBLIC_NETWORK\"] || \"\"\r\n@priv_net_ip = ENV[\"MLV_PRIV_NET_IP\"] || @properties[\"PRIV_NET_IP\"] || \"\"\r\n@shared_folder_host = ENV[\"MLV_SHARED_FOLDER_HOST\"] || @properties[\"SHARED_FOLDER_HOST\"] || \"\"\r\n@shared_folder_guest = ENV[\"MLV_SHARED_FOLDER_GUEST\"] || @properties[\"SHARED_FOLDER_GUEST\"] || \"\"\r\n@net_proxy = ENV[\"MLV_NET_PROXY\"] || @properties[\"NET_PROXY\"] || \"\"\r\n@no_proxy = ENV[\"MLV_NO_PROXY\"] || @properties[\"NO_PROXY\"] || \"localhost,127.0.0.1\"\r\n\r\nunless @net_proxy.empty? or Vagrant.has_plugin?(\"vagrant-proxyconf\")\r\n  abort 'To use net_proxy setting, run \"vagrant plugin install vagrant-proxyconf\" first.'\r\nend\r\n\r\n@vm_name = get_vm_name(\"{i}\")\r\n\r\nputs \"Loading project #{@project_name}..\" unless @command == \"global-status\"\r\nif @command == \"status\" or @command == \"up\" or @command == \"provision\"\r\n  puts \"\"\r\n  puts \"vm_name=#{@vm_name}\"\r\n  puts \"vm_version=#{@vm_version}\"\r\n  puts \"ml_version=#{@ml_version}\"\r\n  puts \"nr_hosts=#{@nr_hosts}\"\r\n  puts \"master_memory=#{@master_memory}\"\r\n  puts \"master_cpus=#{@master_cpus}\"\r\n  if @nr_hosts > 1\r\n    puts \"slave_memory=#{@slave_memory}\"\r\n    puts \"slave_cpus=#{@slave_cpus}\"\r\n  end\r\n  if @ml_installer != \"\"\r\n    puts \"ml_installer=#{@ml_installer}\"\r\n  end\r\n  if @mlcp_installer != \"\"\r\n    puts \"mlcp_installer=#{@mlcp_installer}\"\r\n  end\r\n  if @shared_folder_host != \"\" and  @shared_folder_guest != \"\"\r\n    puts \"shared_folder_host=#{@shared_folder_host}\"\r\n    puts \"shared_folder_guest=#{@shared_folder_guest}\"\r\n  end\r\n  if @public_network != \"\"\r\n    puts \"\"\r\n    puts \"WARN: Using DHCP on Public Network '#{@public_network}'!\"\r\n  elsif @priv_net_ip != \"\"\r\n    puts \"priv_net_ip=#{@priv_net_ip}\"\r\n  else\r\n    puts \"\"\r\n    puts \"Using DHCP for Private Network\"\r\n  end\r\n  puts \"\"\r\n\r\n  if @command == \"up\" and @vm_version == \"5.11\" and @ml_version == \"8\"\r\n    puts \"MarkLogic 8 NOT supported on CentOS 5! Try MarkLogic 7, or CentOS 6..\"\r\n    abort \"Bailing out..\"\r\n  end\r\nend\r\n\r\nVagrant.configure(VAGRANTFILE_API_VERSION) do |config|\r\n  mastername = get_vm_name(1)\r\n\r\n  unless @net_proxy.empty?\r\n    hostnames = (1..@nr_hosts).map{|i| get_vm_name(i)}.join(\",\")\r\n    config.proxy.ftp = @net_proxy\r\n    config.proxy.http = @net_proxy\r\n    config.proxy.https = @net_proxy\r\n    config.proxy.no_proxy = \"#{@no_proxy},#{hostnames}\"\r\n  end\r\n\r\n  config.hostmanager.enabled = false\r\n  config.hostmanager.manage_host = true\r\n  config.hostmanager.include_offline = true\r\n  config.hostmanager.ignore_private_ip = false\r\n  config.hostmanager.ip_resolver = proc do |machine|\r\n      result = \"\"\r\n      begin\r\n        machine.communicate.execute(\"/sbin/ifconfig eth1\") do |type, data|\r\n          result << data if type == :stdout\r\n        end\r\n      rescue\r\n        result = \"# NOT-UP\"\r\n        puts \"Getting IP from #{ machine.name } ... not running\"\r\n        next\r\n      end\r\n      ip = /^\\s*inet .*?(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+/.match(result)[1]\r\n      puts \"Getting IP from #{ machine.name } ... #{ip}\"\r\n      ip\r\n  end\r\n\r\n  # Customize the virtual machine environments\r\n  config.vm.provider :virtualbox do |vb|\r\n      vb.customize [\"modifyvm\", :id, \"--nictype1\", \"virtio\"]\r\n      vb.customize [\"modifyvm\", :id, \"--nictype2\", \"virtio\"]\r\n      #vb.gui = true # for debugging\r\n  end\r\n\r\n\r\n  config.vm.define mastername do |master|\r\n      master.vm.box = \"bento/centos-7.2\"   #{}\"grtjn/centos-#{@vm_version}\"\r\n      master.vm.provider \"virtualbox\" do |v|\r\n          v.name = mastername\r\n          v.memory = @master_memory\r\n          v.cpus = @master_cpus\r\n      end\r\n      master.vm.hostname = mastername\r\n      if @public_network != \"\"\r\n        master.vm.network \"public_network\", bridge: @public_network\r\n      elsif @priv_net_ip != \"\"\r\n        master.vm.network \"private_network\", ip: @priv_net_ip\r\n      else\r\n        master.vm.network \"private_network\", type: \"dhcp\"\r\n      end\r\n      master.vm.synced_folder Dir.getwd, \"/vagrant\"\r\n      master.vm.synced_folder \"/opt/vagrant\", \"/opt/vagrant\"\r\n      master.vm.synced_folder \"/space/software\", \"/space/software\"\r\n      if @shared_folder_host != \"\" and  @shared_folder_guest != \"\"\r\n        master.vm.synced_folder @shared_folder_host, @shared_folder_guest, :create => true\r\n      end\r\n      master.vm.provision :hostmanager\r\n  end\r\nend\r\n```\r\nUse the following properties file:\r\n```\r\n##\r\n# Project name - defaults to current directory name\r\n#\r\n#project_name=example\r\n\r\n##\r\n# VM naming pattern - defaults to {project_name}-ml{i}, also allowed: {ml_version}\r\n#\r\n# IMPORTANT: DON'T CHANGE ONCE YOU HAVE CREATED THE VM'S!!\r\n#\r\nvm_name={project_name}-ml{i}\r\n\r\n##\r\n# CentOS base VM version - defaults to 6.7, allowed: 5.11/6.5/6.6/6.7/7.0/7.1\r\n#\r\nvm_version=7.2\r\n\r\n##\r\n# Number of hosts in the cluster - defaults to 3, minimum for failover support\r\n#\r\nnr_hosts=1\r\n\r\n##\r\n# Memory assigned to master node in cluster (first vm) - defaults to 2048\r\n#\r\nmaster_memory=4096\r\n\r\n##\r\n# Number of cpus assigned to master node in cluster (first vm) - defaults to 2\r\n#\r\nmaster_cpus=2\r\n\r\n##\r\n# Memory assigned to each slave node in cluster - defaults to same as master_memory\r\n#\r\n#slave_memory=2048\r\n\r\n##\r\n# Number of cpus assigned to each slave node in cluster - defaults to same as master_cpus\r\n#\r\n#slave_cpus=2\r\n\r\n##\r\n# Name of public_network to use in Vagrant - defaults to \"\"\r\n#\r\n# Note: enabling this makes your VMs accessible from outside, beware of security leaks\r\n#\r\n#public_network=\"en0: Wi-Fi (AirPort)\"\r\n\r\n##\r\n# Assign dedicated private IP to master node - slaves get same ip + i\r\n#\r\n#priv_net_ip=\r\n\r\n##\r\n# Network proxy - requires vagrant-proxyconf plugin\r\n#\r\n#net_proxy=http://proxy:8080/\r\n\r\n##\r\n# Hosts that do not require network proxy\r\n#\r\n#no_proxy=localhost,127.0.0.1\r\n\r\n##\r\n# Mount an extra folder from host on vm - project dir is automatically shared as /vagrant\r\n#\r\n#shared_folder_host=\r\n#shared_folder_guest=\r\n\r\n##\r\n# Run full OS updates - defaults to false\r\n#\r\n# Note: doing this with CentOS 6.5 or 7.0 will take it up to the very latest minor release (6.7+ resp 7.1+)\r\n#\r\nupdate_os=false\r\n\r\n```\r\n\r\n### Debug output\r\nhttps://gist.github.com/peetkes/f4896b524c0baaea5b9f9ded43d41854\r\n\r\n\r\n### Expected behavior\r\nNormal startup of a vagrant box\r\n\r\n### Actual behavior\r\nthe box is started but with the error\r\n\r\n\r\n### Steps to reproduce\r\n1. copy the vagrant file and the properties file in a folder\r\n2. run following command\r\n3. vagrant up --no-provision\r\n\r\n### References\r\n"},"comment":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/comments/235234778","html_url":"https://github.com/mitchellh/vagrant/issues/7533#issuecomment-235234778","issue_url":"https://api.github.com/repos/mitchellh/vagrant/issues/7533","id":235234778,"user":{"login":"DanHam","id":4364798,"avatar_url":"https://avatars.githubusercontent.com/u/4364798?v=3","gravatar_id":"","url":"https://api.github.com/users/DanHam","html_url":"https://github.com/DanHam","followers_url":"https://api.github.com/users/DanHam/followers","following_url":"https://api.github.com/users/DanHam/following{/other_user}","gists_url":"https://api.github.com/users/DanHam/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHam/subscriptions","organizations_url":"https://api.github.com/users/DanHam/orgs","repos_url":"https://api.github.com/users/DanHam/repos","events_url":"https://api.github.com/users/DanHam/events{/privacy}","received_events_url":"https://api.github.com/users/DanHam/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T10:53:35Z","updated_at":"2016-07-26T10:53:35Z","body":"Apparently this has been known about for some time... \r\n\r\nIt's mentioned here #4590 and on the chef/bento github page [here](https://github.com/chef/bento#vmware-fusion-8-packer-systemd)\r\n\r\nReading some of the comments in #4590 it seems packer hard codes the ethernet0.pcislot - see [here](https://github.com/mitchellh/packer/blob/7ad8f33ddb66e4bd1cfbf8c41a62de2c026bbf7d/builder/vmware/iso/step_create_vmx.go#L131)\r\n"}}
{"actor":{"display_login":"DanHam"}}