machine icon indicating copy to clipboard operation
machine copied to clipboard

[Feature Request] ls should report daemon availability

Open nathanleclaire opened this issue 11 years ago • 11 comments

Currently the ls command reports whether a host is active, but it does not report daemon availability. machine ls should check using something like net.DialTimeout to see if the daemon is responding to requests as well as if the host is up.

nathanleclaire avatar Dec 08 '14 20:12 nathanleclaire

What's the use case for this? I'm concerned it would slow down machine ls for something that is not often used.

bfirsh avatar Dec 08 '14 20:12 bfirsh

Use case is if the instance has started but the daemon is not available. Examples where that might be possible:

  • Instance has started but something went wrong with daemon provisioning or startup that didn't get caught by machine (e.g. daemon just randomly goes down or has been stopped by an admin)
  • Port 2376 is blocked by a firewall when user changes networks etc.

Shouldn't be too bad of a slowdown if the calls are done concurrently with polling host status.

nathanleclaire avatar Dec 08 '14 22:12 nathanleclaire

I like the idea, but I'm trying to figure out why this might be useful for the user when viewing machine ls.

If machine ls says the machine is running, then they run a Docker command which can't connect to the Docker daemon, doesn't that imply one of those two things you said above? Why does it need to be in machine ls too?

I can see it would be clearer to display this in ls, but I'm trying to figure out how useful it is so we can weigh it up against slowing down machine ls.

bfirsh avatar Dec 08 '14 23:12 bfirsh

I can see this being useful from a user's perspective; in the case where you can clearly see what hosts are available and what aren't.

prologic avatar Dec 08 '14 23:12 prologic

Hm, perhaps it could go in a separate command or as an optional flag? The ultimate goal is simply to provide a way to quickly query daemon availability as well as machine status.

nathanleclaire avatar Dec 09 '14 01:12 nathanleclaire

What about something like inspect to show availability and anything else in the future while ls is kept simple?

On Monday, December 8, 2014, Nathan LeClaire [email protected] wrote:

Hm, perhaps it could go in a separate command or as an optional flag? The ultimate goal is simply to provide a way to quickly query daemon availability as well as machine status.

— Reply to this email directly or view it on GitHub https://github.com/docker/machine/issues/46#issuecomment-66218662.

ehazlett avatar Dec 09 '14 13:12 ehazlett

How about "machine diagnostics" that runs through a bunch of expensive checks. It could even call out to the drivers and they could check things like: is vbox installed, is my cloud service reachable, is my instance healthy, is the daemon running etc? Purely for debug.

johngossman avatar Dec 09 '14 19:12 johngossman

+1 to @johngossman -- maybe something like machine health staging that would report all of those -- daemon status, cloud service, etc.

ehazlett avatar Feb 26 '15 16:02 ehazlett

+1 @ehazlett like the sound of it

nathanleclaire avatar Feb 26 '15 22:02 nathanleclaire

This is fixed with https://github.com/docker/machine/pull/2442 docker-machine ls now displays the docker daemon version or an error if the daemon is not responding.

dgageot avatar Dec 07 '15 17:12 dgageot

:+1: :+1: :+1:

nathanleclaire avatar Dec 07 '15 18:12 nathanleclaire