简体   繁体   中英

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.

This is the sample script that I am executing as a part of virtual machine extensions (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. However the command "yum install -y epel-release" and following commands were not executed. 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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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