ggiamarchi / vagrant-openstack-provider

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

Creating multiple machines and Openstack token expiry #322

Open ghost opened 7 years ago

ghost commented 7 years ago

When creating (and provisioning) more than one VM with the command:

vagrant up --provider=openstack machine1 machine2

Vagrant crashes if the process of creating and provisioning "machine1" takes longer than the expiration of the Openstack token. The output of the crash can be seen on this gist I've created: https://gist.github.com/degano/3c9c5aca16c50906d0cce03974049a1e

Of course the easy workaround is to just split the machines creation in two calls to "vagrant up", however, while the creation of multiple machines in a single command is supported, perhaps, the auth token could be refreshed before trying to spawn the second machine.

Tested on vagrant-openstack-provider 0.9.0, Vagrant 1.8.5, ruby 2.3.1. In my particular case the Openstack token expiry time is 1 hour and the first machine takes around 80 minutes to be spawned and fully provisioned on our infrastructure.

ggiamarchi commented 7 years ago

@degano Yes, that's right. I was aware of this wickness already but i don't remember if we got an issue open on that or not.

By the way, the good solution would be to replay an authentication request and retry the failed call when we got 401 response from any OpenStack HTTP call.