5

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)

nponeccop
  • 354
  • 3
  • 16
  • Do you have the Hyper-V Guest Integration Services installed? – EEAA Jan 07 '16 at 01:25
  • They are only kernel modules, and they all are already in the mainline kernel and loaded on my box. So yes, I have them installed and operating. – nponeccop Jan 07 '16 at 16:16

3 Answers3

4

I figured it out. drivers/hv/hv_util.c calls orderly_poweroff() from kernel/reboot.c which subsequently fails to find /sbin/poweroff and does only a minimal cleanup.

nponeccop
  • 354
  • 3
  • 16
0

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.

Some Dude
  • 101
  • 3
  • I have the modules loaded. They are in mainline kernel, so only distributions with very old kernels need backported modules from MS. – nponeccop Jan 07 '16 at 16:17
0

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.

Core
Integrated shutdown:
With this feature, an administrator can shut down virtual machines from the Hyper-V Manager. For more information, see Operating system shutdown.
Source: Feature Descriptions for Linux and FreeBSD virtual machines on Hyper-V

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.

Daniel
  • 6,940
  • 6
  • 33
  • 64
  • It's all open source (including code from Microsoft), so I have the right to know. Whether it's supported it is ittelevant as I'm not seeking support and just educating myself. I run a non-production Linux anyway. – nponeccop Jan 07 '16 at 16:18
  • 1
    I didn't say that you would not have a right to know. – Daniel Jan 07 '16 at 23:24