This article was sponsored by Xiuyi linfeng and first launched in the dark world.
When we enable or disable a KVM Vm, we usually use commands such as start, shutdown, and reboot. However, sometimes we find that the VM does not respond when the shutdown or reboot command is used to shut down or restart the VM, in this case, we may use destroy for brute force shutdown.
Why does this happen? After querying relevant information, we found that these commands sent an ACPI command to the KVM Virtual Machine to perform operations on the virtual machine.
When the KVM virtual machine is installed by default, especially the Linux virtual machine, the ACPI service is not installed, so the virtual machine does not perform the corresponding actions on these commands.
For these commands, we can find them in the configuration file of the KVM virtual machine:
<On_poweroff> destroy </on_poweroff>
<On_reboot> restart </on_reboot>
<On_crash> restart </on_crash>
For more information about ACPI, see the configuration file of the KVM virtual machine, as shown below:
<Features>
<ACPI/>
<APIC/>
<PAE/>
</Features>
To implement these commands, install the ACPI service on the KVM Virtual Machine and start the service.
Currently, the ACPI service has been installed and started in the Windows system by default in the KVM Virtual Machine. Therefore, you only need to install the ACPI service in Linux. As follows:
Yum-y install acpid
After the ACPI service is installed, start the ACPI service. We can use shutdown, reboot, and other commands on the KVM server to shut down and restart the VM.