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

Registration doesn't happen on initial up, but works on subsequent halt/up's #125

Open
dflock opened this issue Sep 27, 2017 · 4 comments
Open

Comments

@dflock
Copy link

dflock commented Sep 27, 2017

When I initially run vagrant up a create a new box, registration doesn't happen, but if I then vagrant halt && vagrant up that box, unregistration & re-registration happen as expected:

Initial vagrant up

$ vagrant up dev --no-provision

Bringing machine 'dev' up with 'virtualbox' provider...
==> dev: Importing base box 'rhel-server-7.3'...
==> dev: Matching MAC address for NAT networking...
==> dev: Setting the name of the VM: dev_1506474739428_82725
==> dev: Clearing any previously set network interfaces...
==> dev: Preparing network interfaces based on configuration...
    dev: Adapter 1: nat
    dev: Adapter 2: bridged
==> dev: Forwarding ports...
    dev: 22 (guest) => 2222 (host) (adapter 1)
==> dev: Running 'pre-boot' VM customizations...
==> dev: Booting VM...
==> dev: Waiting for machine to boot. This may take a few minutes...
    dev: SSH address: 127.0.0.1:2222
    dev: SSH username: vagrant
    dev: SSH auth method: private key
==> dev: Machine booted and ready!
==> dev: Checking for guest additions in VM...
==> dev: Setting hostname...
==> dev: Configuring and enabling network interfaces...
    dev: SSH address: 127.0.0.1:2222
    dev: SSH username: vagrant
    dev: SSH auth method: private key
==> dev: Mounting shared folders...
    dev: /vagrant => /home/duncan/dev/tools/blah
==> dev: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
    HostManager: Processing dev ... 
    HostManager: Guest for dev (virtualbox) is Linux, HostManager IP: 10.129.2.115.
==> dev: Machine not provisioned because `--no-provision` is specified.

$ vagrant ssh dev
Last login: Fri Jun 23 16:03:46 2017
[vagrant@dev ~]$ sudo yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repolist: 0

Subsequent halt & up

$ vagrant halt dev

==> dev: Unregistering box with vagrant-registration...
==> dev: Attempting graceful shutdown of VM...

$ vagrant up dev --no-provision

Bringing machine 'dev' up with 'virtualbox' provider...
==> dev: Clearing any previously set forwarded ports...
==> dev: Clearing any previously set network interfaces...
==> dev: Preparing network interfaces based on configuration...
    dev: Adapter 1: nat
    dev: Adapter 2: bridged
==> dev: Forwarding ports...
    dev: 22 (guest) => 2222 (host) (adapter 1)
==> dev: Running 'pre-boot' VM customizations...
==> dev: Booting VM...
==> dev: Waiting for machine to boot. This may take a few minutes...
    dev: SSH address: 127.0.0.1:2222
    dev: SSH username: vagrant
    dev: SSH auth method: private key
    dev: Warning: Remote connection disconnect. Retrying...
==> dev: Machine booted and ready!
==> dev: Registering box with vagrant-registration...
==> dev: Checking for guest additions in VM...
==> dev: Setting hostname...
==> dev: Configuring and enabling network interfaces...
    dev: SSH address: 127.0.0.1:2222
    dev: SSH username: vagrant
    dev: SSH auth method: private key
==> dev: Mounting shared folders...
    dev: /vagrant => /home/duncan/dev/tools/blah
==> dev: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
    HostManager: Processing dev ... 
    HostManager: Guest for dev (virtualbox) is Linux, HostManager IP: 10.129.2.115.
==> dev: Machine not provisioned because `--no-provision` is specified.

Versions

$ vagrant --version
Vagrant 2.0.0

$ vagrant plugin list
vagrant-cachier (1.2.1)
vagrant-hostmanager (1.8.7)
vagrant-hosts (2.8.0)
vagrant-registration (1.3.1)
vagrant-share (1.1.9, system)
@coolbrg
Copy link
Contributor

coolbrg commented Sep 28, 2017

@dflock , Could you paste Vagrantfile as well?

@jayhendren
Copy link

jayhendren commented Apr 13, 2018

I'm having exactly the same issue. Unfortunately I can only recreate in a very particular environment, specifically a Jenkins job running TestKitchen, which is making it difficult for me to isolate the issue. Edit: I've been able to recreate this issue outside of Jenkins and TestKitchen, so it's not a problem specific to those environments.

Here is my environment:

$ vagrant --version
Vagrant 2.0.1
$ vagrant plugin list
vagrant-registration (1.3.1)
vagrant-share (1.1.9, system)

And here is my Vagrantfile (automatically generated by testkitchen):

Vagrant.configure("2") do |c|
  c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
  c.vm.box = "cub_rh7"
  c.vm.box_url = "https://********:********@********.*******.***/private/cub_rh7.json"
  c.vm.hostname = "testkitchen-cub-rh7.colorado.edu"
  c.vm.synced_folder ".", "/vagrant", disabled: true
  c.vm.provider :virtualbox do |p|
    p.customize ["modifyvm", :id, "--cpus", "2"]
    p.customize ["modifyvm", :id, "--memory", "2048"]
  end
end

@ghyde
Copy link

ghyde commented Apr 27, 2018

Could this be related to #126?

@jayhendren
Copy link

@ghyde probably not, because #126 is about a problem that's exclusive to RHEL 7.5, and this issue was filed many months before 7.5 was released.

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

No branches or pull requests

4 participants