)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2f455648c7aadf3d8eeff0c0b6bab2c1e9826595","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"02de92ba_6e349a46","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"updated":"2021-05-04 15:18:43.000000000","message":"nova neutron and cycborg have reliend on socket.gethostname returnign the same name as libvirt for years.\nif that value has chaged to nologer aling it a much bigger issues as it will cause the default value of the [DEFAULT]/host to change.\n\nthis will cause the nova compute agent to potentially be registered again as a new compute service.\nthe same is likely true in neutron so i dont think thrying to fix this in neutron alone is correct.\nwe need to fix it in ooo so that what ever chagne to cause the value to nolonger match is corrected.","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"19fe09526c0b2fd84c9a3b661b8f872f0d9dd6ce","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3d15f730_c264a312","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"02de92ba_6e349a46","updated":"2021-05-04 15:38:26.000000000","message":"IIUC nova has been relying on the get_hostname function in libvirt, not socket.gethostname, to determine resource provider name.\n\nI\u0027ve quickly gone through change log of libvirt but usage of getaddrinfo was added in v0.6.0, which was released in 2009.\n https://github.com/libvirt/libvirt/commit/fbba4423e92\n\nThis means that we can safely assume that libvirt relies on socket.gethostname + socket.getaddrinfo since resource provider was introduced and all compute node are registered with the name obtained by gethostname+getaddrinfo.\n\nNuetron can\u0027t register a resource provider record unless we fix the current inconsistency, so I don\u0027t expect this change will cause new provider record.\n\nTBH I\u0027m not sure what we should fix in OOO side. It\u0027s clear that socket.gethostname doesn\u0027t simulate get_hostname in libvirt, which is used by nova to determine resource provider name, and I still believe we should fix this problem at neutron side.","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"d4278cc5562cf3c1718ed1b5a6ebc457cc331a89","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7e2b1d39_ab2355da","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"3d15f730_c264a312","updated":"2021-05-04 15:57:15.000000000","message":"For example the following logic in stable/queens shows that nova uses hypervisor_hostname as resource provider name.\n https://github.com/openstack/nova/blob/stable/queens/nova/scheduler/client/report.py#L1382-L1383\n\nIf I\u0027m not mistaken the hypervisor_hostname is set using get_hostname() function in libvirt, which uses the virGetHostnameImpl function inside libvirt.\n https://github.com/openstack/nova/blob/stable/queens/nova/virt/libvirt/driver.py#L6587\n\nThe logic I\u0027m fixing is supposed to determine the compute resource provider name of the node, so it is reasonable to rely on the same logic as libvirt, since that is what nova relies to determine the compute resource provider name.\n\nNote if my observation is correct then we should also implement the same fix in Cyborg.","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"50492c8c0bdfdec90e9a677d2d7c8cc3600cbde3","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"f4eacf0c_01a7b5ba","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"4ba3a6a7_09b7d853","updated":"2021-05-04 17:00:26.000000000","message":"\u003e but I don\u0027t see there is no clear reason ...\n\nSorry I meant to say;\n\nI don\u0027t see any clear reason ...","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"515986c5021c461dcef7abf1e0da12f84b0cec40","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"62684cc7_beda8bb1","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"7e2b1d39_ab2355da","updated":"2021-05-04 16:22:52.000000000","message":"One minor correction...\n\nget_hostname is the name of fuction imeplemented in nova. The function name in libvirt is supposed to be getHostname()","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2ce25124fd46fb563605b21741d259bb7abb7fed","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"867fccc5_a5ba3ee7","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"7e2b1d39_ab2355da","updated":"2021-05-04 16:33:07.000000000","message":"we do but we also use socket.gethostname() for the [DEFAULT]/host config value\nhttps://github.com/openstack/nova/blob/master/nova/conf/netconf.py#L51-L70\n\nwhich is used as the host value for each of our service records.\n\nif the value of socket.gethostname() change it will cause the compute agent to register itself again since it will not find an existing compute service record. that will result in 2 comptue service record with 2 uuids for the same host. when the compute agent then tryies to create a placment RP for that host it will fail because it will use the hyperviour_hostname, in this case form libvirt with a different uuid from the new compute service record and get an RP name error. placement will not allow 2 RP with different UUIDs to have the same name. this will cause the agent to be unable to mange resouce in plcemant correctly.\n\n\nyou will not see this in ooo becaue ooo hardcoded the config value but if you use the defaults it would be an upgrade issue.\n\nif we were to make this change in neutron we whoudl have to asses every ohter location where socket.gethostnam is used and potentialy make the same place in all services.\nhttps://codesearch.opendev.org/?q\u003dsocket.gethostname\u0026i\u003dnope\u0026files\u003d\u0026excludeFiles\u003d\u0026repos\u003d","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"036af1feb2f177891ec952f2f434d115df5bfe0d","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"4ba3a6a7_09b7d853","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"867fccc5_a5ba3ee7","updated":"2021-05-04 16:59:29.000000000","message":"\u003e if we were to make this change in neutron we whoudl have to asses every ohter location where socket.gethostnam is used and potentialy make the same place in all services.\n\nI understand your concern related to socket.gethostname() and we should access that in TripleO, but I don\u0027t see there is no clear reason why we should block this change until we complete that assessment.\n\nAs I mentioned a compute resource provider name is determined by libvirt function. Since neutron is supposed to be able to find the proper resource provider record by default, it is reasonable to implement the compatible logic, rather that expecting that gethostname() and getHostname in libvirt always agree...","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d92a87e88878dd2321eced617191e4cba1e91d8d","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"feecfab0_e28aad9b","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"f4eacf0c_01a7b5ba","updated":"2021-05-04 18:13:26.000000000","message":"my concern is as follows\n\nif you install RHEL or other linux distribution adn set the hostname in /etc/hostname\nthen socket.gethostname() and virsh hostname will have the same value.\n\nin general we do not expect the FQDN to be retrune for either value\nwe expect just the shortname to be retruned in both cases.\n\nooo add the FQDN to /etc/hostname which is arguable an incorrect use of that file and it also add alias to it in /etc/hosts which cahnges that behavior.\n\nby default we do not expect the value to be an fqdn and im concerned that in a non ooo environment you could cause the same issue to happen in reverse. where virsh will return the short name and neutron will use the fqdn.\n\nneutron should also not have any code path that assume the virt driver is libvirt.\nfrom my point of view if socket.gethostname() is not the same as what is retruned form libvirt when we get the host name then the environ you are deploying nova in is not correctly configured.\n\nso im concerned you are makeing a configuration work that we do not expect to work.\nthis might be valid but if this was to happen in our downtream  OSP product then its a blocker bug as it could break upgrades.","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"692ce3e788a29cf7e458222f847342e45690ca24","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make default hypervisor hostname compatible with libvirt"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change ensures that neutron relies on the same logic as libvirt"},{"line_number":10,"context_line":"to generate hypervisor hostname, to fix imcompatible hostname format"},{"line_number":11,"context_line":"used in Nova and Neutron for resource provider name in some"},{"line_number":12,"context_line":"configuration pattens like the one generated by TripleO."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1926693"},{"line_number":15,"context_line":"Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"e56dd248_e1491626","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":56},"in_reply_to":"feecfab0_e28aad9b","updated":"2021-05-04 19:57:57.000000000","message":"\u003e in general we do not expect the FQDN to be retrune for either value\n\u003e we expect just the shortname to be retruned in both cases.\n\nI\u0027m not convinced with this.\nAccording to the implementation in libvirt, it is intended that virsh hostname returns FQDN.\n https://github.com/libvirt/libvirt/blob/master/src/util/virutil.c#L465-L472\n\n\n\u003e ooo add the FQDN to /etc/hostname which is arguable an incorrect use of that file and it also add alias to it in /etc/hosts which cahnges that behavior.\n\nIt was true for older version of TripleO but at least in Queens  OOO does NOT add FQDN to /etc/hostname.\n\nWhat makes libvirt return FQDN is the following description in /etc/hosts but this looks correct according to man https://man7.org/linux/man-pages/man5/hosts.5.html .\n\n\u003cIP\u003e compute-0.redhat.local compute-0\n\nIf we change this like;\n\n\u003cIP\u003e compute-0 compute-0.redhat.local\n\nthen virsh hostname returns compute-0, but this also makes \"hostname -f\" return shortname.\n\n\n\u003e neutron should also not have any code path that assume the virt driver is libvirt.\n\nI agree this logic is specific to libvirt but I don\u0027t think the current impelementatin with socket.gethostname supports all hypervisors. For example PowerVM driver uses CONF.host to set hypervisor_name. If that observation is correct then it would make sense to make the logic compatible with libvirt, which is the most common option.","commit_id":"7e92ca295069fcd7d2d80a6c102d89c814faddb1"}],"neutron/agent/common/utils.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"f9294c77814d23e45105b402b74d02715bccc3de","unresolved":true,"context_lines":[{"line_number":76,"context_line":"    This logic is implemented following the logic of virGetHostnameImpl"},{"line_number":77,"context_line":"    in libvirt\"\"\""},{"line_number":78,"context_line":"    hypervisor_hostname \u003d socket.gethostname()"},{"line_number":79,"context_line":"    if hypervisor_hostname.startswith(\u0027localhost\u0027) or \\"},{"line_number":80,"context_line":"            \u0027.\u0027 in hypervisor_hostname:"},{"line_number":81,"context_line":"        return hypervisor_hostname"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"0b1e0be5_2d5ff712","line":80,"range":{"start_line":79,"start_character":7,"end_line":80,"end_character":38},"updated":"2021-04-30 07:12:56.000000000","message":"micro nit: we usually use parenthesis to wrap a multiple line command.","commit_id":"0d6e9b0dafad02de1a9c222108253747e60f42ac"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"f8e3e0a5bfa3e07043ba0b05f352efa974029172","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    This logic is implemented following the logic of virGetHostnameImpl"},{"line_number":77,"context_line":"    in libvirt\"\"\""},{"line_number":78,"context_line":"    hypervisor_hostname \u003d socket.gethostname()"},{"line_number":79,"context_line":"    if hypervisor_hostname.startswith(\u0027localhost\u0027) or \\"},{"line_number":80,"context_line":"            \u0027.\u0027 in hypervisor_hostname:"},{"line_number":81,"context_line":"        return hypervisor_hostname"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f54c0ec_35b778f6","line":80,"range":{"start_line":79,"start_character":7,"end_line":80,"end_character":38},"in_reply_to":"0b1e0be5_2d5ff712","updated":"2021-04-30 07:50:21.000000000","message":"Done","commit_id":"0d6e9b0dafad02de1a9c222108253747e60f42ac"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"f9294c77814d23e45105b402b74d02715bccc3de","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                                      port\u003dNone,"},{"line_number":86,"context_line":"                                      family\u003dsocket.AF_UNSPEC,"},{"line_number":87,"context_line":"                                      flags\u003dsocket.AI_CANONNAME)"},{"line_number":88,"context_line":"        # getaddrinfo returns a list of 5-touples with;"},{"line_number":89,"context_line":"        #     (family, type, proto, canonname, sockaddr)"},{"line_number":90,"context_line":"        if addrinfo and addrinfo[0][3] and \\"},{"line_number":91,"context_line":"                not addrinfo[0][3].startswith(\u0027localhost\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ed86474b_43c76fef","line":88,"range":{"start_line":88,"start_character":42,"end_line":88,"end_character":49},"updated":"2021-04-30 07:12:56.000000000","message":"tuples","commit_id":"0d6e9b0dafad02de1a9c222108253747e60f42ac"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"f8e3e0a5bfa3e07043ba0b05f352efa974029172","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                                      port\u003dNone,"},{"line_number":86,"context_line":"                                      family\u003dsocket.AF_UNSPEC,"},{"line_number":87,"context_line":"                                      flags\u003dsocket.AI_CANONNAME)"},{"line_number":88,"context_line":"        # getaddrinfo returns a list of 5-touples with;"},{"line_number":89,"context_line":"        #     (family, type, proto, canonname, sockaddr)"},{"line_number":90,"context_line":"        if addrinfo and addrinfo[0][3] and \\"},{"line_number":91,"context_line":"                not addrinfo[0][3].startswith(\u0027localhost\u0027):"}],"source_content_type":"text/x-python","patch_set":3,"id":"cf21675a_c232a990","line":88,"range":{"start_line":88,"start_character":42,"end_line":88,"end_character":49},"in_reply_to":"ed86474b_43c76fef","updated":"2021-04-30 07:50:21.000000000","message":"Done","commit_id":"0d6e9b0dafad02de1a9c222108253747e60f42ac"}]}
