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

[vcloud-director] is vm.wait.for implemented properly? #3694

Closed
mreferre opened this issue Sep 17, 2015 · 4 comments
Closed

[vcloud-director] is vm.wait.for implemented properly? #3694

mreferre opened this issue Sep 17, 2015 · 4 comments
Labels

Comments

@mreferre
Copy link

I am using this piece of code below to update the name of a VM. I noticed that the next operation (connecting the VM to the network) fails if I don't wait for the VM name update to complete (which takes like 10/15 seconds or so).

So I am trying to use the "wait.for" function to check when the VM is ready. If I use it like in the example below, it just waits 20 (or 50 or 100) seconds and then it says:
/usr/local/rvm/gems/ruby-2.2.1/gems/fog-core-1.32.1/lib/fog/core/wait_for.rb:9:in `block in wait_for': The specified wait_for timeout (100 seconds) was exceeded (Fog::Errors::TimeoutError)
If I don't specify any number after the wait, it will just stay there forever.

Is the wait.for implemented properly when used with the vcloud-director module? Or am I missing something in the syntax / flow?

Thanks.

....
....
vapp = vdc.vapps.get_by_name(inputvappname)
vm = vapp.vms.first

vm_id = vm.id
vcloud.put_vm(vm_id, "myvm", {})

vm.wait_for(20) { ready? }

vmnetwork = vm.network
vmnetwork.network = "DMZ"
vmnetwork.is_connected = true
vmnetwork.ip_address_allocation_mode = "POOL"
vmnetwork.save

@geemus
Copy link
Member

geemus commented Sep 22, 2015

@mikepea any chance you could share some insight?

@cstewart87
Copy link
Contributor

@mreferre - In the past, I've used wait_for without passing any value and it's worked just fine for me. Have you tried just using vm.wait_for { ready? } (without the specific time)?

@mreferre
Copy link
Author

Nope. If I just use vm.wait_for { ready? } it will stay there forever. It will never release control to the program.

@stale
Copy link

stale bot commented Jul 30, 2018

This issue has been automatically marked stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 30, 2018
@stale stale bot closed this as completed Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants