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

Stuck at Waiting for VM to get an IP address... #120

Closed
GervaisdeM opened this issue Dec 3, 2020 · 20 comments
Closed

Stuck at Waiting for VM to get an IP address... #120

GervaisdeM opened this issue Dec 3, 2020 · 20 comments

Comments

@GervaisdeM
Copy link

I can't get my boxes to come up. They get stuck at Waiting for VM to get an IP address...

ovirt[add-ovirt*] % vagrant up     
Bringing machine 'default' up with 'ovirt4' provider...
==> default: Creating VM with the following settings...
==> default:  -- Name:          ovirt-vagrant-centos7-test.dgi
==> default:  -- Cluster:       Default
==> default:  -- Template:      vagrant-centos7-v4
==> default:  -- Console Type:  vnc
==> default:  -- BIOS Serial:   
==> default:  -- Optimized For: server
==> default:  -- Description:   
==> default:  -- Comment:       
==> default:  -- Additional Disks:
==> default:  ---- name=storage_disk_1 size=8 GB
==> default:  -- Memory:        
==> default:  ---- Memory:      4294 MB
==> default:  ---- Maximum:     4294 MB
==> default:  ---- Guaranteed:  1024 MB
==> default:  -- Cpu:           
==> default:  ---- Cores:       1
==> default:  ---- Sockets:     1
==> default:  ---- Threads:     2
==> default:  -- Cloud-Init:    true
==> default: Waiting for VM to become "ready" to start...
==> default: Checking disk status id=dbc633f7-d396-4121-9baf-1a7168c0b339 name=ovirt-centos7_Disk1 status=locked
==> default: Checking disk status id=dbc633f7-d396-4121-9baf-1a7168c0b339 name=ovirt-centos7_Disk1 status=locked
==> default: Checking disk status id=dbc633f7-d396-4121-9baf-1a7168c0b339 name=ovirt-centos7_Disk1 status=locked
==> default: Checking disk status id=dbc633f7-d396-4121-9baf-1a7168c0b339 name=ovirt-centos7_Disk1 status=locked
==> default: Checking disk status id=dbc633f7-d396-4121-9baf-1a7168c0b339 name=ovirt-centos7_Disk1 status=ok
==> default: Added storage disk id=5c49093b-726c-488a-8b76-334ae7d4b8ad name=storage_disk_1 size=8589934592
==> default: Checking disk status id=5c49093b-726c-488a-8b76-334ae7d4b8ad name=storage_disk_1 status=locked
==> default: Checking disk status id=5c49093b-726c-488a-8b76-334ae7d4b8ad name=storage_disk_1 status=ok
==> default: Starting VM.
==> default: Waiting for VM to get an IP address...

The box does come up though and does display properly in the ovirt-engine web interface.
vagrant-ovirt4

Hitting control-c shuts down the vm and removes it as expected. Can someone help me debug what might be the issue?

Note:

  1. This is a brand new oVirt setup. I am testing a hyperconverged setup on a single server before I build my three server cluster (I need to ensure that this works before moving forward).
  2. We use class B /16 (255.255.0.0) style subnet -> Ovirt hosts and Ovirt-Hosted engine are configured to use a 255.255.0.0 subnet mask.
  3. DHCP and DNS are running on a separate server running dnsmasq and the vagrant vm is getting an IP from that server perfectly.

Also:

  1. Is there a way to set a timeout so that the terminal does not wait there forever?
  2. Anyone have this working with Ubuntu templates? I seem to be having issues with Ubuntu in oVirt and this is also a requirement for me.
@jeremytourville
Copy link

jeremytourville commented Dec 4, 2020

I am experiencing the same issue when using either my mgmt or vm network. I did have this SecGen project working in the past on oVirt 4.3. I can't say that is the issue though. I have also recently rebuilt my system to oVirt 4.4 on a single node so our situation is very similar.

@jeremytourville
Copy link

I tried a couple of things to test this:
#1 When I manually build the vm from template I get an IP address from DHCP. The ovirt-guest-agent is running in my vm and so I do not get the red exclamation.

#2 Just like you, I do get the red exclamation if Vagrant is building the VM.

I think my tests prove that my oVirt environment and template are running correctly. I even tried running the SecGen project by building a project folder first.
e.g.- ruby secgen.rb --ovirtuser admin@internal --ovirtpass my_pass --ovirt-url https://engine.idm.nac-issa.org/ovirt-engine/api --ovirt-cluster Default --ovirt-network ovirtmgmt --scenario scenarios/default_scenario.xml build-project -p /home/user/bin/SecGen/projects/default_scenario
Then, once the project is completed building I would change directory into the project folder and simply run "vagrant up". It seems the issue is Vagrant and plugin related somehow.

