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

Move to chef/fedora-21 Beaker node #15

Closed
dfarrell07 opened this issue Jan 20, 2015 · 10 comments
Closed

Move to chef/fedora-21 Beaker node #15

dfarrell07 opened this issue Jan 20, 2015 · 10 comments

Comments

@dfarrell07
Copy link
Owner

I'm currently using a very un-official F21 Vagrant box for my F21 Beaker node. Eventually it'd be much better to move to an official-ish one, like chef/fedora-21. There are complicating factors, like the Chef box not being on Vagrantcloud yet. See details on #10.

@dfarrell07
Copy link
Owner Author

This Beaker nodespec config file:

HOSTS:
  fedora-21:
    roles:
      - master
    platform: fedora-21-x86_64
    box: chef/fedora-21
    box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box
    hypervisor: vagrant

CONFIG:
  log_level: verbose
  type: foss

Run with bundle exec rake fedora_21 produces this Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'chef/fedora-21'
    v.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box'
    v.vm.box_check_update = 'true'
    v.vm.network :private_network, ip: "10.255.61.161", :netmask => "255.255.0.0", :mac => "0800276DE14F"
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

With this output/failure:

[~/puppet-opendaylight]$ bundle exec rake fedora_21                                                                                                  13:29:34
RS_SET=fedora-21 bundle exec rake beaker
/usr/bin/ruby -I/home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib:/home/daniel/.gem/ruby/gems/rspec-support-3.1.2/lib /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/exe/rspec spec/acceptance --color
/home/daniel/.gem/ruby/gems/beaker-rspec-5.0.0/lib/beaker-rspec/helpers/serverspec.rb:12: warning: already initialized constant Module::VALID_OPTIONS_KEYS
/home/daniel/.gem/ruby/gems/specinfra-2.11.5/lib/specinfra/configuration.rb:4: warning: previous definition of VALID_OPTIONS_KEYS was here
Hypervisor for fedora-21 is vagrant
Beaker::Hypervisor, found some vagrant boxes to create
created Vagrantfile for VagrantHost fedora-21
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Setting the name of the VM: fedora-21yml_fedora-21_1422296997219_30643
==> fedora-21: Fixed port collision for 22 => 2222. Now on port 2201.
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
    fedora-21: Adapter 2: hostonly
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2201 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2201
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: Configuring and enabling network interfaces...
/home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor/vagrant.rb:166:in `block (2 levels) in vagrant_cmd': Failed to exec 'vagrant up' (RuntimeError)
    from /usr/share/ruby/open3.rb:217:in `popen_run'
    from /usr/share/ruby/open3.rb:99:in `popen3'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor/vagrant.rb:161:in `block in vagrant_cmd'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor/vagrant.rb:159:in `chdir'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor/vagrant.rb:159:in `vagrant_cmd'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor/vagrant.rb:121:in `provision'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/hypervisor.rb:68:in `create'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/network_manager.rb:48:in `block in provision'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/network_manager.rb:47:in `each_key'
    from /home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/network_manager.rb:47:in `provision'
    from /home/daniel/.gem/ruby/gems/beaker-rspec-5.0.0/lib/beaker-rspec/beaker_shim.rb:29:in `provision'
    from /home/daniel/.gem/ruby/gems/beaker-rspec-5.0.0/lib/beaker-rspec/spec_helper.rb:40:in `block in <top (required)>'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core.rb:81:in `configure'
    from /home/daniel/.gem/ruby/gems/beaker-rspec-5.0.0/lib/beaker-rspec/spec_helper.rb:5:in `<top (required)>'
    from /home/daniel/puppet-opendaylight/spec/spec_helper_acceptance.rb:1:in `require'
    from /home/daniel/puppet-opendaylight/spec/spec_helper_acceptance.rb:1:in `<top (required)>'
    from /home/daniel/puppet-opendaylight/spec/acceptance/class_spec.rb:1:in `require'
    from /home/daniel/puppet-opendaylight/spec/acceptance/class_spec.rb:1:in `<top (required)>'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `each'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:96:in `setup'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84:in `run'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
    from /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/exe/rspec:4:in `<main>'
