omniosorg / zadm

zone management tool
https://omnios.org/setup/zadm
GNU General Public License v3.0
23 stars 8 forks source link

ACPI Shutdown Not Working (bhyve, kvm) #129

Closed justledbetter closed 2 years ago

justledbetter commented 2 years ago

When I bring my systems down for maintenance, my expectation is that the reboot command will send a shutdown signal to my virtual machines (mostly bhyve, but some are also kvm) and wait for them to gracefully halt before rebooting the system.

Instead, what I am seeing is that the system just reboots.

When I try to manually run zadm shutdown <zonename>, nothing happens: The virtual machines continue running as if nothing happened, and the only way to get them to actually shut down is to log into the guest operating system (a mix of Windows, FreeBSD, and Linux), and shut them down manually in there.

citrus-it commented 2 years ago

Does fixing your other issue with the system/zones service resolve this? That service is also responsible for graceful shutdown.

In general on an OmniOS system, I would also prefer init 6 over reboot, as it does more graceful shutdown tasks before calling reboot if I remember correctly.

justledbetter commented 2 years ago

I'm still seeing issues with a bhyve Windows VM not receiving any shutdown signals from zadm when I use the shutdown command to it. Watching the Windows SAC console while issuing the command, I'm not seeing anything happen. Issuing the shutdown command to SAC via the console does tell the VM to poweroff, though. Could it be a misconfiguration in my zone? Partially sanitized configuration follows below, any guidance you can provide on recommended next steps for tracing would, as always, be immensely appreciated!

{
   "acpi" : "on",
   "autoboot" : "true",
   "bootargs" : "",
   "bootdisk" : {
      "blocksize" : "8K",
      "path" : "vm/<name>/root",
      "size" : "60G",
      "sparse" : "true"
   },
   "bootorder" : "cd",
   "bootrom" : "BHYVE",
   "brand" : "bhyve",
   "cloud-init" : "on",
   "diskif" : "virtio-blk",
   "fs-allowed" : "",
   "hostbridge" : "i440fx",
   "hostid" : "",
   "ip-type" : "exclusive",
   "limitpriv" : "default",
   "net" : [
      {
         "global-nic" : "<adapter>0",
         "physical" : "<name>0"
      }
   ],
   "netif" : "virtio-net-viona",
   "pool" : "",
   "ram" : "2G",
   "resolvers" : [
      "<localrouter>"
   ],
   "rng" : "off",
   "scheduling-class" : "",
   "type" : "windows",
   "uefivars" : "on",
   "vcpus" : "2",
   "vnc" : {
      "enabled" : "on"
   },
   "xhci" : "on",
   "zonename" : "<name>",
   "zonepath" : "/vm/<name>"
}
hadfl commented 2 years ago

I don't think that the zone config matters. And zadm does not really do any magic in the shutdown case but just calls zoneadm -z <zone_name> shutdown.

It works fine on our test windows bhyve VM. What OmniOS release are you on and what Windows release are you using in the VM?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.