
KVM ゲストの遅延起動を導入するためのヒントを探しています。つまり、すべての仮想サーバーを一度に起動するのではなく、各仮想サーバーの起動間隔を 30 秒空けるようにします。一度に起動するとディスクが大量に消費され、実際にすべてが解決するまでにかなり長い時間がかかります。
私が試したアプローチは、/etc/sysconfig/libvirt-guests を次のように更新することです。
# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
#URIS=default
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
ON_BOOT=ignore
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
START_DELAY=180
# action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with
# this settings since there is no way to distinguish between a
# guest which is stuck or ignores shutdown requests and a guest
# which just needs a long time to shutdown. When setting
# ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
# value suitable for your guests.
ON_SHUTDOWN=shutdown
# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
#PARALLEL_SHUTDOWN=0
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
# is no time out (use with caution, as guests might not respond to a shutdown
# request). The default value is 300 seconds (5 minutes).
#SHUTDOWN_TIMEOUT=300
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
#BYPASS_CACHE=0
libvirt.conf のデフォルトの URI パスが正しいことも確認し、上記の設定ファイルのデフォルトを qemu:///system と qemu:/// に変更してみました。
変更内容に関係なく、すべてのゲストが同時に起動します。
シンボリック リンクが libvirt-guests 構成を上書きしている可能性があるため、/etc/libvirt/qemu/autostart/ の内容を削除しようとしましたが、何も起動しません (驚くことではありません)。
これをうまく機能させた人、または別の方法を知っている人はいますか?
エミュレータ パスをリダイレクトしてスクリプト内で遅延を導入できることはわかっていますが、これは新しいゲストの作成に影響するため、選択肢にありません。
ありがとう。