During the Third instance update when the model_query with update runs in the sqlalchemy api the updated_at field magically updated. https://github.com/openstack/nova/blob/57473088857014d7f46c17ffb3a476e09e0db30f/nova/db/sqlalchemy/api.py#L2741
Before model_query the values parameter of that model_query call does not contain the update_at field.
Some home made tracing of these code parts:
build_and_run_instance before instance_claim None resource_tracker before set_instance_host_and_node None _set_instance_host_and_node before save None instance.save() before instance_extra_update_by_uuid None {'numa_topology': None, 'flavor': '{"new": null, "cur": {"nova_object.changes": ["extra_specs"], "nova_object.name": "Flavor", "nova_object.namespace": "nova", "nova_object.version": "1.1", "nova_object.data": {"rxtx_factor": 1.0, "is_public": true, "deleted": false, "name": "test_flavor", "vcpu_weight": 0, "root_gb": 1, "extra_specs": {"hw:watchdog_action": "disabled"}, "ephemeral_gb": 0, "swap": 0, "disabled": false, "updated_at": null, "vcpus": 1, "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3", "id": 7, "created_at": "2012-10-29T13:42:11Z", "deleted_at": null, "memory_mb": 512}}, "old": null}', 'pci_requests': '[]'} instance.save() before instance_update_and_get_original None {'system_metadata': {u'image_min_disk': u'1', 'boot_roles': u'', u'image_kernel_id': u'nokernel', u'image_container_format': u'raw', u'image_base_image_ref': u'155d900f-4e14-4e4c-a73d-069cbf4541e6', u'owner_project_name': None, u'image_disk_format': u'raw', u'owner_user_name': None, u'image_architecture': u'x86_64', u'image_ramdisk_id': u'nokernel'}, 'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} convert_object_related_datetimes values, keys {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} ('created_at', 'deleted_at', 'updated_at', 'launched_at', 'terminated_at') convert_object_related_datetimes returning {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} _instance_update before model_query {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} _instance_update after model_query 2012-10-29 13:42:11 _instance_update returns 2012-10-29 13:42:11 instance.save() after instance_update_and_get_original + from_db_object 2012-10-29 13:42:11+00:00
I'm totally puzzled how that model_query call ends up updating the update_at field.
During the Third instance update when the model_query with update runs in the sqlalchemy api the updated_at field magically updated. /github. com/openstack/ nova/blob/ 57473088857014d 7f46c17ffb3a476 e09e0db30f/ nova/db/ sqlalchemy/ api.py# L2741
https:/
Before model_query the values parameter of that model_query call does not contain the update_at field.
Some home made tracing of these code parts:
build_ and_run_ instance before instance_claim None tracker before set_instance_ host_and_ node None instance_ host_and_ node before save None extra_update_ by_uuid None {'numa_topology': None, 'flavor': '{"new": null, "cur": {"nova_ object. changes" : ["extra_specs"], "nova_object.name": "Flavor", "nova_object. namespace" : "nova", "nova_object. version" : "1.1", "nova_object.data": {"rxtx_factor": 1.0, "is_public": true, "deleted": false, "name": "test_flavor", "vcpu_weight": 0, "root_gb": 1, "extra_specs": {"hw:watchdog_ action" : "disabled"}, "ephemeral_gb": 0, "swap": 0, "disabled": false, "updated_at": null, "vcpus": 1, "flavorid": "a22d5517- 147c-4147- a0d1-e698df5cd4 e3", "id": 7, "created_at": "2012-10- 29T13:42: 11Z", "deleted_at": null, "memory_mb": 512}}, "old": null}', 'pci_requests': '[]'} update_ and_get_ original None {'system_metadata': {u'image_min_disk': u'1', 'boot_roles': u'', u'image_kernel_id': u'nokernel', u'image_ container_ format' : u'raw', u'image_ base_image_ ref': u'155d900f- 4e14-4e4c- a73d-069cbf4541 e6', u'owner_ project_ name': None, u'image_ disk_format' : u'raw', u'owner_user_name': None, u'image_ architecture' : u'x86_64', u'image_ ramdisk_ id': u'nokernel'}, 'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} object_ related_ datetimes values, keys {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} ('created_at', 'deleted_at', 'updated_at', 'launched_at', 'terminated_at') object_ related_ datetimes returning {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} update before model_query {'host': u'compute', 'node': u'fake-mini', 'launched_on': u'compute'} update after model_query 2012-10-29 13:42:11 update returns 2012-10-29 13:42:11 update_ and_get_ original + from_db_object 2012-10-29 13:42:11+00:00
resource_
_set_
instance.save() before instance_
instance.save() before instance_
convert_
convert_
_instance_
_instance_
_instance_
instance.save() after instance_
I'm totally puzzled how that model_query call ends up updating the update_at field.