Since the content of `struct Driver` is serialized to disk, any change
is problematic. A workaround is to keep using the `SecurityGroup` member
as a string (a comma-separated list of security groups).
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Without this feature, when a user needs a specific security group (i.e
most of the time if they want to expose a service to Internet), they
need to copy the rules needed for Docker itself into each custom
group. With this feature, they can spawn new instances with
`--exoscale-security-group docker-machine,my-custom-group`.
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Waiting for a job to complete is split into a dedicated function,
outside of `waitForVM()`. Functions only waiting for the job to complete
will use this new function instead. The "job is done" testing logic is
also casted into a separate function.
The original `waitForVM()` function is now waiting for the job to
complete, then retrieve the VM. This introduces an extra API call which
could be avoided by having a `waitForJob()` return the last response but
this makes the code simpler for other users and adding a special variant
just for that seems to be overkill.
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Instead of using a custom loop, use the newly introduced
`utils.WaitForSpecificOrError` function. Beware that on success, we use
the successful response to get the VM object (outside the loop).
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Otherwise, the timeout is reached far too soon: instead of waiting for
the VM for two minutes, we wait only for a couple of seconds.
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Otherwise, when recreating a machine with the same name, we would get an
error about this SSH keypair already existing.
To avoid any confusion, let's say that machine will handle all keypairs
and the user cannot provide its own. Therefore, move the keypairs into
their own "namespace" and remove the option to specify a keypair.
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
- Add a call to GetState() in GetIP() to bail if the machine is stopped,
similar to how it is done in the virtualbox driver.
- Add tests for `url` and `env` commands.
Fixes#1168
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
I struggled to figure out why a machine create was failing, and
eventually asked if anyone else had seen the vague error I was getting:
"Error creating machine: Process exited with: 100. Reason was: ()"
It is immensely helpful if we log the command output instead of
just the rc.
It would also have been useful if the driver providers used the output, but
this covers most scenarios since they don't.
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>