<HTML>
<HEAD>
<TITLE>Re: [Openstack] Question on notifications</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Thx.<BR>
<BR>
With these messages, instead of the “compute.instance.create.end” it can’t be guaranteed that the instance actually got created right?<BR>
<BR>
If I listen for the “compute.instance.create.end” and use the hostname (which is part of the publisher id) then I can know that it actually got created?<BR>
<BR>
Is the “weighted_host” also dependent on which type of scheduler is used? (I would assume that not all schedulers do weighting?)<BR>
<BR>
On 4/25/12 5:29 PM, "Sandy Walsh" <<a href="sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>You want these events:<BR>
<BR>
scheduler.run_instance.start (generated when scheduling begins)<BR>
scheduler.run_instance.scheduled (when a host is selected. one per instance)<BR>
scheduler.run_instance.end (all instances placed)<BR>
<BR>
The .scheduled event will have the target hostname in it in the<BR>
"weighted_host" key ...<BR>
<BR>
For example ...<BR>
<BR>
[u'monitor.info',<BR>
{u'_context_auth_token': None,<BR>
u'_context_is_admin': True,<BR>
u'_context_project_id': None,<BR>
u'_context_quota_class': None,<BR>
u'_context_read_deleted': u'no',<BR>
u'_context_remote_address': None,<BR>
u'_context_request_id': u'req-...ac',<BR>
u'_context_roles': [u'admin', u'identity:admin'],<BR>
u'_context_timestamp': u'2012-04-25T20:32:44.506538',<BR>
u'_context_user_id': None,<BR>
u'event_type': u'scheduler.run_instance.scheduled',<BR>
u'message_id': u'2df8...fc',<BR>
u'payload': {u'instance_id': u'7c21...960',<BR>
u'request_spec': {u'block_device_mapping': [],<BR>
u'image': {u'checksum': u'ee0e...cfcc',<BR>
u'container_format': u'ovf',<BR>
u'created_at': u'2012-02-29 23:12:16',<BR>
u'deleted': False,<BR>
u'deleted_at': None,<BR>
u'disk_format': u'vhd',<BR>
u'id': u'079...b5fb',<BR>
u'is_public': True,<BR>
u'min_disk': u'10',<BR>
u'min_ram': u'256',<BR>
u'name': u'CentOS 6.0',<BR>
u'properties': {u'arch': u'x86-64',<BR>
u'auto_disk_config': u'True',<BR>
u'os_distro': u'centos',<BR>
u'os_type': u'linux',<BR>
u'os_version': u'6.0',<BR>
u'rax_managed': u'false',<BR>
u'rax_options': u'0'},<BR>
u'size': 390243020,<BR>
u'status': u'active',<BR>
u'updated_at': u'2012-02-29 23:12:32'},<BR>
u'instance_properties': {u'access_ip_v4': None,<BR>
u'access_ip_v6': None,<BR>
u'architecture': u'x86-64',<BR>
u'auto_disk_config': True,<BR>
u'availability_zone': None,<BR>
u'config_drive': u'',<BR>
. u'config_drive_id': u'',<BR>
u'display_description': u'testserver...9870',<BR>
u'display_name': u'testserver...9870',<BR>
u'ephemeral_gb': 0,<BR>
u'image_ref': u'0790...b5fb',<BR>
u'instance_type_id': 1,<BR>
u'kernel_id': u'',<BR>
u'key_data': None,<BR>
u'key_name': None,<BR>
u'launch_index': 0,<BR>
u'launch_time': u'2012-04-25T20:32:10Z',<BR>
u'locked': False,<BR>
u'memory_mb': 256,<BR>
u'metadata': {},<BR>
u'os_type': u'linux',<BR>
u'power_state': 0,<BR>
u'progress': 0,<BR>
u'project_id': u'5820792',<BR>
u'ramdisk_id': u'',<BR>
u'reservation_id': u'r-j...mm',<BR>
u'root_device_name': None,<BR>
u'root_gb': 10,<BR>
u'user_data': u'',<BR>
u'user_id': u'162201',<BR>
u'uuid': u'7c210...ed8960',<BR>
u'vcpus': 4,<BR>
u'vm_mode': None,<BR>
u'vm_state': u'building'},<BR>
u'instance_type': {u'created_at': None,<BR>
u'deleted': False,<BR>
u'deleted_at': None,<BR>
u'ephemeral_gb': 0,<BR>
u'extra_specs': {},<BR>
u'flavorid': u'1',<BR>
u'id': 1,<BR>
u'memory_mb': 256,<BR>
u'name': u'256MB instance',<BR>
u'root_gb': 10,<BR>
u'rxtx_factor': 1.0,<BR>
u'swap': 512,<BR>
u'updated_at': None,<BR>
u'vcpu_weight': 10,<BR>
u'vcpus': 4},<BR>
u'num_instances': 1,<BR>
u'security_group': [u'default']},<BR>
<BR>
u'weighted_host': {u'host': u'compute-xx-yy-zz-20',<BR>
u'weight': 4945.0}},<BR>
<BR>
u'priority': u'INFO',<BR>
u'publisher_id': u'scheduler.nova-sched...ee.com',<BR>
u'timestamp': u'2012-04-25 20:32:44.506474'}]<BR>
<BR>
<BR>
<BR>
<BR>
On 04/25/2012 06:44 PM, Joshua Harlow wrote:<BR>
> Hi all,<BR>
><BR>
> I was looking at the notification outputs, which are very useful and I<BR>
> was wondering if the way to say figure out which hypervisor a VM is<BR>
> being built on.<BR>
><BR>
> There seems to be the following key: "publisher_id":<BR>
> "compute.buildingbuild" (event is "compute.instance.create.end")<BR>
><BR>
> It would seem the stuff after “compute” is the hostname, would that be<BR>
> correct, or should the scheduler messages be intercepted, which as<BR>
> example has the following:<BR>
><BR>
> "weighted_host": {<BR>
> "host": "buildingbuild",<BR>
> "weight": -1488.0<BR>
> }<BR>
><BR>
> I would think the first practice would be right, since its from the<BR>
> compute node instead of the scheduler, but would like some feedback :-)<BR>
><BR>
> Thx!<BR>
><BR>
><BR>
><BR>
> _______________________________________________<BR>
> Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> Post to : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
> Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> More help : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
<BR>
_______________________________________________<BR>
Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
Post to : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
More help : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>