adb-vagrant-registration icon indicating copy to clipboard operation
adb-vagrant-registration copied to clipboard

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

Open dflock opened this issue 7 years ago • 4 comments

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)

dflock avatar Sep 27 '17 19:09 dflock

@dflock , Could you paste Vagrantfile as well?

brgnepal avatar Sep 28 '17 04:09 brgnepal

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

jayhendren avatar Apr 13 '18 18:04 jayhendren

Could this be related to #126?

ghyde avatar Apr 27 '18 14:04 ghyde

@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.

jayhendren avatar Apr 27 '18 16:04 jayhendren