@GervaisdeM
Copy link
Author

@jeremytourville When vagrant brings up the vm, it has a red exclamation mark because the vm is running in "Run Once" mode, not because the guest additions are not working. Even when I up a box with vagrant, I see the ip address being displayed in the ovirt-engine and the guest additions are working properly when I ssh into the vm.

red-exclamation

I wonder if the api has changed. I'm not a ruby programmer, so excuse me if the following is not "right." It seems to work. I pulled down the code and put in some code to display the variables in vagrant-ovirt4/lib/vagrant-ovirt4/action/wait_till_up.rb as follows (line numbers included for reference):

 62 env[:ui].info("server: #{server}")
 63 env[:ui].info("nics_service: #{nics_service}")
 64 env[:ui].info("nics: #{nics}")
 65 env[:ui].info("ip_addr: #{ip_addr}")

Sure enough the ip_addr never gets populated. I'm still trying to work out why.

@jeremytourville
Copy link

@GervaisdeM Thanks for reminding me about run once mode expected behavior. I had forgotten about that as I rarely if ever run VMs in that manner for most of the work I do.

You said>>>"I wonder if the api has changed?" I'm not sure but I do know this was working for me previously in oVirt 4.3.

I'm going to ask a few programmer friends and see if we can hunt down the issue. Let's keep this thread updated with findings as we are both having the same issue.

@GervaisdeM
Copy link
Author

GervaisdeM commented Dec 14, 2020

@jeremytourville You get any further? I was off on other things for a few days.

It seems that this is the line that is failing to work:
https://github.com/myoung34/vagrant-ovirt4/blob/master/lib/vagrant-ovirt4/action/wait_till_up.rb#L60

Not sure if this is correct, but I changed this line so that it falls to multiple lines and put in a couple more env[:ui].info("this_var: #{this_var}") things like below... The code still loops, but I can see that it never gets past the nic_attachment part and never displays anything for dev

ip_addr = nics.collect { |nic_attachment|
  env[:ui].info("nic_attachment: #{nic_attachment}")
  env[:connection].follow_link(nic_attachment).collect { |dev|
    env[:ui].info("dev: #{dev}")
    dev.ips.collect { |ip|
      ip.address if ip.version == 'v4'
    } unless dev.ips.nil?
  }
}.flatten.reject { |ip| ip.nil? }.first rescue nil

Output looks like this:

==> default: Waiting for VM to get an IP address...
==> default: nic_attachment: #<OvirtSDK4::Nic:0x00007ff2d69b2280>
==> default: nic_attachment: #<OvirtSDK4::Nic:0x00007ff2d6304230>
==> default: nic_attachment: #<OvirtSDK4::Nic:0x00007ff2d631eb58>

I continue to get nowhere... Still not a ruby programmer 😀

@jeremytourville
Copy link

I haven't forgotten. I had mistakenly thought that some of the developers I know could program in Ruby. I guess not. I'll continue to check with my network. Surely somebody can give us a hand!

@GervaisdeM
Copy link
Author

@myoung34 Any ideas what is going on here?

@GervaisdeM
Copy link
Author

I hard coded the IP address by commenting out the line: https://github.com/myoung34/vagrant-ovirt4/blob/master/lib/vagrant-ovirt4/action/wait_till_up.rb#L60 and replacing it with ip_addr = "192.168.69.69" and then setting the IP address in my Vagrantfile to the same IP... Of course, I now gets past the waiting for ip step. It fails trying to rsync the vagrant dir (the next step). control-c stops it from destroying the box...

bundle exec vagrant ssh fails with:

 ✘ gervais@keypear  ~/Development/dgi/vagrant-ovirt4   v1.2.3 ●✚  bundle exec vagrant ssh
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

* Closing connection 0
The VM has not reported an IP address. Please ensure the ovirt-guest-agent is running and the machine is up.
* Closing connection 0

☝️ The guest additions are enabled and the IP is showing in the ovirt-engine gui. I can ssh to the box as the vagrant user.

bundle exec vagrant up tries to do the rsync again:

 ✘ gervais@keypear  ~/Development/dgi/vagrant-ovirt4   v1.2.3 ●✚  bundle exec vagrant up 
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

