Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network configurations check fail for RHEL7 #4450

Closed
nZac opened this issue Sep 3, 2014 · 19 comments · Fixed by #4462
Closed

Network configurations check fail for RHEL7 #4450

nZac opened this issue Sep 3, 2014 · 19 comments · Fixed by #4462

Comments

@nZac
Copy link

nZac commented Sep 3, 2014

OS: RHEL7
Vagrant: built from master to avoid #4438
Box: opscode/bento RHEL 7 (without chef.sh)
Possible duplicates of: #4259, #4195. #4078
Similar to: #2955

I am having one heck of a time getting a RHEL box up and running. The most recent of issues is:

==> dev: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.

Stderr from the command:

The network configuration for this is:

  # Dev machine
  config.vm.define "dev" do |dev|
    dev.vm.network :private_network, ip: "192.168.20.90"
  end

I should note that the box does come up and I can vagrant ssh into it.

Any thoughts on the error?

@biemond
Copy link

biemond commented Sep 4, 2014

I also got an error with centos 7.0 when adding a private network like this
admin.vm.network :private_network, ip: "10.10.10.10"

/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:23:in `configure_networks_rhel7': wrong number of arguments (1 for 2) (ArgumentError)
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:17:in `configure_networks'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `capability'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/guest.rb:43:in `capability'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/network.rb:132:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

f4ee476#diff-c09c88e789bdb0c2c0ebc8d12cccf55dR26

Ruby stupidly treats a file like a directory in traversal (i.e. File.expand_path(".", __FILE__) == __FILE__), which this line is missing an extra ..

@biemond your specific error is from the 1.6.4 tag, which has had a fix for that in #4438, unrelated to the new issue @nZac is reporting

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

PR at #4461

Sorry for not going through testing the original fix for #4438 and finding this sooner. I've worked out how to use Vagrant as a gem so I can test this, and with this fix it succeeds in vagrant uping CentOS 7 (whereas similarly to RHEL7 it errored before)

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

hmm, actually @nZac's issue is different to the one I had (mine was just failing to attempt to load /path/to/gems/vagrant-1.6.4/plugins/guests/redhat/fedora/cap/configure_networks

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

I can confirm, there's two issues, one for each flavor:

@biemond
Copy link

biemond commented Sep 4, 2014

Thanks

these 3 changes worked for me , now only got this issue #4352 over , it calls homenamectl and not hostnamectl plus does not set the new hostname in /etc/hosts

    def self.configure_networks(machine, networks)
      case machine.guest.capability("flavor")
      when :rhel_7
        configure_networks_rhel7(machine, networks)  <!------
      else
        configure_networks_default(machine, networks) <!------
      end
    end

    def self.configure_networks_rhel7(machine, networks)
      # This is kind of jank but the configure networks is the same
      # as Fedora at this point.
      require File.expand_path("../../../fedora/cap/configure_networks", __FILE__) <!------
      ::VagrantPlugins::GuestFedora::Cap::ConfigureNetworks.
        configure_networks(machine, networks)
    end

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

My RHEL 7 RC VM (not got a full release available due to 30 day trial expiring) has a /etc/redhat-release of:
Red Hat Enterprise Linux Server release 7.0 (Maipo)

@nZac
Copy link
Author

nZac commented Sep 4, 2014

@andytson, is this ready to test?

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

I believe more work is needed to support each RHEL flavor to match all supported /etc/redhat-release formats as this doesn't cover it: CentOS|Red Hat Enterprise) Linux release 7
https://github.com/mitchellh/vagrant/blob/master/plugins/guests/redhat/cap/flavor.rb#L14

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

perhaps (CentOS|Red Hat Enterprise) Linux.+release 7 (although RHEL 70 users will be cursing us in the future)

@nZac
Copy link
Author

nZac commented Sep 4, 2014

I am not nearly as familiar with Vagrant internals nor Ruby. If I can provide any additional information to assist in testing or debugging I am happy too!

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

I'm struggling to find the sources for each redhat-release rpm since they moved it all over to git.centos.org and not accurately said which project its in (they point to the CentOS source which isn't correct), but looking at their former ftp directory structure there are 4 RHEL variants that will have different /etc/redhat-release content:

http://ftp.redhat.com/pub/redhat/linux/enterprise/

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

I think Redhat merging CentOS into their organisation has gotten around the GPL issue by only referencing CentOS's source rather than RHEL's as they used to maybe.

mitchellh added a commit that referenced this issue Sep 4, 2014
…aversal-fix

guests/redhat: Fixes #4450, add another expand_path ../ to get back to the guests directory
@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

@mitchellh please can you reopen this ticket, it turns out my fix is for CentOS7, although needed, isn't the issue RHEL7 is currently getting (though will be once this issue is fixed)

@mitchellh mitchellh reopened this Sep 4, 2014
@mitchellh
Copy link
Contributor

Yep, done :)

@andytson
Copy link
Contributor

andytson commented Sep 4, 2014

^ PR for the fix.

I've tested against both RHEL 7 Server and CentOS 7, but obviously not RHEL 7 Client/ComputeNode/Workstation

@kikitux
Copy link
Contributor

kikitux commented Sep 5, 2014

@andytson What kind of information do you need from those channels?

I have a subscription to a lot of channels that cover Server/workstation, etc.

@andytson
Copy link
Contributor

andytson commented Sep 5, 2014

@kikitux I was thinking just checking the SRPMS for each RHEL7 flavour's redhat-release, to make sure the /etc/redhat-release they add all conform to the same regular expression as my PR. I expect they will.

i.e.

@nZac
Copy link
Author

nZac commented Sep 8, 2014

@andytson, Thanks for all your work on this, it 1.6.5 works as expected!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants