UtahDave / salt-vagrant-demo

Demo of Salt in Vagrant. 1 master and 2 minions
Apache License 2.0
247 stars 192 forks source link

centos-7.2 minion2 failure... #30

Closed theWizK closed 8 years ago

theWizK commented 8 years ago

I tried using the centos-7.2 flavor for minion 2 in the demo, and it ended up like this:

==> minion2: Successfully added box 'bento/centos-7.2' (v2.2.9) for 'virtualbox'! ==> minion2: Importing base box 'bento/centos-7.2'... ==> minion2: Matching MAC address for NAT networking... ==> minion2: Checking if box 'bento/centos-7.2' is up to date... ==> minion2: Setting the name of the VM: salt-vagrant-demo_minion2_1471580390978_72215 ==> minion2: Fixed port collision for 22 => 2222. Now on port 2201. ==> minion2: Clearing any previously set network interfaces... ==> minion2: Preparing network interfaces based on configuration... minion2: Adapter 1: nat minion2: Adapter 2: hostonly ==> minion2: Forwarding ports... minion2: 22 (guest) => 2201 (host) (adapter 1) ==> minion2: Running 'pre-boot' VM customizations... ==> minion2: Booting VM... ==> minion2: Waiting for machine to boot. This may take a few minutes... minion2: SSH address: 127.0.0.1:2201 minion2: SSH username: vagrant minion2: SSH auth method: private key minion2: Warning: Remote connection disconnect. Retrying... minion2: minion2: Vagrant insecure key detected. Vagrant will automatically replace minion2: this with a newly generated keypair for better security. minion2: minion2: Inserting generated public key within guest... minion2: Removing insecure key from the guest if it's present... minion2: Key inserted! Disconnecting and reconnecting using new SSH key... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... minion2: Warning: Authentication failure. Retrying... Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the machine. These errors are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well.

If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.

gapotts commented 8 years ago

I suspect you may be using vagrant 1.8.5 which has a bug in it related to generating the new ssh key for RedHat distros. See: https://github.com/mitchellh/vagrant/issues/7610

It only affects RedHat distros because of the default umask that is set for the root account. The URL also has the fix in it. The official fix will be in the next release of the vagrant code.

Note: If you use a RedHat distro you will also need to tweak the iptables setting on the master or disable it altogether.

Below is what I did to fix iptables on my Centos 6.6 box: /sbin/iptables -I INPUT 5 -m state --state new -m tcp -p tcp --dport 4505 -j ACCEPT /sbin/iptables -I INPUT 6 -m state --state new -m tcp -p tcp --dport 4506 -j ACCEPT

You should also save the settings to /etc/sysconfig/iptables so they don't disappear on a reboot.

See here for more info on fixing firewall rules: https://docs.saltstack.com/en/latest/topics/tutorials/firewall.html

theWizK commented 8 years ago

Interesting.. I'll try both. Thanks for the info!

gapotts commented 8 years ago

Just keep in mind that the firewall stuff is only applicable to the master. If the master is a ubuntu box there is no need to tweak the firewall.

theWizK commented 8 years ago

In my case I was only using CentOS as one of the minions, so I don't believe that part is relevant to my setup. The details in the link you provided did get my environment up and running with a CentOS minion, however. Thanks!