What mechanism Hyper-V use to signal a Linux guest to gracefully shut down?
Somehow CoreOS does gracefully shut down, but another Linux doesn't (it is just abruptly powered off)
What mechanism Hyper-V use to signal a Linux guest to gracefully shut down?
Somehow CoreOS does gracefully shut down, but another Linux doesn't (it is just abruptly powered off)
I figured it out.
drivers/hv/hv_util.c
callsorderly_poweroff()
fromkernel/reboot.c
which subsequently fails to find/sbin/poweroff
and does only a minimal cleanup.If i am not mistaken, Hyper v integration is what causes this. I have not used CoreOS but usually this is what causes your virtual server to shutdown correctly.
In terminal, issue the command lsmod. On CoreOS you will (if i am right) see that it lists Hyperv services(hv_vmbus, hv_netvsc, etc) on the other it does not. Some Linux distros come with it built in and others you can add it. If this is not it, comment below and i will delete this answer.
This does not answer your question as detailed, as you might want to know. I want to add this as an answer nonetheless, as the detailed technical answers comes close to be off-topic (non-supported environment).
You want to look at the documentation of Linux and FreeBSD Virtual Machines on Hyper-V on what distributions are supported. Check the section of the individual distribution and version and see, if the Core is supported.
If the distribution is not supported, it is not advised to use them in production. Even if there are ways to implement support on a non-listed distribution.