brooklyncentral / clocker

Apache Brooklyn cloud native infrastructure blueprints
Apache License 2.0
428 stars 66 forks source link

`installDevUrandom=true` does not work on Docker hosts #273

Closed googlielmo closed 8 years ago

googlielmo commented 8 years ago

When creating a Docker host on a location having installDevUrandom=true, the /dev/random device node is not found to be a symbolic link to /dev/urandom. This may affect SSH and/or Clocker performance.

Evidence suggests that the VM is provisioned correctly to begin with, but then a kernel update takes place, and this has the effect to revert all of the '/dev' device nodes to their pristine state.

To prove this, I provisioned an Ubuntu VM from Brooklyn with that flag set, and manually installed the same kernel as Clocker does at https://github.com/brooklyncentral/clocker/blob/d7d7d6c866cc4bcee1d7df9e238c002e3f10e912/docker/src/main/java/brooklyn/entity/container/docker/DockerHostSshDriver.java#L195

This is what I get:

root@NY1ZZD2CS115:/# ll /dev/*rand*
lrwxrwxrwx 1 root root   12 Apr  4 15:29 /dev/random -> /dev/urandom
crw-rw-rw- 1 root root 1, 8 Apr  4 15:25 /dev/random-real
crw-rw-rw- 1 root root 1, 9 Apr  4 15:25 /dev/urandom
root@NY1ZZD2CS115:/# apt-get install software-properties-common linux-generic-lts-vivid
root@NY1ZZD2CS115:/# reboot

...

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.19.0-56-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Tue Apr  5 09:49:02 2016 from 93.61.99.89
root@NY1ZZD2CS115:~# uname -a
Linux NY1ZZD2CS115 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
root@NY1ZZD2CS115:~# ll /dev/*rand*
crw-rw-rw- 1 root root 1, 8 Apr  5 13:00 /dev/random
crw-rw-rw- 1 root root 1, 9 Apr  5 13:00 /dev/urandom
aledsage commented 8 years ago

This sounds related to https://github.com/brooklyncentral/clocker/issues/267

grkvlt commented 8 years ago

Yes, that's what I was thinking @aledsage - will investigate further later

grkvlt commented 8 years ago

Should be fixed by commit ab0a29e5084ba2603c66cd4ca5b92c9102940647