Docker Community Forums

Share and learn in the Docker community.

Openstack/CoreOS fails for novice


(Ktwalrus) #1

I’m trying to create CoreOS VMs using the OpenStack driver from my Mac and running into issues. The machine is created:

kdh: docker-machine create --driver openstack vm
Running pre-create checks...
Creating machine...
(vm) Creating machine...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with coreOS...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env vm

And I can ssh to it:

kdh: docker-machine ssh vm
CoreOS alpha (1010.1.0)
core@vm ~ $ ls

But, I cannot use docker client on my mac to access the docker server on the vm:

kdh: eval $(docker-machine env vm)
kdh: docker ps
Error response from daemon: client is newer than server (client API version: 1.23, server API version: 1.22)

docker-machine upgrade has no effect:

kdh: docker-machine upgrade vm
Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Restarting docker...
kdh: docker info
Error response from daemon: client is newer than server (client API version: 1.23, server API version: 1.22)
kdh: docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Running   tcp://192.168.99.101:2376           v1.11.0
vm        *        openstack    Running   tcp://158.69.69.145:2376            v1.10.3
kdh: docker-machine ssh vm
Last login: Sun Apr 17 20:55:42 2016 from 98.169.179.37
CoreOS alpha (1010.1.0)
core@vm ~ $ docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 1.10.3
Storage Driver: overlay
 Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
 Volume: local
 Network: null host bridge
Kernel Version: 4.5.0-coreos-r1
Operating System: CoreOS 1010.1.0 (MoreOS)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.911 GiB
Name: vm
ID: 2PDM:ZHZR:UXVL:7KNJ:XNQN:BDFH:5JXM:LAYS:L6QG:YUO5:65FJ:PP66
Labels:
 provider=openstack

What am I doing wrong? Does docker-machine not support CoreOS? Why can’t a newer docker client talk to an older docker server? Seems very unfriendly since docker in production is likely to be older than docker on my laptop.


(Jeff Anderson) #2

Basically, a docker client can only talk to docker daemons that are older or the same version.

If you have an older docker daemon, you have to downgrade your client to match it. I tend to keep older versions of the docker client around for just this reason. I’ll temporarily downgrade in a single shell by doing something like alias docker=~/bin/docker-1.9.1


(Ktwalrus) #3

Basically, a docker client can only talk to docker daemons that are older or the same version.

Seems you said that backwards. A docker daemon can only talk with a docker client that is older or the same version?

Regardless, I downloaded a 1.10.3 client and can talk to the vm created by the openstack driver.

kdh: docker-machine upgrade vm1
Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Restarting docker...

Still upgrading the CoreOS vm to the latest version of docker doesn’t work. Maybe the CoreOS filesystem is read-only? Or, docker-machine doesn’t know how to upgrade docker on CoreOS?

This isn’t that important since CoreOS auto-updates the OS as new updates are released and I won’t be upgrading docker via docker-machine, but is it a bug that there was no indication that docker-machine doesn’t support updating docker on CoreOS?

Also, before I could use docker-machine in production (to launch openstack vms), I need to be able to provide a cloud-config (so the new vm is configured properly).

How do I specify a cloud-config file to the openstack driver?

That is, how to I add:

--user-data ./cloud-config.yaml

to launch the CoreOS vm using docker-machine?


(Jeff Anderson) #4

I just installed the latest stable version of coreos (currently CoreOS 899.15.0 according to https://coreos.com/os/docs/latest/booting-with-iso.html at time of writing), and it seems to have the following docker version installed:

Last login: Tue Apr 19 15:45:03 2016 from 10.0.2.2
CoreOS stable (899.15.0)
core@core-01 ~ $ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   9894698
 Built:
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   9894698
 Built:
 OS/Arch:      linux/amd64

(Ktwalrus) #5

I’m running with the latest Alpha Channel (currently CoreOS 1010.1.0). This has docker 1.10.3. They haven’t upgraded to docker 1.11.0 yet.

Regardless, I would still like to know how to specify a cloud-config.yaml file when creating a VM using the openstack driver and docker-machine?

I would like to be able to spin up CoreOS VMs with a properly configured etcd2 running as a systemd service. I suppose I could run etcd2 in containers (and other CoreOS base services), but provisioning a VM for CoreOS is best done using ignition and/or cloud-config. In the OpenStack API, you specify the cloud-config.yaml file as the --user-data file on server create. Docker-machine must have some way of passing this configuration file to OpenStack, right?