简体   繁体   English

az vm run-command失败

[英]az vm run-command failed

I am using az vm run-command invoke to run ansible-playbook on Azure Linux RHEL7 VM. 我正在使用az vm run-command invoke在Azure Linux RHEL7 VM上运行ansible-playbook。 For small tasks, it is working fine but for a long-running process which exceeds 1hour 30 minutes. 对于小型任务,它工作正常但是长时间运行的过程超过1小时30分钟。 az vm-run-command timed out. az vm-run-command超时。 But in the background, I can see ansible-playbook is still running as a process. 但在后台,我可以看到ansible-playbook仍然作为一个过程运行。 az vm run-command exactly timed out in 1 hour 30 minutes every time. az vm run-command每次在1小时30分钟内完全超时。

Error : ERROR: Deployment failed. 错误:错误:部署失败。 Correlation ID: aed2e89a-9500-4836-9221-9eef8f05bee2. 相关ID:aed2e89a-9500-4836-9221-9eef8f05bee2。 Provisioning of VM extension 'RunCommandLinux' has timed out. VM扩展“RunCommandLinux”的配置已超时。 Extension installation may be taking too long, or extension status could not be obtained. 扩展安装可能需要很长时间,或者无法获得扩展状态。

With your description of the issue, the task that executes ansible command is running in the background and the run command task exceed 1 hour and 30 minutes. 根据您对问题的描述,执行ansible命令的任务在后台运行,运行命令任务超过1小时30分钟。

Then there are two possible reasons should pay attention to. 那么有两个可能的原因应该注意。 One is that the maximum time a script can run is 90 minutes, after which it will time out, so you need to make sure the ansible task does not execute more than 90 minutes. 一个是脚本可以运行的最长时间是90分钟,之后它将超时,因此您需要确保ansible任务的执行时间不超过90分钟。 Another is that outbound connectivity from the VM is required to return the results of the script. 另一个是需要来自VM的出站连接才能返回脚本的结果。 It depends on port 443, so you need to check if the port 443 is blocked in the outbound. 它取决于端口443,因此您需要检查端口443是否在出站中被阻止。

For more details, see Restrictions of Run Command in VM . 有关更多详细信息,请参阅VM中的运行命令限制 In addition, if it gives the error about the authentication, you should make sure which user do you execute the ansible in the VM and how to set the authentication. 此外,如果它提供有关身份验证的错误,您应该确保在VM中执行ansible的用户以及如何设置身份验证。

If you have more questions, please give me the messages. 如果您有更多问题,请给我留言。 I'm glad to provide more help:-) 我很乐意提供更多帮助:-)

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

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