我希望在部署VM之后启动以下脚本,遵循以下URL中提供的指令以及上传的脚本和命令以在Portal中执行
这是我在shell脚本中的命令
{
cd /tmp && wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -ivh epel-release-7-9.noarch.rpm
yum install ansible -y
{
部署虚拟机后,我无法看到虚拟机内的脚本也没有对虚拟机内的脚本进行字体
然后我添加了命令mkdir /tmp/test
来创建文件夹作为部署的一部分,这个部署耗时超过5分钟,我无法看到在VM中创建的文件夹/ tmp / test,
在启动日志中也发现了此错误
2017/02/06 22:55:49.085043 INFO Gateway:None
2017/02/06 22:55:49.089684 INFO Routes:None
2017/02/06 22:56:11.662445 WARNING Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
2017/02/06 22:56:11.678998 ERROR Event: name=WALinuxAgent, op=, message=Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
2017/02/06 22:56:37.728636 WARNING Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
2017/02/06 22:56:37.745898 ERROR Event: name=WALinuxAgent, op=, message=Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
2017/02/06 22:57:02.794418 WARNING Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
2017/02/06 22:57:02.810250 ERROR Event: name=WALinuxAgent, op=, message=Exception retrieving extension handlers: (000008)/var/lib/waagent/ExtensionsConfig.2.xml is missing.
在扩展名
下看到此错误答案 0 :(得分:0)
根据你的描述,我在我的实验室进行测试。您最好调整脚本格式。以下脚本是我的,它对我有用。
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -ivh epel-release-7-9.noarch.rpm
yum install ansible -y
如果您未获得预期结果,可以查看/var/log/waagent.log
,您将获得以下日志:
2017/02/07 01:49:53 CustomScriptForLinux started to handle.
2017/02/07 01:49:53 [Microsoft.OSTCExtensions.CustomScriptForLinux-1.5.2.1] cwd is /var/lib/waagent/Microsoft.OSTCExtensions.CustomScriptForLinux-1.5.2.1
2017/02/07 01:49:53 [Microsoft.OSTCExtensions.CustomScriptForLinux-1.5.2.1] Change log file to /var/log/azure/Microsoft.OSTCExtensions.CustomScriptForLinux/1.5.2.1/extension.log
2017/02/07 01:49:54.508725 INFO Event: name=Microsoft.OSTCExtensions.CustomScriptForLinux, op=Install, message=Launch command succeeded: customscript.py -install
2017/02/07 01:49:54.518685 INFO [Microsoft.OSTCExtensions.CustomScriptForLinux-1.5.2.1] Enable extension.
2017/02/07 01:49:54.541244 INFO [Microsoft.OSTCExtensions.CustomScriptForLinux-1.5.2.1] Launch command:customscript.py -enable
现在,您可以查看日志/var/log/azure/Microsoft.OSTCExtensions.CustomScriptForLinux/1.5.2.1/extension.log