network restart fails upon "vagrant up"

50 views
Skip to first unread message

Sergei Gerasenko

unread,
Feb 16, 2018, 1:59:03 PM2/16/18
to Vagrant
Hi,

I have the following definition for a VM:

  config.vm.define 'ipa-client-2' do |client_2|
    config
.vm.provider "virtualbox" do |vb|
     
# Display the VirtualBox GUI when booting the machine
      vb
.memory = "4000"
      vb
.gui = true
      vb
.name = 'ipa-client-2'
   
end
    client_2
.vm.network "private_network", :name => 'vboxnet1', ip: "172.240.0.4", auto_config: false
    client_2
.vm.hostname = 'ipa-client-2'
    config
.vm.provision :salt do |salt|
      salt
.masterless = true
      salt
.minion_config = "salt/minion"
      salt
.run_highstate = true
   
end
 
end

When i do vagrant up ipa-client-2, I get:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!


# Update sysconfig
sed
-i 's/\(HOSTNAME=\).*/\1ipa-client-2/' /etc/sysconfig/network


# Update DNS
sed
-i 's/\(DHCP_HOSTNAME=\).*/\1"ipa-client-2"/' /etc/sysconfig/network-scripts/ifcfg-*


# Set the hostname - use hostnamectl if available
echo
'ipa-client-2' > /etc/hostname
if command -v hostnamectl; then
  hostnamectl
set-hostname --static 'ipa-client-2'
  hostnamectl
set-hostname --transient 'ipa-client-2'
else
  hostname
-F /etc/hostname
fi


# Prepend ourselves to /etc/hosts
grep
-w 'ipa-client-2' /etc/hosts || {
  sed
-i'' '1i 127.0.0.1\tipa-client-2\tipa-client-2' /etc/hosts
}


# Restart network
service network restart




Stdout from the command:


/bin/hostnamectl
Restarting network (via systemctl):  [FAILED]




Stderr from the command:


Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.

It turns out it's because of the ifcfg-enp03s interface. It's defined like this:

# Generated by dracut initrd
NAME
="enp0s3"
DEVICE
="enp0s3"
ONBOOT
=yes
NETBOOT
=yes
UUID
="8924a5b0-f9f4-453b-910d-118a91dac1ec"
IPV6INIT
=yes
BOOTPROTO
=dhcp
TYPE
=Ethernet

If I move it out of the way, it starts working.

Is there something I can do to remove that interface before network restart?

Thanks

Alvaro Miranda Aguilera

unread,
Feb 16, 2018, 2:02:11 PM2/16/18
to vagra...@googlegroups.com
can you try with a different box?

if the box have the issue you need to fix the base box.

not sure what box are you using.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/f9da5409-5877-45fd-b72e-c4225abcea01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages