A.11. 중요한 종료를 허용하는 선택적 작업 방법
libvirt-guests
서비스에는 게스트가 올바르게 종료될 수 있도록 구성할 수 있는 매개 변수 설정이 있습니다. 이 패키지는 libvirt 설치의 일부이며 기본적으로 설치됩니다. 이 서비스는 호스트가 종료되면 자동으로 디스크에 게스트를 저장하고, 호스트를 재부팅할 때 사전 종료 상태로 복원합니다. 기본적으로 이 설정은 게스트를 일시 중지하도록 설정되어 있습니다. 게스트를 정상적으로 종료하려면 libvirt-guests
구성 파일의 매개 변수 중 하나를 변경해야 합니다.
절차 A.5. 게스트의 정상 종료를 허용하도록 libvirt-guests 서비스 매개 변수 변경
여기에 설명된 절차를 통해 호스트 물리적 시스템이 고정되거나 전원이 꺼지거나 다시 시작해야 하는 경우 게스트 가상 시스템을 정상적으로 종료할 수 있습니다.
구성 파일을 엽니다.
구성 파일은/etc/sysconfig/libvirt-guests
에 있습니다. 파일을 편집하고 주석 표시(#)를 제거하고ON_SHUTDOWN=suspend
를ON_SHUTDOWN=shutdown
로 변경합니다. 변경 사항을 저장해야 합니다.$ vi /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=start # Number of seconds to wait between each guest start. Set to 0 to allow # parallel startup. #START_DELAY=0 # 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
- ???
URIS
- checks the specified connections for a running guest. TheDefault
setting functions in the same manner as virsh does when no explicit URI is set In addition, one can explicitly set the URI from/etc/libvirt/libvirt.conf
. Note that when using the libvirt configuration file default setting, no probing will be used.- ???
ON_BOOT
- specifies the action to be done to / on the guests when the host boots. Thestart
option starts all guests that were running prior to shutdown regardless on their autostart settings. Theignore
option will not start the formally running guest on boot, however, any guest marked as autostart will still be automatically started bylibvirtd
.- ???
- The
START_DELAY
- sets a delay interval in between starting up the guests. This time period is set in seconds. Use the 0 time setting to make sure there is no delay and that all guests are started simultaneously. - ???
ON_SHUTDOWN
- specifies the action taken when a host shuts down. Options that can be set include:suspend
which suspends all running guests using virsh managedsave andshutdown
which shuts down all running guests. It is best to be careful with using theshutdown
option as there is no way to distinguish between a guest which is stuck or ignores shutdown requests and a guest that just needs a longer time to shutdown. When setting theON_SHUTDOWN=shutdown
, you must also setSHUTDOWN_TIMEOUT
to a value suitable for the guests.- ???
PARALLEL_SHUTDOWN
Dictates that the number of guests on shutdown at any time will not exceed number set in this variable and the guests will be suspended concurrently. If set to0
, then guests are not shutdown concurrently.- ???
- Number of seconds to wait for a guest to shut down. If
SHUTDOWN_TIMEOUT
is enabled, this timeout applies as a timeout for shutting down all guests on a single URI defined in the variable URIS. IfSHUTDOWN_TIMEOUT
is set to0
, then there is no timeout (use with caution, as guests might not respond to a shutdown request). The default value is 300 seconds (5 minutes). - ???
BYPASS_CACHE
can have 2 values, 0 to disable and 1 to enable. If enabled it will by-pass the file system cache when guests are restored. Note that setting this may effect performance and may cause slower operation for some file systems.
libvirt-guests 서비스 시작
서비스를 시작하지 않은 경우libvirt-guests
서비스를 시작합니다. 이렇게 하면 실행 중인 모든 게스트 가상 시스템이 종료되므로 서비스를 재시작하지 마십시오.