GracefulShutdownofVMwareESXiusingNetworkShutdownModuleConfiguringNetworkShutdownModuleforgracefulshutdownofESXihosts21TableofContents2Introduction33Deployment33.
1Prerequisites.
33.
2PowerShellConfiguration.
43.
2.
1PowerShellExecutionPolicy.
43.
2.
2HandlingInvalidCertificates.
44ShutdownConfigurations54.
1StandaloneESXiShutdown.
54.
1.
1StandaloneESXiShutdownProcedure74.
2ESXiClusterShutdown84.
2.
1ClusterShutdownProcedure.
932IntroductionNetworkShutdownModule3.
07includesPowerShellscriptswhichallowforgracefulshutdownofVMwareESXihostsandtheirVirtualMachines(VMs)inthecaseofUPSevents.
Thisdocumentdescribeshowtoconfigureyourenvironmenttoenabletheuseofthesescripts.
BydefaultinaVMwareHighAvailabilityClusterenvironmenttheVirtualMachineStartup/Shutdownfeatureisdisabledbydesign.
ThismeansthatwhenNetworkShutdownModuleissuesacommandtoshutdownESXihostsinresponsetoacriticalUPSeventtheVMsrunningonthosehostswillnotbeshutdowncleanly.
NOTE:Thescriptsshouldbetestedinanon–productionenvironmentbeforeuseonproductionservers.
3DeploymentFigure1-ESXiDeploymentAnexampledeploymentforESXiprotectionisshowninFigure1.
OneormoreUPSunitswillprovidepowertotheESXiandtheNetworkShutdownModulehosts.
TheNetworkShutdownModulehostisconfiguredtomonitortheUPS(s)andwhenaUPSeventoccurs,runstheshutdownscriptstogracefullyshutdownthevirtualmachinesandtheESXIhost.
3.
1PrerequisitesTheNetworkShutdownModuleHostmustberunningacompatibleWindowsServeroperatingsystem.
Seeproductdocumentationforalistofcompatibleoperatingsystems.
TheshutdownscriptsrequireWindowsPowerShell.
Downloadandinstallationinstructionsforyouroperatingsystemcanbefoundonwww.
microsoft.
com/powershell.
TheshutdownscriptsrequireVMwarevSpherePowerCLI.
Downloadandinstallationinstructionsforyouroperatingsystemcanbefoundonwww.
vmware.
com/go/powercli.
43.
2PowerShellConfiguration3.
2.
1PowerShellExecutionPolicyPleasebyawarethattheprovidedshutdownscriptswillsettheexecutionpolicyforPowerShellto'RemoteSigned'.
MoreinformationonexecutionpoliciescanbeMicrosoftPowerShelldocumentation:http://us/library/ee176961.
aspx3.
2.
2HandlingInvalidCertificatesTheshutdownscriptsmakeuseoftheVMtothetargetESXihostorvCenterServerinvalidoruntrustedSSLcertificate,thecurrentimplementationatthetimeofwritingwillissueawarning.
AnexampleofsuchawarningisgiveInvalidCertificateActionpolicy.
Atthetimeofwritingthisguide,thedefaultpolicyis'unset',whichwillresultinawarningbeingissued.
Figure2-InvalidCertificateWarningInfutureversionsofthePowerCLI,foraddedsecurity,theuntrusteddenied.
Toavoidthissituation,werecommendyousetanInvalidCertificateActiononeofeither'Ignore'or'Fail'.
Ifthepolicyissetto'fail',thecmdletwillnotestablishaconnectionifthecertificateisnotvalid.
Inthiscase,youmustuploadavalidcertificatetotheESXihostensurethatshutdownprotectioncanbeprovided.
PowerShellConfigurationPowerShellExecutionPolicyPleasebyawarethattheprovidedshutdownscriptswillsettheexecutionpolicyforMoreinformationonexecutionpoliciescanbefoundinMicrosoftPowerShelldocumentation:http://technet.
microsoft.
com/en-HandlingInvalidCertificatesTheshutdownscriptsmakeuseoftheVMwarePowerCLIConnect-VIServercmdletorvCenterServerviaasecurehttpschannel.
IftheserverpresentsaninvalidoruntrustedSSLcertificate,thecurrentimplementationatthetimeofwritingwillissueAnexampleofsuchawarningisgiveninFigure2.
Thisisdefinedinlinewiththepolicy.
Atthetimeofwritingthisguide,thedefaultpolicyis'unset',whichwillresultinawarningbeingissued.
InfutureversionsofthePowerCLI,foraddedsecurity,theuntrustedconnectionmaybedenied.
Toavoidthissituation,werecommendyousetanInvalidCertificateActionIfthepolicyissetto'fail',thecmdletwillnotestablishaconnectionifthecertificateisnotInthiscase,youmustuploadavalidcertificatetotheESXihostorvCenterServerensurethatshutdownprotectioncanbeprovided.
PleasebyawarethattheprovidedshutdownscriptswillsettheexecutionpolicyforfoundinVIServercmdlettoconnectviaasecurehttpschannel.
IftheserverpresentsaninvalidoruntrustedSSLcertificate,thecurrentimplementationatthetimeofwritingwillissueThisisdefinedinlinewiththepolicy.
Atthetimeofwritingthisguide,thedefaultpolicyis'unset',connectionmaybedenied.
Toavoidthissituation,werecommendyousetanInvalidCertificateActionpolicytoIfthepolicyissetto'fail',thecmdletwillnotestablishaconnectionifthecertificateisnotorvCenterServerto5Withthepolicyissetto'ignore',thecmdletwillestablishtheconnectionwithouttakingintoaccountthatthecertificateisinvalid.
Figure3showsanexampleofsettingtheInvalidCertificateActionpolicy.
Figure3-SettingtheInvalidCertificateActionSeethePowerCLIcmdletreferenceformoreinformationonboththeConnectSet-PowerCLIConfigurationcmdlets.
Thisisavailableat:https://pubs.
vmware.
com/vsphere55/topic/com.
vmware.
powercli.
cmdletref.
doc/Overview.
html4ShutdownConfigurati4.
1StandaloneESXiShutdownToconfiguregracefulshutdownofstandaloneESXihosts,usethefollowingsteps:1.
AccessthevSphereClient,selectyourESXihost,thentheconfigurationtab.
2.
ClickontheVirtualMachineStartup/Shutdownlink.
Click'properttodisplaythe'VirtualMachineStartupandShutdown'dialog,asshownin3.
Ensurethat"Allowvirtualmachinestostartandstopchecked.
4.
Use'MoveUp'tomoveVMsintotheinthe'ManualStartup'grouparenotgracefullystartedorstoppedwiththeESXihost.
5.
EnsuretheVMsarelistedorderoftheVMs.
Shutdownusesthereverseofthisorder,sothelastonthelistwillbethefirsttoshutdown.
6.
Changethe'ShutdownAction'tospecify'GuestShutdown'.
ClickOK,todismissthisdialog.
7.
EnsurethatVMwareToolsareinstalledoneachVM.
ThisisrequiredforgracefulshutdownoftheVM.
Withthepolicyissetto'ignore',thecmdletwillestablishtheconnectionwithouttakingintoficateisinvalid.
showsanexampleofsettingtheInvalidCertificateActionpolicy.
SettingtheInvalidCertificateActionSeethePowerCLIcmdletreferenceformoreinformationonboththeConnect-VIServerandPowerCLIConfigurationcmdlets.
Thisisavailableat:pubs.
vmware.
com/vsphere-55/topic/com.
vmware.
powercli.
cmdletref.
doc/Overview.
htmlShutdownConfigurationsShutdownToconfiguregracefulshutdownofstandaloneESXihosts,usethefollowingsteps:AccessthevSphereClient,selectyourESXihost,thentheconfigurationtab.
ClickontheVirtualMachineStartup/Shutdownlink.
Click'properties'atthetoprighttodisplaythe'VirtualMachineStartupandShutdown'dialog,asshowninEnsurethat"Allowvirtualmachinestostartandstopautomaticallywiththesystem"isse'MoveUp'tomoveVMsintothe'AnyOrder',or'AutomaticStartup'groups.
VMsinthe'ManualStartup'grouparenotgracefullystartedorstoppedwiththeESXihost.
arelistedintheorderyouwant.
NotethatthisrepresentsthestartuporderoftheVMs.
Shutdownusesthereverseofthisorder,sothelastonthelistwillbethefirsttoshutdown.
Changethe'ShutdownAction'tospecify'GuestShutdown'.
ClickOK,todismissthisEnsurethatVMwareToolsareinstalledoneachVM.
ThisisrequiredforgracefulWiththepolicyissetto'ignore',thecmdletwillestablishtheconnectionwithouttakingintoVIServerandToconfiguregracefulshutdownofstandaloneESXihosts,usethefollowingsteps:AccessthevSphereClient,selectyourESXihost,thentheconfigurationtab.
ies'atthetoprighttodisplaythe'VirtualMachineStartupandShutdown'dialog,asshowninFigure4.
automaticallywiththesystem"is',or'AutomaticStartup'groups.
VMsinthe'ManualStartup'grouparenotgracefullystartedorstoppedwiththeESXihost.
.
NotethatthisrepresentsthestartuporderoftheVMs.
Shutdownusesthereverseofthisorder,sothelastonthelistwillChangethe'ShutdownAction'tospecify'GuestShutdown'.
ClickOK,todismissthisEnsurethatVMwareToolsareinstalledoneachVM.
Thisisrequiredforgraceful68.
EnsurethatthePowerControlsforeachVMarecorrect.
ForeachVM,rightclickandselectEditSettings>OptionsTab>VMwareTools.
UnderPowerControlsStop,ensurethat'ShutDownGuest'isdisplayed.
AnexampleisdisplayedinFigure5.
9.
OntheNetworkShutdownModuleHost,installthePowerShellandPowerCLIprerequisites,asoutlinedinsection3.
1.
10.
InstallSchneiderElectricNetworkShutdownModule3.
07onasupportedWindowsServerOS.
OncecompletetheshutdownscriptscanbefoundunderC:\ProgramFiles\SE\NetworkShutdownModule\esxi,oronthecustompathchosenatinstalltime.
11.
Open"esxi_shutdown.
bat"inatexteditorandeditthefollowingscriptvariablesasrequired:a.
SERVER:TheIPaddressoftheESXiHost.
b.
USERNAME:UseraccountwithAdministratorprivilegesfortheESXiHost.
c.
PASSWORD:Passwordfortheuseraccountabove.
d.
OSSHUTDOWNDELAY:Adelayinseconds.
ThisdelayispassedtotheshutdownprocedureoftheNSMhost;togiveusersawarningthatshutdownisimminent.
12.
Verifythatthepathsspecifiedarecorrectandeditthemasrequired.
Thedefaultpathsgivenmaybedifferentdependingonyourhost,e.
g.
ifyouareusinga32bitor64bitversionofWindows.
a.
POWERSHELL_PATH:Thepathtothepowershell.
exeexecutable.
b.
VMWARE_PATH:Thepathtothevim.
psc1fileinstalledaspartoftheVMwarePowerCLI.
c.
SCRIPT_PATH:Thepathtotheshutdown.
ps1scriptinstalledwithNetworkShutdownModule.
d.
LOG_PATH:Apathtoafolderwherescriptlogswillbecreated.
Pleaseensurethisisalocalwritablelocation,otherwisetheshutdownscriptwillfailtocreateanexecutionlog.
13.
IntheNetworkShutdownModuleuserinterfacegototheActions(advanced)->SystemShutdown->Settingspage.
14.
Enterthefullpathtoesxi_shutdown.
batunder"Commandline".
Ifthispathcontainsspaces,ensurethefullpathiswithinquotes.
15.
GototheShutdownsettingspage,anddeselect"UsecentralconfigurationprovidedbyNetworkManagementCard/Proxy".
16.
Enteradurationvalueinsecondsunder"Shutdownduration".
NOTE:ThisvaluemustbelongenoughtoallowalloftheVMstobeshutdowncleanlyfollowedbytheESXiandNetworkShutdownModulehosts.
17.
GototheActions(advanced)->SystemShutdown->Eventspage.
Select/CheckaNotificationAlarmtoinitiatetheshutdown,forexample,UtilityFailureandSavechange(s).
7Figure4-VirtualMachineStartupandShutdown4.
1.
1StandaloneESXiShutdownProcedureTheshutdownsequenceoccursasfollows:1.
UPSgoesonBattery.
2.
Theconfiguredbatfileisexecuted(PowerShellscript(shutdown.
ps1).
3.
ThisscriptattachestotheESXihost,andtriggersaP4.
ThescriptsavesalogofrunningVMstovmlist.
csvinthelogdirectory.
Alogofactionsperformedbythescriptisalsosavedhere.
5.
TheESXihostreactsasitisconfiguredto,andsuspendsorpowersofftheVMs.
6.
TheESXihostthenshuts7.
AfterOSSHUTDOWNDELAYsecondsdown.
8.
OnceallcomputersconnectedtotheUPShavebeenshutdown,theUPSshutsoff(interruptsthesupplyofpowertotheloads)toprotectthebattery.
NOTE:ThisfunctionisnotauthorisedonsomeUPSs.
9.
AssumingtheUPSshutofffunctionisavailable,whenpowerisrestored,theUPSwillrestartprovidingpowertoattachedequipment.
UsingBIOSsettingsontheESXIhostsyoumaybeabletoinitiateasystemstartwhenVirtualMachineStartupandShutdownShutdownProcedureTheshutdownsequenceoccursasfollows:Theconfiguredbatfileisexecuted(esxi_shutdown.
bat),whichcallstheassociatedscript(shutdown.
ps1).
scriptattachestotheESXihost,andtriggersaPowerOffaction.
ThescriptsavesalogofrunningVMstovmlist.
csvinthelogdirectory.
Alogofactionsperformedbythescriptisalsosavedhere.
TheESXihostreactsasitisconfiguredto,andsuspendsorpowersofftheVMs.
sdown.
OSSHUTDOWNDELAYseconds,theNetworkShutdownModulehostOnceallcomputersconnectedtotheUPShavebeenshutdown,theUPSshutsoff(interruptsthesupplyofpowertotheloads)toprotectthebattery.
nisnotauthorisedonsomeUPSs.
AssumingtheUPSshutofffunctionisavailable,whenpowerisrestored,theUPSwillrestartprovidingpowertoattachedequipment.
UsingBIOSsettingsontheESXIhostsyoumaybeabletoinitiateasystemstartwhenpowerisrestored.
shutdown.
bat),whichcallstheassociatedThescriptsavesalogofrunningVMstovmlist.
csvinthelogdirectory.
AlogofactionsTheESXihostreactsasitisconfiguredto,andsuspendsorpowersofftheVMs.
heNetworkShutdownModulehostwillshutOnceallcomputersconnectedtotheUPShavebeenshutdown,theUPSshutsoffAssumingtheUPSshutofffunctionisavailable,whenpowerisrestored,theUPSwillrestartprovidingpowertoattachedequipment.
UsingBIOSsettingsontheESXIhosts8Figure5-VMwareToolsSettings4.
2ESXiClusterShutdownToconfigureshutdownforanESXi1.
InstallthePowerShellandPowerCLIprerequisites,asoutlinedinsection2.
InstallSchneiderElectricNetworkShutdownModule3.
07ServerOS.
OncecompletetheshutdownscriptscanbefoundunderC:Files\SE\NetworkShutdownModule3.
Open"hashutdown.
bat"inatexteditorandeditthefollowingscriptvariablesasrequired:a.
SERVER:TheIPaddressoftheESXihostb.
USERNAME:UseraccountwithAdministratorprivilegesfortheESXihostorvCenterc.
PASSWORD:Passwordfortheuseraccountabove.
d.
DATACENTER:NameofthedatacentrecontainerthatcontainstheCLUSTER.
ESXiClusterShutdownESXiClusterenvironment,usethefollowingsteps:InstallthePowerShellandPowerCLIprerequisites,asoutlinedinsection3.
1InstallSchneiderElectricNetworkShutdownModule3.
07onasupported.
OncecompletetheshutdownscriptscanbefoundunderC:\ProgramNetworkShutdownModule\esxi,oronthecustompathchosenatinstalltime.
Open"hashutdown.
bat"inatexteditorandeditthefollowingscriptvariablesasSERVER:TheIPaddressoftheESXihostorvCenterServer.
USERNAME:UseraccountwithAdministratorprivilegesfortheESXiServer.
PASSWORD:Passwordfortheuseraccountabove.
DATACENTER:Nameofthedatacentrecontainerthatcontainsthe3.
1.
supportedWindowsProgramchosenatinstalltime.
Open"hashutdown.
bat"inatexteditorandeditthefollowingscriptvariablesasUSERNAME:UseraccountwithAdministratorprivilegesfortheESXiDATACENTER:Nameofthedatacentrecontainerthatcontainsthe9e.
CLUSTER:NameoftheclusterthatcontainstheESXihoststobeshutdown.
f.
VMSHUTDOWNDELAY:AVMshutdowndelay,specifiedinseconds.
AfterrequestingaShutDownfortheVM,thescriptwillwaitthislongtoallowtimefortheVMshutdownproceduretocomplete.
Oncethisdelayhaselapsed,aPowerOffcommandisgiven.
ThevalueforthisfieldshouldbesufficientlylongtoallowgracefulshutdownofyourVMs.
g.
OSSHUTDOWNDELAY:Adelayinseconds.
ThisdelayispassedtotheshutdownprocedureoftheNSMhost;togiveusersawarningthatshutdownisimminent.
4.
Verifythatthepathsspecifiedarecorrectandeditthemasrequired.
Thedefaultpathsgivenmaybedifferentdependingonyourhost,e.
g.
ifyouareusinga32bitor64bitversionofWindows.
a.
POWERSHELL_PATH:Thepathtothepowershell.
exeexecutable.
b.
VMWARE_PATH:Thepathtothevim.
psc1fileinstalledaspartoftheVMwarePowerCLI.
c.
SCRIPT_PATH:Thepathtotheshutdown.
ps1scriptinstalledwithNetworkShutdownModule.
d.
LOG_PATH:Apathtoafolderwherescriptlogswillbecreated.
Pleaseensurethisisalocalwritablelocation,otherwisetheshutdownscriptwillfailtocreateanexecutionlog.
5.
IntheNetworkShutdownModuleuserinterfacegototheActions(advanced)->SystemShutdown->Settingspage.
6.
Enterthefullpathtohashutdown.
batunder"Commandline".
Ifthispathcontainsspaces,ensurethefullpathiswithinquotes.
Click"SaveChanges"toapply.
7.
GototheShutdownsettingspage,anddeselect"UsecentralconfigurationprovidedbyNetworkManagementCard/Proxy".
8.
Enteradurationvalueinsecondsunder"Shutdownduration".
Click"SaveChanges"toapply.
NOTE:ThisvaluemustbelongenoughtoallowalloftheVMstobeshutdowncleanlyfollowedbytheESXiandNetworkShutdownModulehosts.
9.
GototheActions(advanced)->SystemShutdown->Eventspage.
Select/CheckaNotificationAlarmtoinitiatetheshutdown,forexample,UtilityFailureandSavechange(s).
4.
2.
1ClusterShutdownProcedureTheshutdownsequenceoccursasfollows:1.
UPSgoesonBattery.
2.
Theconfiguredbatfileisexecuted(hashutdown.
bat),whichcallstheassociatedPowerShellscript(hashutdown.
ps1).
3.
ThisscriptattachestotheESXihostorvCenterServer,andenumeratesthepoweredonVMsinthecluster.
TheseVMsaresavedtothevmlist.
csvfileinthelogdirectory.
a.
PleaseNote:OnlythoseVMswhichareassociatedwithhostswhichareinthe"Connected"or"Maintenance"statesareenumerated.
VMsassociatedwithhostsinthe"Disconnected"or"NotResponding"statescannotbeenumerated,andtheirhostscannotbesafelyshutdownbythisscript.
4.
Thescriptattemptstoshutdowneachvirtualmachineinthecluster.
10NOTE:VMwaretoolsmustbeinstalledoneachVM,otherwiseaPowerOffcommandissent.
5.
AfterVMSHUTDOWNDELAYseconds,thescriptchecksforanyremainingVMsthatarepoweredonandissuesapoweroffcommandtothosethatarestillrunning.
ThisisnecessarytoallowtheESXihost(s)toentermaintenancemode.
6.
IftheESXihostisinthe"Connected"state,thescriptwillthencommandtheESXihost(s)toentermaintenancemode.
7.
ThentheESXihostsareshutdown.
8.
AfterOSSHUTDOWNDELAYseconds,theNetworkShutdownModulehostwillshutdown.
TheNetworkShutdownModulehostwillalwaysshutdownafterallESXihostshaveshutdown.
9.
OnceallcomputersconnectedtotheUPShavebeenshutdown,theUPSshutsoff(interruptsthesupplyofpowertotheloads)toprotectthebattery.
NOTE:ThisfunctionisnotauthorisedonsomeUPSs.
10.
AssumingtheUPSshutofffunctionisavailable,whenpowerisrestored,theUPSwillrestartprovidingpowertoattachedequipment.
UsingBIOSsettingsontheESXihostsyoumaybeabletoinitiateasystemstartwhenpowerisrestored.
NOTE:ESXihostswillpowerupinmaintenancemode.
**ENDOFDOCUMENT**
3C云互联怎么样?3C云互联专注免备案香港美国日本韩国台湾云主机vps服务器,美国高防CN2GIA,香港CN2GIA,顶级线路优化,高端品质售后无忧!致力于对互联网云计算科技深入研发与运营的极客共同搭建而成,将云计算与网络核心技术转化为最稳定,安全,高速以及极具性价比的云服务器等产品提供给用户!专注为个人开发者用户,中小型,大型企业用户提供一站式核心网络云端服务部署,促使用户云端部署化简为零,轻松...
快云科技: 12.12特惠推出全场VPS 7折购 续费同价 年付仅不到五折公司介绍:快云科技是成立于2020年的新进主机商,持有IDC/ICP等证件资质齐全主营产品有:香港弹性云服务器,美国vps和日本vps,香港物理机,国内高防物理机以及美国日本高防物理机产品特色:全配置均20M带宽,架构采用KVM虚拟化技术,全盘SSD硬盘,RAID10阵列, 国内回程三网CN2 GIA,平均延迟50ms以下。...
昔日数据怎么样?昔日数据是一个来自国内服务器销售商,成立于2020年底,主要销售国内海外云服务器,目前有国内湖北十堰云服务器和香港hkbn云服务器 采用KVM虚拟化技术构架,湖北十堰机房10M带宽月付19元起;香港HKBN,月付12元起; 此次夏日活动全部首月5折促销,有需要的可以关注一下。点击进入:昔日数据官方网站地址昔日数据优惠码:优惠码: XR2021 全场通用(活动持续半个月 2021/7...
vmware tools 安装为你推荐
ip地址是什么Ip地址格式是什么?雅虎社区雅虎是中国的吗公章制作制作公章尺寸标准大小,字体,字号?依赖注入依赖注入是什么意思?微信如何建群微信怎么建群?腾讯文章为什么最近腾讯网的文章评论都看不到xp系统停止服务xp系统停止服务怎么办创维云电视功能创维新出的4K超高清健康云电视有谁用过,功能效果怎么样?电子商务网站模板网页制作模板虚拟机软件下载谁有好的虚拟机软件?
西安域名注册 看国外视频直播vps 怎样申请域名 hkbn hostmonster 狗爹 174.127.195.202 表格样式 info域名 云图标 中国电信测速网 hkt 超级服务器 lick 东莞主机托管 中国linux lamp架构 注册阿里云邮箱 后门 杭州电信宽带 更多