ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
245 stars 102 forks source link

Handling of asynchronous floating IP assignment #324

Closed softsilverwind closed 7 years ago

softsilverwind commented 7 years ago

Overview

When vagrant is run with an openstack-compatible backend which assigns floating IPs asynchronously, it fails with "Vagrant was unable to resolve a valid ip to ssh on your OpenStack instance".

This happens because vagrant-openstack-provider tries to get the assigned IP of the virtual machine immediately after sending the floating IP assignment command.

This issue was found when using vagrant with synnefo as the backend.

With this patch, vagrant will wait until the floating IP is assigned before continuing.

Notes

It should be noted that many implementations do not assume that the IP is immediately assigned, but wait/poll until it appears on the server information.

These include what Ansible and the official Shade library do. Here is a chain of calls that Ansible does:

  1. Ansible os_floating_ip.py:main
  2. Shade add_ips_to_server
  3. Shade _add_auto_ip
  4. Shade create_floating_ip
  5. Shade _neutron_create_floating_ip

Also, this patch will probably solve other issues, such as issue 278

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.6%) to 87.014% when pulling d0b43d558a650a8447030829d5830f6d3ca6176f on softsilverwind:synnefo-integration into d91b1cb6126fa8796579e7744cf38975e4f950bc on ggiamarchi:master.

kpelelis commented 7 years ago

bump

ggiamarchi commented 7 years ago

LGTM ! @softsilverwind Good catch !