* Closing connection 0
* Closing connection 0
Bringing machine 'default' up with 'ovirt4' provider...
* Closing connection 0
==> default: VM is already up.
* Closing connection 0
* Closing connection 0
==> default: Rsyncing folder: /Users/gervais/Development/dgi/vagrant-ovirt4/ => /vagrant
==> default: Attempting to mkdir /vagrant
* Closing connection 0
/Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh.rb:215: warning: constant ::Fixnum is deprecated
/Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/cipher_factory.rb:97: warning: constant OpenSSL::Cipher::Cipher is deprecated
#<Thread:0x00007ff619200398@/Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/batch_action.rb:71 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	54: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
	53: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:186:in `action'
	52: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:186:in `call'
	51: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/environment.rb:567:in `lock'
	50: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:200:in `block in action'
	49: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:225:in `action_raw'
	48: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `run'
	47: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/busy.rb:19:in `busy'
	46: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `block in run'
	45: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builder.rb:116:in `call'
	44: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	43: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
	42: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	41: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	40: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	39: from /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/connect_ovirt.rb:32:in `call'
	38: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	37: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/call.rb:53:in `call'
	36: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `run'
	35: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/busy.rb:19:in `busy'
	34: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `block in run'
	33: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builder.rb:116:in `call'
	32: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	31: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
	30: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
	29: from /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:18:in `call'
	28: from /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:18:in `each'
	27: from /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:38:in `block in call'
	26: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:250:in `sudo'
	25: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:213:in `execute'
	24: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:370:in `connect'
	23: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/retryable.rb:17:in `retryable'
	22: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:371:in `block in connect'
	21: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
	20: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	19: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	18: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
	17: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
	16: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:397:in `block (2 levels) in connect'
	15: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh.rb:225:in `start'
	14: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh.rb:225:in `new'
	13: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:87:in `initialize'
	12: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:215:in `wait'
	11: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:215:in `loop'
	10: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:217:in `block in wait'
	 9: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:180:in `poll_message'
	 8: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:180:in `loop'
	 7: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:202:in `block in poll_message'
	 6: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:146:in `accept_kexinit'
	 5: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:191:in `send_kexinit'
	 4: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:200:in `proceed!'
	 3: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:356:in `exchange_keys'
	 2: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:356:in `new'
	 1: from /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:51:in `initialize'
/Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:118:in `generate_key': undefined method `p=' for #<OpenSSL::PKey::DH:0x00007ff61a214e78> (NoMethodError)
Did you mean?  p
bundler: failed to load command: vagrant (/Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bin/vagrant)
NoMethodError: undefined method `p=' for #<OpenSSL::PKey::DH:0x00007ff61a214e78>
Did you mean?  p
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:118:in `generate_key'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:51:in `initialize'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:356:in `new'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:356:in `exchange_keys'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:200:in `proceed!'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:191:in `send_kexinit'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/algorithms.rb:146:in `accept_kexinit'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:202:in `block in poll_message'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:180:in `loop'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:180:in `poll_message'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:217:in `block in wait'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:215:in `loop'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:215:in `wait'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh/transport/session.rb:87:in `initialize'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh.rb:225:in `new'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/gems/net-ssh-3.0.2/lib/net/ssh.rb:225:in `start'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:397:in `block (2 levels) in connect'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:371:in `block in connect'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/retryable.rb:17:in `retryable'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:370:in `connect'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:213:in `execute'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/plugins/communicators/ssh/communicator.rb:250:in `sudo'
  /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:38:in `block in call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:18:in `each'
  /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/sync_folders.rb:18:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builder.rb:116:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `block in run'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/busy.rb:19:in `busy'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `run'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/call.rb:53:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/lib/vagrant-ovirt4/action/connect_ovirt.rb:32:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/warden.rb:34:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/builder.rb:116:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `block in run'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/util/busy.rb:19:in `busy'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/action/runner.rb:66:in `run'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:225:in `action_raw'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:200:in `block in action'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/environment.rb:567:in `lock'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:186:in `call'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/machine.rb:186:in `action'
  /Users/gervais/Development/dgi/vagrant-ovirt4/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-4572267c33f4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

@myoung34
Copy link
Owner

I can look around, but unfortunately I no longer run ovirt so I dont have access to much of the debugging ability.

@myoung34
Copy link
Owner

myoung34 commented Dec 30, 2020

as for the debugging:

==> default: nic_attachment: #<OvirtSDK4::Nic:0x00007ff2d69b2280> this is because youre printing the Nic object, not a function/attribute on the object. Unfortunately the ovirt sdk is generated off the API so there's no nic.rb to look into. you'd have to use the debugger to break there and do something like

