Actually, I'm having problems in a much simpler layer. I've done the following code thinking that I would start from there to find info:<br><br>---------------------<br>conn = amqp.Connection(host="localhost:5672", userid="guest", password="guest", virtual_host="/", insist=False)<br>
chan = conn.channel()<br>chan.queue_bind(queue="compute", exchange="nova", routing_key="<a href="http://notifications.info">notifications.info</a>")<br><br>def recv_callback(msg):<br> print 'Received: ' + msg.body + ' from channel #' + str(msg.channel.channel_id)<br>
<br>chan.basic_consume(queue='compute', no_ack=True, callback=recv_callback, consumer_tag="testtag")<br>while True:<br> chan.wait()<br>chan.basic_cancel("testtag")<br><br><br>chan.close()<br>
conn.close()<br>---------------------<br><br>But I get no messages at all. The script just stays still. I've added "--notification_driver=nova.notifier.rabbit_notifier" to nova.conf also.<br><br><div class="gmail_quote">
Em 28 de março de 2012 18:46, Sandy Walsh <span dir="ltr"><<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Look at<br>
<a href="https://github.com/rackspace/stacktach/blob/master/worker.py" target="_blank">https://github.com/rackspace/stacktach/blob/master/worker.py</a><br>
(ignore the _process() call, just look at how the queue listeners are<br>
set up)<br>
<br>
my worker_conf.py looks something like<br>
DEPLOYMENTS = [<br>
dict(<br>
tenant_id=1,<br>
url='<a href="http://stacktach.example.com" target="_blank">http://stacktach.example.com</a>',<br>
rabbit_host="10.0.0.1",<br>
rabbit_port=5672,<br>
rabbit_userid="nova-staging",<br>
rabbit_password="password",<br>
rabbit_virtual_host="staging"),<br>
dict(<br>
tenant_id=2,<br>
url='<a href="http://stacktach.example.com" target="_blank">http://stacktach.example.com</a>',<br>
rabbit_host="10.99.0.1",<br>
rabbit_port=5672,<br>
rabbit_userid="nova",<br>
rabbit_password="password",<br>
rabbit_virtual_host="production"),<br>
]<br>
<br>
<br>
Or the queue listeners in<br>
<a href="https://github.com/Cerberus98/yagi" target="_blank">https://github.com/Cerberus98/yagi</a><br>
<br>
Hope it helps!<br>
-Sandy<br>
<div class="im"><br>
<br>
On 03/28/2012 05:27 PM, Leander Bessa wrote:<br>
>>From what i have figured out so far, the exchange queue is "nova" and<br>
> the routing key in your case is "<a href="http://notifications.info" target="_blank">notifications.info</a><br>
</div>> <<a href="http://notifications.info" target="_blank">http://notifications.info</a>>".<br>
<div class="im">><br>
> On Wed, Mar 28, 2012 at 9:05 PM, Rogério Vinhal Nunes<br>
</div><div class="im">> <<a href="mailto:rogervn@dcc.ufmg.br">rogervn@dcc.ufmg.br</a> <mailto:<a href="mailto:rogervn@dcc.ufmg.br">rogervn@dcc.ufmg.br</a>>> wrote:<br>
><br>
> I'm trying to find out information to make an application that<br>
> consumes the compute info, but I'm having some trouble. Is there a<br>
> better documentation I could follow and the precise details of the<br>
> queue/exchange/routing_key needed to take information at the end of<br>
> each run-instance and terminate-instance?<br>
><br>
> Also, I'm using amqplib and I saw that Openstack uses an internal<br>
> library named Carrot that uses amqplib. Would it be better to use it<br>
> instead?<br>
><br>
> Em 27 de março de 2012 12:42, Sandy Walsh <<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a><br>
</div>> <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>>> escreveu:<br>
<div class="im">><br>
> I believe '.exists' is sent via a periodic update in<br>
> compute.manager.<br>
><br>
><br>
><br>
> On 03/27/2012 12:08 PM, Leander Bessa wrote:<br>
> > Hello,<br>
> ><br>
> > I've been following this topic and i've been trying to receive the<br>
> > notifications directly from rabbitmq with python+pika. So i far<br>
> > i've managed to receive the start/terminate events and<br>
> everything in<br>
> > between. What i am unable to find though is the topic regarding<br>
> > _compute.instance.exists_<br>
> > from <a href="http://wiki.openstack.org/SystemUsageData" target="_blank">http://wiki.openstack.org/SystemUsageData</a>. Does this even<br>
> exist, or<br>
> > is there some extra configuration required with nova?<br>
> ><br>
> > Regards,<br>
> ><br>
> > Leander<br>
> ><br>
> > On Mon, Mar 26, 2012 at 4:54 PM, Russell Bryant<br>
> <<a href="mailto:rbryant@redhat.com">rbryant@redhat.com</a> <mailto:<a href="mailto:rbryant@redhat.com">rbryant@redhat.com</a>><br>
</div><div><div class="h5">> > <mailto:<a href="mailto:rbryant@redhat.com">rbryant@redhat.com</a> <mailto:<a href="mailto:rbryant@redhat.com">rbryant@redhat.com</a>>>> wrote:<br>
> ><br>
> > -----BEGIN PGP SIGNED MESSAGE-----<br>
> > Hash: SHA1<br>
> ><br>
> > On 03/26/2012 11:48 AM, Russell Bryant wrote:<br>
> > > On 03/26/2012 10:15 AM, Rogério Vinhal Nunes wrote:<br>
> > >> Hello,<br>
> > >><br>
> > >> I'm developing a application to work along with<br>
> openstack. My<br>
> > >> application needs to keep track of all instances being<br>
> started<br>
> > >> or terminated such as feeding it information about the<br>
> location,<br>
> > >> status and other information about launched and terminated<br>
> > >> instances. The current version makes timed queries to<br>
> OpenStack<br>
> > >> database, but this is showing to be a little consuming and<br>
> > >> inefficient, so I would like to add a portion of code<br>
> to make<br>
> > >> OpenStack actively feed my application information<br>
> whenever an<br>
> > >> instance changes its status or location.<br>
> > >><br>
> > >> What is the least intrusive way to do that? It would be<br>
> very nice<br>
> > >> if OpenStack provided a way to run code on these situations<br>
> > >> without actually changing any code, such as defining a<br>
> directory<br>
> > >> of scripts to run in every instance status change.<br>
> > ><br>
> > > Check out the notifications system:<br>
> > ><br>
> > > <a href="http://wiki.openstack.org/NotificationSystem" target="_blank">http://wiki.openstack.org/NotificationSystem</a><br>
> > ><br>
> ><br>
> > That wasn't the page I thought it was ... I meant:<br>
> ><br>
> > <a href="http://wiki.openstack.org/SystemUsageData" target="_blank">http://wiki.openstack.org/SystemUsageData</a><br>
> ><br>
> > You can consume these events via AMQP if you configure<br>
> nova to use the<br>
> > rabbit notifier.<br>
> ><br>
> > - --<br>
> > Russell Bryant<br>
> > -----BEGIN PGP SIGNATURE-----<br>
> > Version: GnuPG v1.4.12 (GNU/Linux)<br>
> > Comment: Using GnuPG with Mozilla -<br>
> <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
> ><br>
> ><br>
> iEYEARECAAYFAk9wkSgACgkQFg9ft4s9SAYFuACfUu23qtxiH6WLCJNyd9gBf8i1<br>
> > FwQAnifjwWkFHYxo+KhYt8TAWEzTaMYZ<br>
> > =UWlH<br>
> > -----END PGP SIGNATURE-----<br>
> ><br>
> > _______________________________________________<br>
> > Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div></div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="im">> > Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>><br>
</div>> > <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
<div class="im">> <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>>><br>
> > Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="im">> > More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="im">> > Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>><br>
> > Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="im">> > More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="im">> Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
</div>> <<a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/%7Eopenstack</a>><br>
<div class="HOEnZb"><div class="h5">> More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></div></blockquote></div><br>