)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"56e50ffb0b19c1d3a3ddfca4c32f2e87d11e2b54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"cdbea3cc_b02759a5","updated":"2025-09-05 04:11:58.000000000","message":"https://review.opendev.org/c/openstack/nova/+/959604","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"decd5b24adda7f641f0eaf114764ed151a880e40","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"387947a1_7269906a","updated":"2025-09-04 17:32:15.000000000","message":"working on UTs","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8af209ac6eae75795461ce6c845616238e55a477","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"214b45b0_b9fd230d","updated":"2025-09-05 11:23:09.000000000","message":"A reno and / or some API doc update would be useful. Especially stating that form now on the freshness of the uptime value will depend on the frequency of the periodic and that is configurable via [DEFAULT]update_resources_interval","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f4a753207dd3ff084e384c1d5c9cf0803d8b97e4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"2896769d_679bb462","updated":"2025-09-05 16:52:08.000000000","message":"I still prefer this patch as it is closer to how this should work, among the other reasons.","commit_id":"6a56d4158c35e1782d7da385473649b8639be0e6"}],"nova/api/openstack/compute/hypervisors.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"959c39e3c229e370445c9a2ad9410e0f94c50fd9","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        if detail and api_version_request.is_supported(req, \u00272.88\u0027):"},{"line_number":99,"context_line":"            # Not all virt drivers support this, and it\u0027s not generally"},{"line_number":100,"context_line":"            # possible to get uptime for a down host"},{"line_number":101,"context_line":"            hyp_dict[\u0027uptime\u0027] \u003d hypervisor.stats.get(\u0027uptime\u0027, None)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if servers:"},{"line_number":104,"context_line":"            hyp_dict[\u0027servers\u0027] \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"60c66708_79989570","line":101,"updated":"2025-09-04 17:39:07.000000000","message":"I think this should get it from the stats if present and fall back to the old RPC for the time being. Otherwise this will break upgrades, which is one place that the uptime information might be useful.\n\nJust fall back if `\u0027uptime\u0027 not in stats`.","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"2e46ca80aa7353d211824c21d851727be0090bb0","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        if detail and api_version_request.is_supported(req, \u00272.88\u0027):"},{"line_number":99,"context_line":"            # Not all virt drivers support this, and it\u0027s not generally"},{"line_number":100,"context_line":"            # possible to get uptime for a down host"},{"line_number":101,"context_line":"            hyp_dict[\u0027uptime\u0027] \u003d hypervisor.stats.get(\u0027uptime\u0027, None)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if servers:"},{"line_number":104,"context_line":"            hyp_dict[\u0027servers\u0027] \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"e48a9bd3_b06d0be2","line":101,"in_reply_to":"60c66708_79989570","updated":"2025-09-04 17:51:10.000000000","message":"++ fallback will make sure we do provide it always if only controller is upgraded.","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dec09904bc1606c18e04113bdc115c93641f418d","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        if detail and api_version_request.is_supported(req, \u00272.88\u0027):"},{"line_number":99,"context_line":"            # Not all virt drivers support this, and it\u0027s not generally"},{"line_number":100,"context_line":"            # possible to get uptime for a down host"},{"line_number":101,"context_line":"            hyp_dict[\u0027uptime\u0027] \u003d hypervisor.stats.get(\u0027uptime\u0027, None)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if servers:"},{"line_number":104,"context_line":"            hyp_dict[\u0027servers\u0027] \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"e394596f_d21709ab","line":101,"in_reply_to":"c95b7462_13b94e19","updated":"2025-09-04 18:56:20.000000000","message":"Ahah, good point Dan !","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"bb267d06b4c8f7fa1c794f4570338446cd171463","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        if detail and api_version_request.is_supported(req, \u00272.88\u0027):"},{"line_number":99,"context_line":"            # Not all virt drivers support this, and it\u0027s not generally"},{"line_number":100,"context_line":"            # possible to get uptime for a down host"},{"line_number":101,"context_line":"            hyp_dict[\u0027uptime\u0027] \u003d hypervisor.stats.get(\u0027uptime\u0027, None)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if servers:"},{"line_number":104,"context_line":"            hyp_dict[\u0027servers\u0027] \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"7f1b3ecd_0d1276eb","line":101,"in_reply_to":"e394596f_d21709ab","updated":"2025-09-05 07:59:52.000000000","message":"Done","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8e925e1f776422656831749d7bc102c52f5844ea","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        if detail and api_version_request.is_supported(req, \u00272.88\u0027):"},{"line_number":99,"context_line":"            # Not all virt drivers support this, and it\u0027s not generally"},{"line_number":100,"context_line":"            # possible to get uptime for a down host"},{"line_number":101,"context_line":"            hyp_dict[\u0027uptime\u0027] \u003d hypervisor.stats.get(\u0027uptime\u0027, None)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if servers:"},{"line_number":104,"context_line":"            hyp_dict[\u0027servers\u0027] \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"c95b7462_13b94e19","line":101,"in_reply_to":"e48a9bd3_b06d0be2","updated":"2025-09-04 18:01:23.000000000","message":"i have that fallback in my local version ill push it up when i finish it as a sepeate reviwe and we can decied what way to go.\n\nbut i agree with having the fallback","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"}],"nova/tests/unit/api/openstack/compute/test_hypervisors.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8af209ac6eae75795461ce6c845616238e55a477","unresolved":true,"context_lines":[{"line_number":1541,"context_line":"        self.assertEqual({\u0027hypervisor\u0027: expected_dict}, result)"},{"line_number":1542,"context_line":"        self.assertEqual("},{"line_number":1543,"context_line":"            0,"},{"line_number":1544,"context_line":"            self.controller.host_api.get_host_uptime.call_count"},{"line_number":1545,"context_line":"        )"},{"line_number":1546,"context_line":""},{"line_number":1547,"context_line":"    def test_show_old_version(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"037499ee_a671f0c3","line":1544,"updated":"2025-09-05 11:23:09.000000000","message":"OK so this tests that when we have the data in stats we don\u0027t call the RPC.\n\nDo we have a test that uses 2.88 and calls the RPC as the data is not available in the stats (e.g. not yet updated compute)?","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"de47506c06849c916f552d0bdf8cb8fe84cba09a","unresolved":true,"context_lines":[{"line_number":1541,"context_line":"        self.assertEqual({\u0027hypervisor\u0027: expected_dict}, result)"},{"line_number":1542,"context_line":"        self.assertEqual("},{"line_number":1543,"context_line":"            0,"},{"line_number":1544,"context_line":"            self.controller.host_api.get_host_uptime.call_count"},{"line_number":1545,"context_line":"        )"},{"line_number":1546,"context_line":""},{"line_number":1547,"context_line":"    def test_show_old_version(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"4a213ccb_b45a98ae","line":1544,"in_reply_to":"037499ee_a671f0c3","updated":"2025-09-05 14:31:40.000000000","message":"Just above, see L1517 and above tests (it uses the first hypervisor which doesn\u0027t have a stats value)","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"959c39e3c229e370445c9a2ad9410e0f94c50fd9","unresolved":true,"context_lines":[{"line_number":10378,"context_line":""},{"line_number":10379,"context_line":"        # Add uptime data into stats by calling get_host_uptime"},{"line_number":10380,"context_line":"        data[\u0027stats\u0027] \u003d {}"},{"line_number":10381,"context_line":"        data[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":10382,"context_line":""},{"line_number":10383,"context_line":"        return data"},{"line_number":10384,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"e17a47b5_529e84ed","line":10381,"updated":"2025-09-04 17:39:07.000000000","message":"Hmm, this results in us adding this to the object? If so, I believe you, but seems weird. I was also expecting this to be done from the resource tracker or compute manager and not per virt driver. Because this will mean other virt drivers don\u0027t report anything. It would be better if, for example, vmware did report this but with None so that we know whether we need to fall back to RPC or not. Doing it in a general place helps make that consistent.","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dec09904bc1606c18e04113bdc115c93641f418d","unresolved":true,"context_lines":[{"line_number":10378,"context_line":""},{"line_number":10379,"context_line":"        # Add uptime data into stats by calling get_host_uptime"},{"line_number":10380,"context_line":"        data[\u0027stats\u0027] \u003d {}"},{"line_number":10381,"context_line":"        data[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":10382,"context_line":""},{"line_number":10383,"context_line":"        return data"},{"line_number":10384,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"f54e2021_ddce94cf","line":10381,"in_reply_to":"668552e6_9729e869","updated":"2025-09-04 18:56:20.000000000","message":"I checked that only zwm and libvirt provide a uptime by get_host_uptime().\nDan, yeah, when passing back the resources, then the RT get them and then persist them automatically. \nAs an example with my own devstack AIO : \n```\nmysql\u003e select stats from compute_nodes;\n+---------------------------------------------------------------------------------------------------------------+\n| stats                                                                                                         |\n+---------------------------------------------------------------------------------------------------------------+\n| {\"failed_builds\": \"0\", \"uptime\": \" 18:47:01 up 437 days,  3:35,  4 users,  load average: 0.03, 0.05, 0.05\\n\"} |\n+---------------------------------------------------------------------------------------------------------------+\n1 row in set (0.00 sec)\n\n```","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"99da7b9078999f716e36b17c9634cf73fde5b516","unresolved":true,"context_lines":[{"line_number":10378,"context_line":""},{"line_number":10379,"context_line":"        # Add uptime data into stats by calling get_host_uptime"},{"line_number":10380,"context_line":"        data[\u0027stats\u0027] \u003d {}"},{"line_number":10381,"context_line":"        data[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":10382,"context_line":""},{"line_number":10383,"context_line":"        return data"},{"line_number":10384,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"e4e5a30f_41e671c6","line":10381,"in_reply_to":"e17a47b5_529e84ed","updated":"2025-09-04 18:34:51.000000000","message":"this is in theory the uptime of the hypervior not the host the compute agent runs on so for vmware or ironci it would be uptime of the remove baremental node.\n\nwith that said this si pretty ill defiend today so would could make the uptime fo the host runing the comptue serivce if we choose too and then do it form update aviable resouce in the compute manger part","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"847436c9f6031cfb0afde84752c0a92c9a3701d3","unresolved":true,"context_lines":[{"line_number":10378,"context_line":""},{"line_number":10379,"context_line":"        # Add uptime data into stats by calling get_host_uptime"},{"line_number":10380,"context_line":"        data[\u0027stats\u0027] \u003d {}"},{"line_number":10381,"context_line":"        data[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":10382,"context_line":""},{"line_number":10383,"context_line":"        return data"},{"line_number":10384,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"668552e6_9729e869","line":10381,"in_reply_to":"e4e5a30f_41e671c6","updated":"2025-09-04 18:41:00.000000000","message":"Not sure if you\u0027re responding to my comment or just ruminating, but... regardless of whether or not vmware or ironic put something useful (or maintain parity with libvirt), this should (IMHO) be done in a central location so that regardless of the behavior of the driver, this key ends up in the stats dict if the compute manager is new enough. That\u0027s the signal to the API about whether or not it needs to fall back to the RPC (key missing) or report None (key not missing, but hypervisor provides no value).\n\nI really don\u0027t care what vmware or ironic do here, whether they leave it unimplemented, report the host\u0027s uptime, or try to report the uptime of the thing they\u0027re managing. Because this is so hypervisor specific and ill-defined, the contents don\u0027t really matter to me, but the way we internally signal and fall back if necessary does.","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f4a753207dd3ff084e384c1d5c9cf0803d8b97e4","unresolved":true,"context_lines":[{"line_number":10378,"context_line":""},{"line_number":10379,"context_line":"        # Add uptime data into stats by calling get_host_uptime"},{"line_number":10380,"context_line":"        data[\u0027stats\u0027] \u003d {}"},{"line_number":10381,"context_line":"        data[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":10382,"context_line":""},{"line_number":10383,"context_line":"        return data"},{"line_number":10384,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"f64d868f_09c0f707","line":10381,"in_reply_to":"f54e2021_ddce94cf","updated":"2025-09-05 16:52:08.000000000","message":"What I was going for here was putting this generically in `update_available_resource()` so that we get it (even if `None`) for all drivers automatically. That provides the sentinel to the API that it\u0027s being reported, it\u0027s just None, thus no need to make the RPC call. Even if we leave this here, it would be trivial for the RT to `stats.setdefault(\u0027uptime\u0027, None)` to make sure it\u0027s there.","commit_id":"80839afc82bf9bd022cf810db43a6316ae5bbc56"}],"nova/virt/zvm/driver.py":[{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"96b4e88041a5247be2a38851780d4b1d6a7d66c4","unresolved":true,"context_lines":[{"line_number":136,"context_line":"        }"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Add uptime data by calling get_host_uptime"},{"line_number":139,"context_line":"        res[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        LOG.debug(\"Getting available resource for %(host)s:%(nodename)s\","},{"line_number":142,"context_line":"                  {\u0027host\u0027: CONF.host, \u0027nodename\u0027: nodename})"}],"source_content_type":"text/x-python","patch_set":2,"id":"243bd7b1_323fc8a0","line":139,"updated":"2025-09-05 08:11:57.000000000","message":"Does that comment add any value?\n\nsean-k-mooney has this call directly in line 135 and imho that looks nicer as the dict gets built in one place and provides a direct overview of what\u0027s in there.","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"e3d9cea6492fb7fb24ba9d7ed8bbc542396e3980","unresolved":true,"context_lines":[{"line_number":136,"context_line":"        }"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Add uptime data by calling get_host_uptime"},{"line_number":139,"context_line":"        res[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        LOG.debug(\"Getting available resource for %(host)s:%(nodename)s\","},{"line_number":142,"context_line":"                  {\u0027host\u0027: CONF.host, \u0027nodename\u0027: nodename})"}],"source_content_type":"text/x-python","patch_set":2,"id":"39f2995e_b830e0b3","line":139,"in_reply_to":"243bd7b1_323fc8a0","updated":"2025-09-05 10:23:12.000000000","message":"Yeah, feels llm\u0027y too... Aren\u0027t we still supposed to use the `Generated-by` trailer if e.g. cursor was used?","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f397c1991b92c3f45ff530d0d5e5fb354a67704d","unresolved":true,"context_lines":[{"line_number":136,"context_line":"        }"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Add uptime data by calling get_host_uptime"},{"line_number":139,"context_line":"        res[\u0027stats\u0027][\"uptime\"] \u003d self.get_host_uptime()"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        LOG.debug(\"Getting available resource for %(host)s:%(nodename)s\","},{"line_number":142,"context_line":"                  {\u0027host\u0027: CONF.host, \u0027nodename\u0027: nodename})"}],"source_content_type":"text/x-python","patch_set":2,"id":"339e29e4_a09a51a6","line":139,"in_reply_to":"39f2995e_b830e0b3","updated":"2025-09-05 14:30:11.000000000","message":"I haven\u0027t used Cursor for generating code FWIW, I just wrote by myself this comment 😐","commit_id":"e54399dd838c29557e939c31aecdf5e732c6ed09"}]}