p variable.inspect where variable is the nic object

My gut feeling here is that there's something related to the network or guest agent causing this and even if i got it up it would work with my set up. The only thing I can think of is to try to get the VM to sleep as long as possible and try to inspect it at the hardware level (see if it's getting an IP off DHCP, etc) or try to use the same settings youre using if you launch manually to get it to work with the vagrant plugin

@daFritz84
Copy link

Hi, I did a bit of debugging with pry and came up with a fix #121
Please note that this does not fix the rsync issues as reported by @GervaisdeM

@jeremytourville
Copy link

I just tried this after the merge request was committed. I downloaded the zip file again and installed. I presume that should update the code on my machine with the newest fix. I didn't have any luck I am still getting waiting for IP address. I am running oVirt 4.4.x on CentOS 8.2 or 8.3 My VM that has the ovirt4 extension is Ubuntu 18.04 LTS.

@daFritz84
Copy link

Have you double checked that the new code from the zip file is actually used?
I did this by modifying one of the strings locales/en.yml.

E.g. just rename

    waiting_for_ip: |-
      Waiting for VM to get an IP address...

to

    waiting_for_ip: |-
      Test

If vagrant uses the fixed version from the merge request, it should now print out Test instead of Waiting for VM to get an IP address...

@jeremytourville
Copy link

I checked to find out where the yml file is located. Which one do I need to edit? (see below)
So far I have edited -
/home/user/vagrant-ovirt4-master/locales/en.yml
as Test 1
/home/user/bin/SecGen/vagrant-ovirt4/locales/en.yml
as Test 2

Presently, I am still getting the Waiting for VM to get an IP address... message when I run vagrant up from within my SecGen projects folder. I even deleted all my SecGen projects and recreated one after I had installed the fix from #123

$sudo find / -name en.yml
/var/lib/gems/2.5.0/gems/faker-1.9.3/lib/locales/en.yml
/var/lib/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/locale/en.yml
/home/user/bin/SecGen/vagrant-ovirt4/locales/en.yml
/home/user/.vagrant.d/gems/2.4.9/gems/vagrant-ovirt4-1.2.3/locales/en.yml
/home/user/vagrant-ovirt4-master/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/i18n-1.1.1/test/test_data/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/pushes/local-exec/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/pushes/heroku/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/pushes/atlas/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/pushes/ftp/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/commands/port/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/commands/cloud/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/commands/login/locales/en.yml
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/templates/locales/en.yml

@daFritz84
Copy link

daFritz84 commented Jan 5, 2021

Which folder contains the freshly pulled zip-file from this project?
/home/user/vagrant-ovirt4-master/locales/en.yml or /home/user/bin/SecGen/vagrant-ovirt4/locales/en.yml ?

Either way, if you renamed one as Test1 and the other as Test2 and you still get Waiting for IP address ... vagrant probably runs still the old unpatched version.

How did you install the patched version?
I did the following to get my environment up on Ubuntu 20.04:

bundle update --bundler
bundle install
gem build
sudo gem install ./vagrant-ovirt4-1.2.3.gem

@GervaisdeM
Copy link
Author

@daFritz84 🎉‼️ Amazing! This has sorted my immediate issues with the plugin. TY!! Your install method/tips that you sent @jeremytourville did not work for me on macOS, but I ran your code with bundle exec like I describe below for Jeremy. The commands above do not fail (although I had to run gem build vagrant-ovirt4.gemspec), but the plugin was not available to vagrant. ie. vagrant up complained about not having an oVirt provider. I had previously removed the plugin with vagrant plugin remove vagrant-ovirt4. Perhaps I need to reinstall it and then sudo gem install ./vagrant-ovirt4-1.2.3.gem

@jeremytourville since you have pulled the source code, you should be able to run the code from that dir like I did. Do a git pull (or whatever you need to do to get the latest code). Edit the Gemfile as follows:

source 'http://rubygems.org'

group :development do
  gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git'
  gem 'pry'
  gem 'byebug'
  gem 'pry-byebug'
end

group :plugins do
  gem 'vagrant-ovirt4', :path => '.'
end

Then run bundle install --path vendor/bundle to pull down dependancies. Put your test Vagrantfile in the same directory and then run bundle exec vagrant up.

@GervaisdeM
Copy link
Author

@myoung34 I'm going to do a bunch of testing and can report back if "everything" is working now with oVirt 4.4.4.5-1.el8 (what I am running) and can report back here before you push a new release of the plugin.

@GervaisdeM
Copy link
Author

@myoung34 I ran through testing all the Supported Commands (tested). Below are my results. Many of the issues don't really matter to me. I really just need my development team to be able to up and destroy boxes. Any chance that the ruby gem can get pushed (even as a beta) so that I can update my Vagrantfile (we have a very custom setup) and others in my group can vagrant plugin install vagrant-ovirt4?

@daFritz84 Any interest in seeing if you can sort out some of the issues? Adding support for vagrant snapshot restore would make those snapshot features much more usable, IMO. We don't have that support in our vSphere setup now, so it would give us added functionality (nice to have, but not import for our use case).

Testing results
vagrant up
-> works

vagrant destroy
-> works

vagrant ssh [-c '#command']
-> works

vagrant ssh-config
-> works

vagrant halt
-> works
-> vagrant up after halting the machine works

vagrant reload
-> If the vm is not up, it brings up the vm, halts it, and removes the vm.
-> if the vm is up, it halts the vm, brings it up, halts it, and removes the vm.

gervais@keypear  ~/Development/dgi/vagrant/ovirt   master ●  bundle exec vagrant reload i8manage_dev_ov
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

==> i8manage_dev_ov: VM is not running. Please run `vagrant up` first.
==> i8manage_dev_ov: Starting VM.
==> i8manage_dev_ov: Waiting for VM to get an IP address...
==> i8manage_dev_ov: Got IP: 192.168.169.173
==> i8manage_dev_ov: Got IP: 192.168.169.173
==> i8manage_dev_ov: Got IP: 192.168.169.173
==> i8manage_dev_ov: Got IP: 192.168.169.173
==> i8manage_dev_ov: Got IP: 192.168.169.173
==> i8manage_dev_ov: Machine is booted and ready for use!
==> i8manage_dev_ov: Halting VM...
==> i8manage_dev_ov: Waiting for VM to shutdown...
==> i8manage_dev_ov: Removing VM...
bundler: failed to load command: vagrant (/Users/gervais/Development/dgi/vagrant/ovirt/vendor/bundle/ruby/2.6.0/bin/vagrant)
OvirtSDK4::Error: The client is already closed

vagrant status
-> works

vagrant suspend
-> works

vagrant resume
-> See below. It resumes the vm (and looks good), but then halts it and removes it.

gervais@keypear  ~/Development/dgi/vagrant/ovirt   master ●  bundle exec vagrant resume i8_nopuppet_ov
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

==> i8_nopuppet_ov: Starting VM.
==> i8_nopuppet_ov: Waiting for VM to get an IP address...
==> i8_nopuppet_ov: Got IP: 192.168.169.186
==> i8_nopuppet_ov: Got IP: 192.168.169.186
==> i8_nopuppet_ov: Got IP: 192.168.169.186
==> i8_nopuppet_ov: Got IP: 192.168.169.186
==> i8_nopuppet_ov: Machine is booted and ready for use!
==> i8_nopuppet_ov: Halting VM...
==> i8_nopuppet_ov: Waiting for VM to shutdown...
==> i8_nopuppet_ov: Removing VM...

vagrant snapshot list
-> works

vagrant snapshot delete [id]
-> fails

 gervais@keypear  ~/Development/dgi/vagrant/ovirt   master ●  bundle exec vagrant snapshot delete i8_nopuppet_ov fun_snapshot 
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

==> i8_nopuppet_ov: Retrieving list of snapshots...
The snapshot name `fun_snapshot` was not found for the
virtual machine `i8_nopuppet_ov`.
 ✘ gervais@keypear  ~/Development/dgi/vagrant/ovirt   master ●  bundle exec vagrant snapshot list i8_nopuppet_ov         
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

==> i8_nopuppet_ov: Retrieving list of snapshots...
==> i8_nopuppet_ov: 
                                  id      description                          date
fb99c671-fe1d-4198-b678-b2e0fced6fd0     fun_snapshot     2021-01-08T11:45:10-04:00

vagrant snapshot save [description]
-> works

@daFritz84
Copy link

@GervaisdeM I will have a look and see what I can do 😄

If you don't mind, I prefer to split up each bug into its own little github issue with a backreference to this issue. As far as I'm concerned, the original cause of this issue has been resolved.

@GervaisdeM
Copy link
Author

The original issue that was reported on here has been resolved.
Closing this issue as new issues have been created for latest things found.

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