Azure VM waagent:parsingExtensionsConfig时出错。 无法发送状态报告

OpenLogic的Azure CentOS 7.2 VM与Classic Model一起部署。

Azure Linux代理版本:WALinuxAgent-2.0.18

虚拟机工作正常,但我不知道这个错误的来源,我在waagent日志,这是什么意思。

在启动waagent时,/var/log/waagent.log报告:

 2016/04/24 08:29:42 Finished processing ExtensionsConfig.xml 2016/04/24 08:29:42 ERROR:Error parsing ExtensionsConfig. Unable to send status reports 2016/04/24 08:29:42 ERROR:Failed to report handler status 

然后每25秒logging得到:

 2016/04/24 07:44:24 ERROR:Error parsing ExtensionsConfig. Unable to send status reports 2016/04/24 07:44:24 ERROR:Failed to report handler status 

在waagent代码中,这个错误来自:

 # Process our extensions. if goalState.ExtensionsConfig == None and goalState.ExtensionsConfigXml != None : reportHandlerStatusCount = 0 #Reset count when new goal state comes goalState.ExtensionsConfig = ExtensionsConfig().Parse(goalState.ExtensionsConfigXml) # report the status/heartbeat results of extension processing if goalState.ExtensionsConfig != None : ret = goalState.ExtensionsConfig.ReportHandlerStatus() if ret != 0: Error("Failed to report handler status") elif reportHandlerStatusCount % 1000 == 0: #Agent report handler status every 25 seconds. Reduce the log entries by adding a count Log("Successfully reported handler status") 

然后在ReportHAndlerStatus方法中,错误来自:

  #agent state if provisioned == False: if provisionError == None : agent_state='Provisioning' agent_msg='Guest Agent is starting.' else: agent_state='Provisioning Error.' agent_msg=provisionError else: agent_state='Ready' agent_msg='GuestAgent is running and accepting new configurations.' status='{"version":"1.0","timestampUTC":"'+tstamp+'","aggregateStatus":{"guestAgentStatus":{"version":"'+GuestAgentVersion+'","status":"'+agent_state+'","formattedMessage":{"lang":"en-US","message":"'+agent_msg+'"}},"handlerAggregateStatus":['+statuses+']}}' try: uri=GetNodeTextData(self.Extensions[0].getElementsByTagName("StatusUploadBlob")[0]).replace('&','&') except: Error('Error parsing ExtensionsConfig. Unable to send status reports') return -1 

你在这个虚拟机中安装了configuration代理吗? 如果只是安装walinuxagent软件包而不启用configuration代理(通过门户或CLI),那么walinuxagent的configuration将不包括上传状态blob的位置。 在这里引用“安装”的评论。 总之(通过powershell):

 $vm = Get-AzureVM -ServiceName 'MyServiceName' -Name 'MyVMName' $vm.GetInstance().ProvisionGuestAgent = $true $vm | Update-AzureVM