简体   繁体   English

需要重新启动的Azure云服务启动任务

[英]Azure Cloud Service Startup Task that requires reboot

Tried with osFamily 4, osVersion * 尝试使用osFamily 4,osVersion *

Background: we have an app that uses System.Management.Automation.dll (from the GAC, dev box is W10) to work with Powershell in C# code. 背景:我们有一个使用System.Management.Automation.dll(来自GAC,开发箱为W10)的应用程序,可通过C#代码与Powershell一起使用。 Specifically, we are using InitialSessionState and the ExecutionPolicy property - which we found out is part of WMF 5 (it errors out with not found exception on type load on the cloud service). 具体来说,我们使用的是InitialSessionState和ExecutionPolicy属性-我们发现它是WMF 5的一部分(它出错,但在云服务上的类型加载中未发现异常)。

Now, this can be properly fixed by installing WMF 5 (we tried first via Remote Desktop; and no, forcing only the newer smadll into the GAC does not work). 现在,可以通过安装WMF 5来正确解决此问题(我们首先通过远程桌面进行了尝试;否,仅将较新的smadll强制插入GAC不起作用)。 Problem is, the installer asks for a reboot - and that I think is a problem with the startup task. 问题是,安装程序要求重新启动-我认为启动任务存在问题。

We added the installer to the setup.cmd that we already had: 我们将安装程序添加到已经具有的setup.cmd中:

Win8.1AndW2K12R2-KB3134758-x64.msu /quiet Win8.1AndW2K12R2-KB3134758-x64.msu /安静

It indeed automatically reboots the role instance, and runs setup.cmd again (which adds an error entry to the setup event log to the tune that it is already installed). 实际上,它确实会自动重新引导角色实例,然后再次运行setup.cmd(这会将错误条目添加到安装事件日志中,以说明它已经安装了)。

This reboot does not flag the cloud service deployment as failed. 此重新引导不会将云服务部署标记为失败。 Which we are happy about but, is this really a supported behavior? 我们对哪个感到满意,但这真的是受支持的行为吗? or accidental? 还是偶然的?

Is there the supported way to make an installer work that requires a reboot? 是否有支持的方法来使安装程序需要重新启动才能工作? Or is the behavior we found the "supported" way? 还是我们发现这种行为是“受支持的”方式?

There's not really a "supported" way - how you initialize your cloud service is really up to you. 并不是真正的“受支持”方式-初始化云服务的方式完全取决于您。 Having said that: 话说回来:

Given that cloud service role instances typically survive reboots, there's nothing wrong with setting something up that requires a reboot. 鉴于云服务角色实例通常在重新启动后仍然有效,因此设置需要重新启动的组件没有任何问题。 Then it's a matter of dealing with already-installed software when returning from the reboot (eg leaving a breadcrumb file from your .cmd that installed the software initially). 然后,这是从重新启动返回时处理已经安装的软件的问题(例如,从最初安装该软件的.cmd中保留面包屑文件)。 This is sometimes the only way you can install software (where reboots are involved), and utilizing a breadcrumb helps cut down on subsequent reboot time (the clock-time required to complete the boot process; not the number of actual reboots). 有时,这是安装软件(涉及重新启动)的唯一方法,利用面包屑可以减少后续的重新启动时间(完成启动过程所需的时钟时间;而不是实际重新启动的次数)。

In this type of scenario, only the initial role instance boot has an additional reboot. 在这种情况下,只有初始角色实例启动才具有其他重新启动。 (other reboots, from Guest OS and Host OS updates, or failed hardware etc., are separate, of course). (当然,从来宾操作系统和主机操作系统更新进行的其他重新引导,或者发生故障的硬件等都是单独的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM