<div dir="ltr"><div><div>Hi Prashant,<br><br></div>when the service starts, it checks if it has already registered in the database, if not, it will update the db to create an item for itself. you can see from the nova/service.py<br>
<br>149 def start(self):<br>150 verstr = version.version_string_with_package()<br>151 LOG.audit(_('Starting %(topic)s node (version %(version)s)'),<br>152 {'topic': self.topic, 'version': verstr})<br>
153 self.basic_config_check()<br>154 self.manager.init_host()<br>155 self.model_disconnected = False<br>156 ctxt = context.get_admin_context()<br>157 try:<br>158 self.service_ref = self.conductor_api.service_get_by_args(ctxt,<br>
159 self.host, self.binary)<br>160 self.service_id = self.service_ref['id']<br>161 except exception.NotFound:<br>162 self.service_ref = self._create_service_ref(ctxt)<br>
<br></div>I think you need to add this logic to your fake nova-compute service.<br><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-16 12:04 GMT+08:00 Prashant Upadhyaya <span dir="ltr"><<a href="mailto:prashant.upadhyaya@aricent.com" target="_blank">prashant.upadhyaya@aricent.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am writing a Compute Node Simulator.<u></u><u></u></p>
<p class="MsoNormal">The idea is that I would write a piece of software using C which honors the RabbitMQ interface towards the Controller, but will not actually do the real thing – everything on the Compute Node will be simulated by my simulator software.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The problem I am facing, that I have not been able to get my simulated CN listed in the output of
<u></u><u></u></p>
<p class="MsoNormal">nova-manage service list<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am on Havana, and my simulator is sending a periodic ‘service_update’ and ‘compute_node_update’ RPC messages to the ‘nova’ exchange and the ‘conductor’ routing key.<u></u><u></u></p>
<p class="MsoNormal">I can manipulate the above messages at will to fool the controller.<u></u><u></u></p>
<p class="MsoNormal">(I observe the messages from a real CN and take cues from there to construct a fake one from my simulator)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Question is – what causes the controller to add a new Nova Compute in its database, is it the ‘service_update’ RPC or something else.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hopefully you can help me reverse engineer the interface.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards<u></u><u></u></p>
<p class="MsoNormal">-Prashant<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<font color="Gray" face="Arial" size="1"><br>
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what
it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this
message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."<br>
</font>
</div>
<br>_______________________________________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
Post to : <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Tang Yaguang</div><div><br></div><div>Canonical Ltd. | <a href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a> | <a href="http://www.canonical.com" target="_blank">www.canonical.com</a></div>
<div>Mobile: +86 152 1094 6968</div><div>gpg key: 0x187F664F</div><div> </div></div>
</div>