#!/bin/SH# # Copyright (c) Citrix systems##wait forXAPI initialisation to complete. Then,ifinitialisation# did complete, and we is notinchrolling-pool-upgrade mode, attempt# to start all VMS with"Auto_poweron" inchTheir other-config#[-e/proc/xen] | | Exit0#超时时间设置为240秒XAPI_START_TIMEOUT_SECONDS= - # wait forXAPI to complete initialisation fora max of #最大超时时间为240秒XAPI_START_TIMEOUT_SECONDS/opt/xensource/bin/xapi-wait-init-Complete ${xapi_start_timeout_seconds}#/opt/xensource/bin/xapi-wait-init-complete -if[$?-eq0]; ThenPool=$ (Xe pool-list params=uuid--minimal2>/dev/NULL) #查看池的属性是否是auto_poweron Auto_poweron=$ (Xe pool-param-get Uuid=${pool} param-name=other-config Param-key=auto_poweron2>/dev/NULL) if[$?-eq0] && ["${auto_poweron}"="true"]; ThenLogger"$ Auto_poweron is enabled in the pool--this was an unsupported configuration." # ifXAPI Init completed ThenStart VMS (best effort, Don'T Report Errors)Xe Vm-start other-config:auto_poweron=truepower-state=halted--multiple >/dev/NULL 2>/dev/NULL||true fifi
Knowledge Point one: A single xenserver also has a default pool
Knowledge Point two:
The/opt/xensource/bin/xapi-autostart-vms of XenServer script learning