From e44b840e3a6a475b2472e0e6c800393c30b303a2 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 5 Jan 2015 11:15:45 -0500 Subject: [PATCH] OpenStack driver enhancements * Log machine creation. * Typo in an error message :nail_care: * Shelve docker install output in /var/log. * Improve the docker installation error message. Also, keep it from interrupting the host creation, so that you can actually run `machine ssh` or `machine rm` on the host afterward. Signed-off-by: Ash Wilson --- drivers/openstack/client.go | 5 +++++ drivers/openstack/openstack.go | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/openstack/client.go b/drivers/openstack/client.go index 0c4c96a2fd..4329aa5206 100644 --- a/drivers/openstack/client.go +++ b/drivers/openstack/client.go @@ -59,6 +59,11 @@ func (c *GenericClient) CreateInstance(d *Driver) (string, error) { }, } } + + log.WithFields(log.Fields{ + "Name": d.MachineName, + }).Info("Creating server...") + server, err := servers.Create(c.Compute, keypairs.CreateOptsExt{ serverOpts, d.KeyPairName, diff --git a/drivers/openstack/openstack.go b/drivers/openstack/openstack.go index 4f4f0f4f94..bdc217a234 100644 --- a/drivers/openstack/openstack.go +++ b/drivers/openstack/openstack.go @@ -703,18 +703,24 @@ func (d *Driver) installDocker() error { if err := d.sshExec([]string{ `apt-get install -y curl`, - `curl -sSL https://get.docker.com | /bin/sh`, + `curl -sSL https://get.docker.com | /bin/sh >/var/log/docker-install.log 2>&1`, `service docker stop`, `curl -sSL https://ehazlett.s3.amazonaws.com/public/docker/linux/docker-1.4.1-136b351e-identity -o /usr/bin/docker`, `echo "export DOCKER_OPTS=\"--auth=identity --host=tcp://0.0.0.0:2376\"" >> /etc/default/docker`, `service docker start`, }); err != nil { - log.Error("Docker installation failed") + log.Error("The docker installation failed.") log.Error( - "The driver assume your instance is running Ubuntu. If this is no the case, you should use the ", - "option --openstack-docker-install=false when creating the machine and then install manually", + "The driver assumes that your instance is running Ubuntu. If this is not the case, you should ", + "use the option --openstack-docker-install=false (or --{provider}-docker-install=false) when ", + "creating a machine, and then install and configure docker manually.", ) - return err + log.Error( + `Also, you can use "machine ssh" to manually configure docker on this host.`, + ) + + // Don't return this ssh error so that host creation succeeds and "machine ssh" and "machine rm" + // are usable. } return nil }