def request_vms_info(self, payload):
<EOL>agent = payload.get('<STR_LIT>')<EOL>LOG.debug('<STR_LIT>', agent)<EOL>req = dict(host=payload.get('<STR_LIT>'))<EOL>instances = self.get_vms_for_this_req(**req)<EOL>vm_info = []<EOL>for vm in instances:<EOL><INDENT>vm_info.append(dict(status=vm.status,<EOL>vm_mac=vm.mac,<EOL>segmentation_id=vm.segmentation_id,<EOL>host=vm.host,<EOL>port_uuid=vm.port_id,<EOL>net_uuid=vm.network_id,<EOL>oui=dict(ip_addr=vm.ip,<EOL>vm_name=vm.name,<EOL>vm_uuid=vm.instance_id,<EOL>gw_mac=vm.gw_mac,<EOL>fwd_mod=vm.fwd_mod,<EOL>oui_id='<STR_LIT>')))<EOL><DEDENT>try:<EOL><INDENT>self.neutron_event.send_vm_info(agent, str(vm_info))<EOL><DEDENT>except (rpc.MessagingTimeout, rpc.RPCException, rpc.RemoteError):<EOL><INDENT>LOG.error('<STR_LIT>')<EOL><DEDENT>
Get the VMs from the database and send the info to the agent.