Improved reboot and shutdown time

Reboot time is improved for KVM guests running in IBM Secure Execution mode.

Improved reboot time

A feature of QEMU that allows guests to reboot quickly is available by default.

On the KVM host, the file /sys/module/kvm/parameters/async_destroy indicates whether the feature is active.

Enabling shutdown time improvement

To enable shutdown improvement, add the async_teardown element to the guest's XML.

Draft comment: maria1@de.ibm.com
The following is to be removed when the VSM book is available.

Avoiding resource issues at shutdown and restart:

Secure execution mode requires that a guest’s memory be securely cleared during shutdown. This process can slow down the shutdown if it’s done synchronously. To mitigate this delay, you can enable the async-teardown option, which allows the shutdown process to complete asynchronously.

When using async-teardown, ensure the host has sufficient free memory before launching any new guest. Shutting down an IBM Secure Execution guest with async-teardown clears the memory asynchronously, which can lead to out-of-memory situations, particularly with large guests. To further mitigate these risks, avoid using memory allocation mode immediate.

Confirming support for async-teardown

Support for async-teardown is included in libvirt if the element async-teardown is listed in domcapabilities. Confirm that this setting is available in your environment by checking that the async-teardown element attribute supported has the value yes. For example:
# virsh domcapabilities | grep async-tear
<async-teardown supported='yes'/>

Configuring async-teardown

You can configure your guest to use this feature by including the element async-teardown in the guest's domain XML features. An example domain XML, here for a SUSE Linux® Enterprise Server instance, could look like:

<domain type='kvm'>
   <name>fast-shutdown</name>
   ...
   <memory unit='KiB'>1150976</memory>
   <vcpu placement='static'>2</vcpu>
   <os>
      <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
   </os> 
   <features>
      <async-teardown enabled='yes'/>
   </features>  
   <devices>
      <emulator>/usr/bin/qemu-system-s390x</emulator>
   ...
   </devices> 
</domain>

For details about setting up features for and operating Linux on KVM instances, see KVM Virtual Server Management, SC34-2752.