/usr/bin/ruby -I/home/daniel/.gem/ruby/gems/rspec-core-3.1.7/lib:/home/daniel/.gem/ruby/gems/rspec-support-3.1.2/lib /home/daniel/.gem/ruby/gems/rspec-core-3.1.7/exe/rspec spec/acceptance --color failed
rake aborted!
Command failed with status (1): [RS_SET=fedora-21 bundle exec rake beaker...]
/home/daniel/puppet-opendaylight/Rakefile:62:in `block in <top (required)>'
Tasks: TOP => fedora_21
(See full trace by running task with --trace)

Copied into a fresh dir and vagrant up'd fails with this:

[~/f21]$ rm -rf Vagrantfile
[~/f21]$ cp ~/puppet-opendaylight/.vagrant/beaker_vagrant_files/fedora-21.yml/Vagrantfile .
[~/f21]$ vagrant destroy -f
==> fedora-21: Forcing shutdown of VM...
==> fedora-21: Destroying VM and associated drives...
[~/f21]$ vagrant up
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1422297273065_95692
==> fedora-21: Fixed port collision for 22 => 2222. Now on port 2200.
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
    fedora-21: Adapter 2: hostonly
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2200 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2200
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: 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:

Editing the Vagrantfile to remove the network config line fixes things:

[~/f21]$ vim Vagrantfile                                                                                                                             13:35:33
[~/f21]$ cat Vagrantfile                                                                                                                             13:36:43
Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'chef/fedora-21'
    v.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box'
    v.vm.box_check_update = 'true'
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end
[~/f21]$ vagrant destroy -f                                                                                                                          13:36:46
==> fedora-21: Forcing shutdown of VM...
==> fedora-21: Destroying VM and associated drives...
[~/f21]$ vagrant up                                                                                                                                  13:37:03
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1422297431722_1818
==> fedora-21: Fixed port collision for 22 => 2222. Now on port 2200.
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2200 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2200
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: Mounting shared folders...
    fedora-21: /vagrant => /home/daniel/f21

@dfarrell07
Copy link
Owner Author

The F21 Vagrant box (without the network line, to make it work) shows this networking info:

[vagrant@fedora-21 ~]$ ip addr s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:c5:bf:a9 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 85980sec preferred_lft 85980sec
    inet6 fe80::a00:27ff:fec5:bfa9/64 scope link 
       valid_lft forever preferred_lft forever

Note that the ether interface is called enp0s3, not eth1, as expected/used by Vagrant:

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

@dfarrell07 dfarrell07 removed this from the Release on Forge milestone Jan 27, 2015
@electrical
Copy link

I had a same issue with a CentOS 7 box, updating Vagrant it self fixed the issue for me.

@dfarrell07
Copy link
Owner Author

I had a same issue with a CentOS 7 box, updating Vagrant it self fixed the issue for me.

Thanks for the data point!

I upgraded from 1.6.5 to 1.7.2. Unfortunately, I'm seeing the same issue.

[~/f21]$ vagrant up
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Checking if box 'chef/fedora-21' is up to date...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1422986249191_70235
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
    fedora-21: Adapter 2: hostonly
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2222 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2222
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
    fedora-21: 
    fedora-21: Vagrant insecure key detected. Vagrant will automatically replace
    fedora-21: this with a newly generated keypair for better security.
    fedora-21: 
    fedora-21: Inserting generated public key within guest...
    fedora-21: Removing insecure key from the guest if its present...
    fedora-21: Key inserted! Disconnecting and reconnecting using new SSH key...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: 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:


[~/f21]$ vagrant --version
Vagrant 1.7.2
[~/f21]$ cat Vagrantfile                                                                                                                      13:01:12
Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'chef/fedora-21'
    v.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box'
    v.vm.box_check_update = 'true'
    v.vm.network :private_network, ip: "10.255.14.40", :netmask => "255.255.0.0", :mac => "080027FCA124"
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

Again, remove the network-related line (created by Beaker) lets the box work:

[~/f21]$ vagrant destroy -f
==> fedora-21: Forcing shutdown of VM...
==> fedora-21: Destroying VM and associated drives...
[~/f21]$ cat Vagrantfile                                                                                                                      13:02:29
Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'chef/fedora-21'
    v.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box'
    v.vm.box_check_update = 'true'
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end
[~/f21]$ vagrant up
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Checking if box 'chef/fedora-21' is up to date...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1422986563533_19865
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2222 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2222
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
    fedora-21: 
    fedora-21: Vagrant insecure key detected. Vagrant will automatically replace
    fedora-21: this with a newly generated keypair for better security.
    fedora-21: 
    fedora-21: Inserting generated public key within guest...
    fedora-21: Removing insecure key from the guest if its present...
    fedora-21: Key inserted! Disconnecting and reconnecting using new SSH key...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: Mounting shared folders...
    fedora-21: /vagrant => /home/daniel/f21

It looks like I need to figure out why Beaker is adding that network-related line, and potentially prevent it from doing so. Alternatively/additionally, need to check why Vagrant is using eth1 instead of an actual interface.

@electrical
Copy link

That's weird because i use beaker as well and worked fine when booting up my CentOS 7 box.. must admit i haven't tried F21.

@dfarrell07
Copy link
Owner Author

That's weird because i use beaker as well and worked fine when booting up my CentOS 7 box.. must admit i haven't tried F21.

Yeah, CentOS 7 is working fine (also using Beaker). Also strange, the TFDuesing/Fedora-21 box doesn't show this issue.

@dfarrell07
Copy link
Owner Author

Also strange, the TFDuesing/Fedora-21 box doesn't show this issue.

Note that TFDuesing/Fedora-21 isn't totally working, as described on #32.

@dfarrell07
Copy link
Owner Author

Going to re-visit this as an attempt at fixing #63.

@dfarrell07
Copy link
Owner Author

This is blocked. We can't get feedback about the success/failure of base-box change until #63 is unblocked and the F21 tests work.

@dfarrell07
Copy link
Owner Author

I've update all the Vagrant boxes in the last few commits. This is now irrelevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants