Comment 6 for bug 1756360

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

So with oslo.serialization 2.21.1 the reason field of the compute_task.build_instances legacy notification looks like:

'reason': {'kwargs': {'code': 500, 'reason': ''},
            'message': u'No valid host was found. '},

while with newer oslo.serialization it looks like:

'reason': "NoValidHost(u'No valid host was found. ',)",

So the oslo.serialization change did affect the payload of the legacy compute_task.build_instances ERROR notification.

Please note that this notification hasn't been transformed to the new versioned framework yet. But this bug does not directly affect any already transformed notification as the Exception payload in the versioned notifications does not directly store a serialized Exception object. Instead it contains just the exception type and the exception message.

https://github.com/openstack/nova/blob/master/nova/notifications/objects/exception.py#L25
https://github.com/openstack/nova/blob/master/doc/notification_samples/instance-create-error.json

---

See the full payload below:

{'instance_id': 'c1168eba-89a1-43af-86bd-b6c164dd0f94',
 'instance_properties': {'availability_zone': None,
                         'ephemeral_gb': 0,
                         'memory_mb': 512,
                         'numa_topology': None,
                         'pci_requests': {'requests': []},
                         'project_id': u'6f70656e737461636b20342065766572',
                         'root_gb': 1,
                         'uuid': 'c1168eba-89a1-43af-86bd-b6c164dd0f94',
                         'vcpus': 1},
 'method': 'build_instances',
 'reason': {'kwargs': {'code': 500, 'reason': ''},
            'message': u'No valid host was found. '},
 'request_spec': {'image': {'container_format': u'raw',
                            'created_at': '2011-01-01T01:02:03.000000',
                            'disk_format': u'raw',
                            'id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
                            'name': u'fakeimage123456',
                            'properties': {'hw_architecture': u'x86_64'},
                            'size': 25165824,
                            'status': u'active',
                            'updated_at': '2011-01-01T01:02:03.000000'},
                  'instance_properties': {'availability_zone': None,
                                          'ephemeral_gb': 0,
                                          'memory_mb': 512,
                                          'numa_topology': None,
                                          'pci_requests': {'requests': []},
                                          'project_id': u'6f70656e737461636b20342065766572',
                                          'root_gb': 1,
                                          'uuid': 'c1168eba-89a1-43af-86bd-b6c164dd0f94',
                                          'vcpus': 1},
                  'instance_type': {'created_at': '2018-03-26T13:05:22.000000',
                                    'deleted': False,
                                    'deleted_at': None,
                                    'description': None,
                                    'disabled': False,
                                    'ephemeral_gb': 0,
                                    'extra_specs': {},
                                    'flavorid': u'1',
                                    'id': 1,
                                    'is_public': True,
                                    'memory_mb': 512,
                                    'name': u'm1.tiny',
                                    'root_gb': 1,
                                    'rxtx_factor': 1.0,
                                    'swap': 0,
                                    'updated_at': None,
                                    'vcpu_weight': 0,
                                    'vcpus': 1},
                  'num_instances': 1},
 'state': 'error'}

---

    {'instance_id': 'd0c8163c-3050-4dd7-a7cf-66f03719d3b9',
     'instance_properties': {'availability_zone': None,
                             'ephemeral_gb': 0,
                             'memory_mb': 512,
                             'numa_topology': None,
                             'pci_requests': {'requests': []},
                             'project_id': u'6f70656e737461636b20342065766572',
                             'root_gb': 1,
                             'uuid': 'd0c8163c-3050-4dd7-a7cf-66f03719d3b9',
                             'vcpus': 1},
     'method': 'build_instances',
     'reason': "NoValidHost(u'No valid host was found. ',)",
     'request_spec': {'image': {'container_format': u'raw',
                                'created_at': '2011-01-01T01:02:03.000000',
                                'disk_format': u'raw',
                                'id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
                                'name': u'fakeimage123456',
                                'properties': {'hw_architecture': u'x86_64'},
                                'size': 25165824,
                                'status': u'active',
                                'updated_at': '2011-01-01T01:02:03.000000'},
                      'instance_properties': {'availability_zone': None,
                                              'ephemeral_gb': 0,
                                              'memory_mb': 512,
                                              'numa_topology': None,
                                              'pci_requests': {'requests': []},
                                              'project_id': u'6f70656e737461636b20342065766572',
                                              'root_gb': 1,
                                              'uuid': 'd0c8163c-3050-4dd7-a7cf-66f03719d3b9',
                                              'vcpus': 1},
                      'instance_type': {'created_at': '2018-03-26T13:02:12.000000',
                                        'deleted': False,
                                        'deleted_at': None,
                                        'description': None,
                                        'disabled': False,
                                        'ephemeral_gb': 0,
                                        'extra_specs': {},
                                        'flavorid': u'1',
                                        'id': 1,
                                        'is_public': True,
                                        'memory_mb': 512,
                                        'name': u'm1.tiny',
                                        'root_gb': 1,
                                        'rxtx_factor': 1.0,
                                        'swap': 0,
                                        'updated_at': None,
                                        'vcpu_weight': 0,
                                        'vcpus': 1},
                      'num_instances': 1},
     'state': 'error'}