简体   繁体   English

重新启动Linux自定义脚本后继续-Azure ARM模板

[英]Continue after reboot Linux custom script - Azure ARM template

I am trying to build ARM JSON template and facing a problem with custom script extension and request for your help. 我正在尝试构建ARM JSON模板,并且遇到自定义脚本扩展和请求您帮助的问题。

This is the sample script that I am executing as a part of virtual machine extensions (Linux). 这是我作为虚拟机扩展(Linux)的一部分执行的示例脚本。

#!/usr/bin/bash
export AZURE_STORAGE_ACCOUNT="$1"
export AZURE_STORAGE_ACCESS_KEY="$2"
AZURE_STORAGE_CONTAINER="$3"
yum update -y
reboot
yum install -y epel-release
yum install -y gcc gcc-c++ kernel-devel ksh m4 sshpass nodejs npm

With this script the VM was able to install updates and reboot. 使用此脚本,VM可以安装更新并重新启动。 However the command "yum install -y epel-release" and following commands were not executed. 但是,未执行命令“ yum install -y epel-release”和以下命令。 And also while deployment this operation hangs and timeouts. 并且在部署时,此操作会挂起并超时。

Can you help suggest how to solve this situation using JSON ARM template or custom script extension or using any Linux workaround ? 您能否提供建议,使用JSON ARM模板或自定义脚本扩展或使用任何Linux解决方法来解决这种情况?

也许powershell dsc可以帮助您实现这一点( 配置某些属性以强制配置在重新启动后继续进行 ),或者将您的配置分为2个脚本并彼此独立地部署它们,因此第一个脚本重新启动计算机,第二个脚本应重新启动计算机VM可用后立即开始工作,并与Azure进行通讯。

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

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