)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"20e11a3aac5679461dbadec7b714856e56981413","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The term data locality here refers to having an instance and an attached"},{"line_number":10,"context_line":"volume on the same physical host.  This can be desirable in some"},{"line_number":11,"context_line":"configurations, in order to improve disk throughput and reduce latency."},{"line_number":12,"context_line":"In order to work, physical hosts should run both nova-compute and"},{"line_number":13,"context_line":"cinder-volume services."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa98f980_6b18c11e","line":11,"updated":"2014-09-03 00:20:57.000000000","message":"Is it useful to allow user to specify UUID of instances and ask Cinder NOT to put volume on to the hosts of volumes, in order to get HA benefit?","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"54294adf9d6d206222060f5c4b370f4840314a6c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The term data locality here refers to having an instance and an attached"},{"line_number":10,"context_line":"volume on the same physical host.  This can be desirable in some"},{"line_number":11,"context_line":"configurations, in order to improve disk throughput and reduce latency."},{"line_number":12,"context_line":"In order to work, physical hosts should run both nova-compute and"},{"line_number":13,"context_line":"cinder-volume services."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa98f980_30d0dac8","line":11,"in_reply_to":"fa98f980_6b18c11e","updated":"2014-09-03 09:13:51.000000000","message":"I\u0027m not sure I understand what you mean by high-availability benefit. If it\u0027s about preventing failures, the user should replicate instances and volumes on different hosts (eg. using the DifferentBackend filter). Simply separating an instance and its attached volume with cause failure in case one of the two physical hosts goes down.\nPlease correct me if I\u0027m wrong or if I misunderstood your point.","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"  To create a volume in a back-end hosted by HOST1:"},{"line_number":29,"context_line":"    cinder create --hint local_to_instance\u003dINSTANCE-UUID SIZE"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"DocImpact"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Change-Id: Id428fa2132c1afed424443083645787ee3cb0399"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa98f980_b63fd786","line":30,"updated":"2014-09-17 06:15:45.000000000","message":"Has the bp been drafted somewhere? It will be good to see a link to the blueprint registered in launchpad here, and submit a bp patch to cinder-specs.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1ff3b29d048be1ad6a488bb8f862f3ee120bd7c0","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"  To create a volume in a back-end hosted by HOST1:"},{"line_number":29,"context_line":"    cinder create --hint local_to_instance\u003dINSTANCE-UUID SIZE"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"DocImpact"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Change-Id: Id428fa2132c1afed424443083645787ee3cb0399"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa98f980_2ecc6b8a","line":30,"in_reply_to":"fa98f980_b63fd786","updated":"2014-09-17 08:15:26.000000000","message":"There isn\u0027t any blueprint currently, because we were hoping this feature could make it into Juno quickly. Now, writing a blueprint is a good idea, I\u0027ll try do find some time to do it.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"}],"cinder/exception.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"fd0712b7d8175990b6b014db4824c5dcc6829650","unresolved":false,"context_lines":[{"line_number":230,"context_line":""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"class APIException(CinderException):"},{"line_number":233,"context_line":"    message \u003d _(\"Error while requesting %(service)s API.\")"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, message\u003dNone, **kwargs):"},{"line_number":236,"context_line":"        if \u0027service\u0027 not in kwargs:"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_8926bc14","line":233,"updated":"2015-01-06 12:46:18.000000000","message":"Not sure that it should child of CinderException","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"bc48da65d4cfc74437f99e96b0a2f8d3640f080b","unresolved":false,"context_lines":[{"line_number":230,"context_line":""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"class APIException(CinderException):"},{"line_number":233,"context_line":"    message \u003d _(\"Error while requesting %(service)s API.\")"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, message\u003dNone, **kwargs):"},{"line_number":236,"context_line":"        if \u0027service\u0027 not in kwargs:"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_9e9b2c16","line":233,"in_reply_to":"3a961159_6946f07c","updated":"2015-01-07 13:54:22.000000000","message":"Agreed.","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"80661482101193d6265a7c3243c9e334304e73a9","unresolved":false,"context_lines":[{"line_number":230,"context_line":""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"class APIException(CinderException):"},{"line_number":233,"context_line":"    message \u003d _(\"Error while requesting %(service)s API.\")"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def __init__(self, message\u003dNone, **kwargs):"},{"line_number":236,"context_line":"        if \u0027service\u0027 not in kwargs:"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_6946f07c","line":233,"in_reply_to":"3a961159_8926bc14","updated":"2015-01-06 12:54:32.000000000","message":"Why not?\n\nIn my opinion all exceptions generated in Cinder code should inherit from CinderException, so they can be catched as from within Cinder\u0027s code, and not treated as external Exceptions.","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"fd0712b7d8175990b6b014db4824c5dcc6829650","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        super(APIException, self).__init__(message, **kwargs)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class APITimeout(APIException):"},{"line_number":242,"context_line":"    message \u003d _(\"Timeout while requesting %(service)s API.\")"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_a9237803","line":241,"updated":"2015-01-06 12:46:18.000000000","message":"Same here","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"}],"cinder/scheduler/filters/datalocality_filter.py":[{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"4839c8a1574119f8a8c89aae618ae4d32f2d58f2","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                list(False, {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # With no local_to_instance key"},{"line_number":58,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_a0d90285","line":58,"updated":"2014-09-02 11:40:16.000000000","message":"Can we move this code around slightly so that we can add a debug log as to why the filter passed please (no key or host matched)? Thanks","commit_id":"52a1cf26127b6b1655dd535b74b9dcce42d1404b"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"b3d866413399c4f8a157cfc60339c30f55938801","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                list(False, {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # With no local_to_instance key"},{"line_number":58,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_7b734f80","line":58,"in_reply_to":"fa98f980_a0d90285","updated":"2014-09-02 12:17:00.000000000","message":"Sure. Done.","commit_id":"52a1cf26127b6b1655dd535b74b9dcce42d1404b"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"20e11a3aac5679461dbadec7b714856e56981413","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        # Transform \u0027host@backend\u0027 into \u0027host\u0027"},{"line_number":36,"context_line":"        host \u003d host_state.host"},{"line_number":37,"context_line":"        if \u0027@\u0027 in host:"},{"line_number":38,"context_line":"            host \u003d host.split(\u0027@\u0027)[0]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Scheduler hint verification: local_to_instance should be the UUID of"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a8654f1f","line":37,"updated":"2014-09-03 00:20:57.000000000","message":"use cinder/volume/utils.py extract_host(host, \u0027host\u0027) to do this instead, pls.","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"54294adf9d6d206222060f5c4b370f4840314a6c","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        # Transform \u0027host@backend\u0027 into \u0027host\u0027"},{"line_number":36,"context_line":"        host \u003d host_state.host"},{"line_number":37,"context_line":"        if \u0027@\u0027 in host:"},{"line_number":38,"context_line":"            host \u003d host.split(\u0027@\u0027)[0]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Scheduler hint verification: local_to_instance should be the UUID of"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_b0912af3","line":37,"in_reply_to":"fa98f980_a8654f1f","updated":"2014-09-03 09:13:51.000000000","message":"Sure, thanks.","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"20e11a3aac5679461dbadec7b714856e56981413","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        if \u0027@\u0027 in host:"},{"line_number":38,"context_line":"            host \u003d host.split(\u0027@\u0027)[0]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Scheduler hint verification: local_to_instance should be the UUID of"},{"line_number":41,"context_line":"        # an instance.  If this instance is hosted on the same physical host"},{"line_number":42,"context_line":"        # as the one hosting volumes being checked, match."},{"line_number":43,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_0871fbdf","line":40,"updated":"2014-09-03 00:20:57.000000000","message":"or list of UUIDs?","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"54294adf9d6d206222060f5c4b370f4840314a6c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        if \u0027@\u0027 in host:"},{"line_number":38,"context_line":"            host \u003d host.split(\u0027@\u0027)[0]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Scheduler hint verification: local_to_instance should be the UUID of"},{"line_number":41,"context_line":"        # an instance.  If this instance is hosted on the same physical host"},{"line_number":42,"context_line":"        # as the one hosting volumes being checked, match."},{"line_number":43,"context_line":"        scheduler_hints \u003d filter_properties.get(\u0027scheduler_hints\u0027) or {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_30e7faad","line":40,"in_reply_to":"fa98f980_0871fbdf","updated":"2014-09-03 09:13:51.000000000","message":"In my opinion, this is not useful: if a user gives a list of UUIDs, he/she implicitly means those instances are on the same host (otherwise the request will never succeed). So passing the UUID of only one of them is enough.","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"20e11a3aac5679461dbadec7b714856e56981413","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                return False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"            if nova.novaclient(context).servers.\\"},{"line_number":55,"context_line":"                    list(False, {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}):"},{"line_number":56,"context_line":"                # Instance is hosted there"},{"line_number":57,"context_line":"                return True"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_ab9d49be","line":55,"updated":"2014-09-03 00:20:57.000000000","message":"the result really should be cached in the case when there are multiple cinder backends.  this is the exact case this filter can be useful, tens of compute nodes, tens of cinder volume hosts, we don\u0027t need to query Nova for that many times.","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"405824741c02959769ef378f1a89112ff497b549","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                return False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"            if nova.novaclient(context).servers.\\"},{"line_number":55,"context_line":"                    list(False, {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}):"},{"line_number":56,"context_line":"                # Instance is hosted there"},{"line_number":57,"context_line":"                return True"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a5748236","line":55,"in_reply_to":"fa98f980_ab9d49be","updated":"2014-09-03 12:38:32.000000000","message":"Done","commit_id":"14500de5eb3b722e7d4d9c1fe43d3638e002d0d1"}],"cinder/scheduler/filters/instance_locality_filter.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"87f07562c4f77314faee83ca43149ba27432c466","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_449ee755","line":1,"updated":"2014-11-28 06:26:23.000000000","message":"What is this line about?  Usually Copyright should be the first line.","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"69872f726ebeabbeacfd88a29e5f4d9b0a47bd99","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_62167257","line":1,"in_reply_to":"5a890539_449ee755","updated":"2014-11-28 09:56:06.000000000","message":"This header makes unicode files readable by the Python 2 interpreter (otherwise it fails). Here it is needed for the accent in my name.\n\nIt\u0027s a Python standard (PEP0263) [1] [2], and is present in dozens of files across Openstack (everywhere unicode chars are present).\n\n[1]: http://legacy.python.org/dev/peps/pep-0263/\n\n[2]: https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"213a5b35cf67adc14fe2872a563011d1f7f88364","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_051cca69","line":1,"in_reply_to":"5a890539_62167257","updated":"2014-11-28 21:27:12.000000000","message":"I didn\u0027t know that. Thanks for the explanation.","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"6d9a07da94419be617d7df5f239846def59e35e4","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"hint_keyword \u003d \u0027local_to_instance\u0027"},{"line_number":29,"context_line":"instance_host_prop \u003d \u0027OS-EXT-SRV-ATTR:host\u0027"},{"line_number":30,"context_line":"requests_timeout \u003d 5"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_26d29134","line":28,"updated":"2014-12-01 16:45:56.000000000","message":"all caps?","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1c42582c0442dae373dfe1219b840b8c49a30f74","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"hint_keyword \u003d \u0027local_to_instance\u0027"},{"line_number":29,"context_line":"instance_host_prop \u003d \u0027OS-EXT-SRV-ATTR:host\u0027"},{"line_number":30,"context_line":"requests_timeout \u003d 5"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_e9c69915","line":28,"in_reply_to":"5a890539_26d29134","updated":"2014-12-01 18:08:52.000000000","message":"Why not :)","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"6e7aa0ec77abb5ec979e78f8e23fedbf03758833","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            raise exception.InvalidUUID(uuid\u003dinstance_uuid)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_fdff7c33","line":85,"updated":"2014-11-27 11:24:39.000000000","message":"Is this cache going to work if there has been VM migration? Not a reason to block the patch, but if not then it might suggest some follow-on work","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1a80aecb64a885e7db542cdf037d63f624a115be","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            raise exception.InvalidUUID(uuid\u003dinstance_uuid)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_4ee29430","line":85,"in_reply_to":"5a890539_fdff7c33","updated":"2014-11-27 12:33:29.000000000","message":"For each volume scheduling, a new InstanceLocalityFilter object will be created. This means the cache lives only during spawning.\n\nSo if user migrates a VM and creates a volume right after, it should work fine (assuming Nova API itself does not cache).","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"6d9a07da94419be617d7df5f239846def59e35e4","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" dropped because ExtendedServerAttributes \u0027"},{"line_number":90,"context_line":"                          \u0027not active in Nova.\u0027), hint_keyword)"},{"line_number":91,"context_line":"            raise exception.CinderException(_(\u0027Hint \"%s\" not supported.\u0027) %"},{"line_number":92,"context_line":"                                            hint_keyword)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_e6740938","line":89,"updated":"2014-12-01 16:45:56.000000000","message":"What about using the marker _LW?","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1c42582c0442dae373dfe1219b840b8c49a30f74","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" dropped because ExtendedServerAttributes \u0027"},{"line_number":90,"context_line":"                          \u0027not active in Nova.\u0027), hint_keyword)"},{"line_number":91,"context_line":"            raise exception.CinderException(_(\u0027Hint \"%s\" not supported.\u0027) %"},{"line_number":92,"context_line":"                                            hint_keyword)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_29d181cd","line":89,"in_reply_to":"5a890539_e6740938","updated":"2014-12-01 18:08:52.000000000","message":"You\u0027re right.","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"6d9a07da94419be617d7df5f239846def59e35e4","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                                       timeout\u003drequests_timeout)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        if not hasattr(server, instance_host_prop):"},{"line_number":98,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" dropped because Nova did not return \u0027"},{"line_number":99,"context_line":"                          \u0027enough information. Either Nova policy needs to be \u0027"},{"line_number":100,"context_line":"                          \u0027changed or a Nova admin account should be \u0027"},{"line_number":101,"context_line":"                          \u0027specified in conf.\u0027), hint_keyword)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_a6a12197","line":98,"updated":"2014-12-01 16:45:56.000000000","message":"Same here.","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":5538,"name":"Rushi Agrawal","email":"rushi.openstack@gmail.com","username":"rushiagr"},"change_message_id":"273a3ae28dead91943d5450663b0c03665dce683","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a890539_211d68bf","line":1,"updated":"2014-12-05 14:10:37.000000000","message":"can remove this line..","commit_id":"0481027a7ac5d8592dd84b9964dea902b67c626e"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"d3fca70b0d7aa68a16afe9dad2e4083261a29467","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a890539_a13878ef","line":1,"in_reply_to":"5a890539_211d68bf","updated":"2014-12-05 14:19:44.000000000","message":"Once more: (I must have written it a dozen times in previous patchsets) :-)\n\nThis header makes unicode files readable by the Python 2 interpreter (otherwise it fails). Here it is needed for the accent in my name.\n\nIt\u0027s a Python standard (PEP0263) [1] [2], and is present in dozens of files across Openstack (everywhere unicode chars are present).\n\n[1]: http://legacy.python.org/dev/peps/pep-0263/\n\n[2]: https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code","commit_id":"0481027a7ac5d8592dd84b9964dea902b67c626e"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"9e070e80637781307b7cba5de6e79c3fb6e4cc5e","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        self._cache \u003d {}"},{"line_number":55,"context_line":"        super(InstanceLocalityFilter, self).__init__()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def nova_has_extended_server_attributes(self, context):"},{"line_number":58,"context_line":"        \"\"\"Check Extended Server Attributes presence"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        Find out whether the Extended Server Attributes extension is activated"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_d5ea6373","line":57,"updated":"2014-12-31 08:54:06.000000000","message":"If it is supposed to be a private method only used in this class, would you mind to prefix it with a \u0027_\u0027?","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"ab373863d07ea029d5194039f5ddd0161779e0be","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        self._cache \u003d {}"},{"line_number":55,"context_line":"        super(InstanceLocalityFilter, self).__init__()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def nova_has_extended_server_attributes(self, context):"},{"line_number":58,"context_line":"        \"\"\"Check Extended Server Attributes presence"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        Find out whether the Extended Server Attributes extension is activated"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_82a24a98","line":57,"in_reply_to":"3a961159_d5ea6373","updated":"2015-01-03 15:43:41.000000000","message":"Sure!","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"d1d3ea9f9021a0790b878ef04ad320e9ee755441","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_LW(\u0027Hint \"%s\" dropped because \u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_937e2969","line":86,"updated":"2015-01-02 02:13:50.000000000","message":"Accela, that\u0027s a good question, thanks for bringing this up.  Once an instance is migrated, cache should be invalidated.  Problem is how can that be done?  Nova would send out notification when migrating instances, if Cinder can consume that notification and trigger cache invalidation, that\u0027ll be ideal.  But that creates a dependency between Cinder and Ceilometer, which some deployment might not have the latter.  Another not-so-ideal workaround is we have a timeout value for each cache entry, so that Cinder expires cache once it timesout.  This cannot solve migration problem 100%, but it helps a little bit.","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"9e070e80637781307b7cba5de6e79c3fb6e4cc5e","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_LW(\u0027Hint \"%s\" dropped because \u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_d5b8a377","line":86,"updated":"2014-12-31 08:54:06.000000000","message":"If instance is migrated, will be cache become invalid?","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"b448fec8e8cca51fd645849ed0803fac234534d9","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_LW(\u0027Hint \"%s\" dropped because \u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_45122959","line":86,"in_reply_to":"3a961159_4299426d","updated":"2015-01-07 15:54:37.000000000","message":"Thanks Zhiteng \u0026 Adrien. Adrien\u0027s reply sounds reasonable. What\u0027s your opinion, Zhiteng?","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"ab373863d07ea029d5194039f5ddd0161779e0be","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # First, lookup for already-known information in local cache"},{"line_number":85,"context_line":"        if instance_uuid in self._cache:"},{"line_number":86,"context_line":"            return self._cache[instance_uuid] \u003d\u003d host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":89,"context_line":"            LOG.warning(_LW(\u0027Hint \"%s\" dropped because \u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_4299426d","line":86,"in_reply_to":"3a961159_937e2969","updated":"2015-01-03 15:43:41.000000000","message":"Accela, this is an interesting point!\n\nThis cache lives only during the volume\u0027s scheduling: for every new volume creation request, it is re-created. So, the problem of invalid cache occurs only if the instance gets migrated at the moment the volume is scheduled. Volumes created after that won\u0027t be affected.\n\nIn my opinion, deployers providing directly attached storage hypervisors (with instance-locality hint enabled) SHOULD NOT allow instances migration on those hypervisors, simply because a volume already created with hint local_to_instance will not be automatically migrated if the instance is migrated in the future.\n\nAs Huang pointed out, apart from Ceilometer there is no clean way of getting notifications for migrations. I\u0027ve added a note in the commit message, that should definitely end up in the documentation when this is merged. Remarks and other ideas are most welcome!","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"d1d3ea9f9021a0790b878ef04ad320e9ee755441","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        self._cache[instance_uuid] \u003d getattr(server, INSTANCE_HOST_PROP)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        # Match if given instance is hosted on host"},{"line_number":110,"context_line":"        return self._cache[instance_uuid] \u003d\u003d host"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_b394058d","line":110,"updated":"2015-01-02 02:13:50.000000000","message":"Deployer has the knowledge of this kind of info (whether storage nodes are the same nodes as compute), and they can decide whether to enable this filter.  A deployment shouldn\u0027t enable this filter if storage nodes are not on the same nodes as compute.  So answer to your first question, yes, this filter would raise \u0027NoValidHost\u0027 exception, but in that case, user shouldn\u0027t enable this filter in the first place.  This is being written as pre-condition in commit message as \u0027in order to get this filter to work\u0027.","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"9e070e80637781307b7cba5de6e79c3fb6e4cc5e","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        self._cache[instance_uuid] \u003d getattr(server, INSTANCE_HOST_PROP)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        # Match if given instance is hosted on host"},{"line_number":110,"context_line":"        return self._cache[instance_uuid] \u003d\u003d host"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_35056714","line":110,"updated":"2014-12-31 08:54:06.000000000","message":"If a user deploys all storage nodes on different nodes with compute node, will this filter reject all hosts and results in scheduler failure? Does the user have to set scheduler hint HINT_KEYWORD?","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"b448fec8e8cca51fd645849ed0803fac234534d9","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        self._cache[instance_uuid] \u003d getattr(server, INSTANCE_HOST_PROP)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        # Match if given instance is hosted on host"},{"line_number":110,"context_line":"        return self._cache[instance_uuid] \u003d\u003d host"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_650d6535","line":110,"in_reply_to":"3a961159_827b2a28","updated":"2015-01-07 15:54:37.000000000","message":"Thank you, Zhiteng. That\u0027s a good answer :-)","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"ab373863d07ea029d5194039f5ddd0161779e0be","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        self._cache[instance_uuid] \u003d getattr(server, INSTANCE_HOST_PROP)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        # Match if given instance is hosted on host"},{"line_number":110,"context_line":"        return self._cache[instance_uuid] \u003d\u003d host"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_827b2a28","line":110,"in_reply_to":"3a961159_b394058d","updated":"2015-01-03 15:43:41.000000000","message":"I wouldn\u0027t have answered better :)","commit_id":"b1d3d4ac79ab6c261ec339a8a76065fe50ca1479"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"fd0712b7d8175990b6b014db4824c5dcc6829650","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_6900b066","line":1,"updated":"2015-01-06 12:46:18.000000000","message":"Is it really needed?","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"80661482101193d6265a7c3243c9e334304e73a9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_8954fc54","line":1,"in_reply_to":"3a961159_6900b066","updated":"2015-01-06 12:54:32.000000000","message":"Once more: (I must have written it a dozen times in previous patchsets) :-)\n\nThis header makes unicode files readable by the Python 2 interpreter (otherwise it fails). Here it is needed for the accent in my name.\n\nIt\u0027s a Python standard (PEP0263) [1] [2], and is present in dozens of files across Openstack (everywhere unicode chars are present).\n\n[1]: http://legacy.python.org/dev/peps/pep-0263/\n\n[2]: https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"fd0712b7d8175990b6b014db4824c5dcc6829650","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":5,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_c9d7e4ec","line":2,"updated":"2015-01-06 12:46:18.000000000","message":"2015","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"80661482101193d6265a7c3243c9e334304e73a9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- coding: utf-8 -*-"},{"line_number":2,"context_line":"# Copyright 2014, Adrien Vergé \u003cadrien.verge@numergy.com\u003e"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":5,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_c94a84ac","line":2,"in_reply_to":"3a961159_c9d7e4ec","updated":"2015-01-06 12:54:32.000000000","message":"This code was written in 2014.","commit_id":"cd351eb9a7270f58d942fc582bfb805e717d98f3"}],"cinder/scheduler/filters/instancelocality_filter.py":[{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"1696b4c9c1c1dc6e51f0100f2d5a1f6fe1389b96","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        # If not in cache, ask Nova"},{"line_number":45,"context_line":"        if key not in self._cache:"},{"line_number":46,"context_line":"            self._cache[key] \u003d bool(nova.novaclient(context).servers.list("},{"line_number":47,"context_line":"                                    False,"},{"line_number":48,"context_line":"                                    {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}))"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_720c623c","line":46,"updated":"2014-09-09 20:38:22.000000000","message":"Given the short life cycle of cache, caching a k/v pair (instance_uuid, host) : True/False isn\u0027t ideal.  It means Cinder will continue to query Nova for all host candidates.  I think we should cache instance_uuid: host instead and only query Nova if we don\u0027t know which host the instance resides on.  And here the filter only needs to compare the host_state.host to instance[\u0027host\u0027].","commit_id":"9d0bfe60ca1f550df2ba433b91b88aca3e17479f"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6183d82c5f1d2f540ee32b66c99ae07c08d3beb6","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        # If not in cache, ask Nova"},{"line_number":45,"context_line":"        if key not in self._cache:"},{"line_number":46,"context_line":"            self._cache[key] \u003d bool(nova.novaclient(context).servers.list("},{"line_number":47,"context_line":"                                    False,"},{"line_number":48,"context_line":"                                    {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}))"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_6bbdbdb0","line":46,"updated":"2014-09-15 14:51:10.000000000","message":"I guess you misunderstand what I said.  You only need to cache {\u0027inst-A\u0027: \u0027host-3\u0027} and that is it, which means you query which host does the instance sits on instead of a combination of {uuid: host}.  For every instance, we only need to query Nova for once.","commit_id":"9d0bfe60ca1f550df2ba433b91b88aca3e17479f"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"545b689f812b1ccf228dcec53ca0f86f4f33ab41","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        # If not in cache, ask Nova"},{"line_number":45,"context_line":"        if key not in self._cache:"},{"line_number":46,"context_line":"            self._cache[key] \u003d bool(nova.novaclient(context).servers.list("},{"line_number":47,"context_line":"                                    False,"},{"line_number":48,"context_line":"                                    {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}))"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_eb6e0dff","line":46,"in_reply_to":"fa98f980_6bbdbdb0","updated":"2014-09-15 14:58:04.000000000","message":"It\u0027s not possible to query \"what host is my instance on?\" So having a cache like {\u0027inst-A\u0027: \u0027host-3\u0027} requires many calls, because each failure is repeated (because not cached).\n\nThe workaround I use (which works with current Nova API) is: \"is there a host matching uuid\u003dX and host\u003dY?\"","commit_id":"9d0bfe60ca1f550df2ba433b91b88aca3e17479f"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"4d1eac9dba89cce2195507a6c164b134f8def460","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        # If not in cache, ask Nova"},{"line_number":45,"context_line":"        if key not in self._cache:"},{"line_number":46,"context_line":"            self._cache[key] \u003d bool(nova.novaclient(context).servers.list("},{"line_number":47,"context_line":"                                    False,"},{"line_number":48,"context_line":"                                    {\u0027uuid\u0027: instance_uuid, \u0027host\u0027: host}))"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_ba4bf557","line":46,"in_reply_to":"fa98f980_720c623c","updated":"2014-09-10 09:10:40.000000000","message":"The cache schema you propose is what I did at first. But counterintuitively, it does more requests to Nova when there are multiple Cinder back-ends. \n\nLet me explain: imagine 3 hosts with 5 back-ends each. If instance inst-A is running on machine host-3, host_passes(host-1@backend1) won\u0027t cache anything, neither host_passes(host-1@backend2) ... host_passes(host-1@backend5) ... host_passes(host-2@backend5); finally host_passes(host-3@backend1) will create a cache entry. So it will query Nova 10 times instead of 2 (in the current implementation).\n\nA better implementation (that would be ideal in both cases, with one back-end or multiple ones), would be a cache dict like {\u0027inst-A\u0027: {\u0027host-1\u0027: False, \u0027host-2\u0027: False, \u0027host-3\u0027: True}}.","commit_id":"9d0bfe60ca1f550df2ba433b91b88aca3e17479f"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # local_to_instance should be the UUID of an instance.  If the passed"},{"line_number":78,"context_line":"        # string doesn\u0027t look like an UUID, better not pass it to the DB query."},{"line_number":79,"context_line":"        if not uuidutils.is_uuid_like(instance_uuid):"},{"line_number":80,"context_line":"            LOG.error(_(\u0027Hint \"%s\" failure (unrecognized instance UUID)\u0027)"},{"line_number":81,"context_line":"                      % hint_keyword)"},{"line_number":82,"context_line":"            return False"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_7699efcf","line":80,"updated":"2014-09-17 06:15:45.000000000","message":"Put a stop in the end of the message.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1ff3b29d048be1ad6a488bb8f862f3ee120bd7c0","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # local_to_instance should be the UUID of an instance.  If the passed"},{"line_number":78,"context_line":"        # string doesn\u0027t look like an UUID, better not pass it to the DB query."},{"line_number":79,"context_line":"        if not uuidutils.is_uuid_like(instance_uuid):"},{"line_number":80,"context_line":"            LOG.error(_(\u0027Hint \"%s\" failure (unrecognized instance UUID)\u0027)"},{"line_number":81,"context_line":"                      % hint_keyword)"},{"line_number":82,"context_line":"            return False"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_ee80a3f9","line":80,"in_reply_to":"fa98f980_714bb95f","updated":"2014-09-17 08:15:26.000000000","message":"Done","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"01a99538e177b1abaf47d64455739d6d3a05969d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # local_to_instance should be the UUID of an instance.  If the passed"},{"line_number":78,"context_line":"        # string doesn\u0027t look like an UUID, better not pass it to the DB query."},{"line_number":79,"context_line":"        if not uuidutils.is_uuid_like(instance_uuid):"},{"line_number":80,"context_line":"            LOG.error(_(\u0027Hint \"%s\" failure (unrecognized instance UUID)\u0027)"},{"line_number":81,"context_line":"                      % hint_keyword)"},{"line_number":82,"context_line":"            return False"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_714bb95f","line":80,"in_reply_to":"fa98f980_7699efcf","updated":"2014-09-17 06:39:47.000000000","message":"Also please use a comma between the format string and the \u0027command\u0027 argument, like LOG.error(_(\u0027Hint \"%s\" failure (unrecognized instance UUID).\u0027), hint_keyword)\n\nIt applies to the following LOG messages.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1ff3b29d048be1ad6a488bb8f862f3ee120bd7c0","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # local_to_instance should be the UUID of an instance.  If the passed"},{"line_number":78,"context_line":"        # string doesn\u0027t look like an UUID, better not pass it to the DB query."},{"line_number":79,"context_line":"        if not uuidutils.is_uuid_like(instance_uuid):"},{"line_number":80,"context_line":"            LOG.error(_(\u0027Hint \"%s\" failure (unrecognized instance UUID)\u0027)"},{"line_number":81,"context_line":"                      % hint_keyword)"},{"line_number":82,"context_line":"            return False"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_ce8bdf1c","line":80,"in_reply_to":"fa98f980_7699efcf","updated":"2014-09-17 08:15:26.000000000","message":"Done","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        # Check Extended Server Attributes presence"},{"line_number":91,"context_line":"        if not self.nova_has_extended_server_attributes(context):"},{"line_number":92,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" not used (extended_server_attributes \u0027"},{"line_number":93,"context_line":"                          \u0027not active in Nova)\u0027) % hint_keyword)"},{"line_number":94,"context_line":"            return True"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        server \u003d nova.novaclient(context).servers.get(instance_uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_b6a357ff","line":93,"updated":"2014-09-17 06:15:45.000000000","message":"Put a stop in the end of the message.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        server \u003d nova.novaclient(context).servers.get(instance_uuid)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        # Check if Nova gave the required information"},{"line_number":99,"context_line":"        if not hasattr(server, \u0027OS-EXT-SRV-ATTR:hypervisor_hostname\u0027):"},{"line_number":100,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" not used (insufficient rights for \u0027"},{"line_number":101,"context_line":"                          \u0027current context; you may consider changing \u0027"},{"line_number":102,"context_line":"                          \u0027extended_server_attributes in Nova policy)\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_565dcb14","line":99,"updated":"2014-09-17 06:15:45.000000000","message":"Suggest to not hardcode \"OS-EXT-SRV-ATTR:hypervisor_hostname\".","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1ff3b29d048be1ad6a488bb8f862f3ee120bd7c0","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        server \u003d nova.novaclient(context).servers.get(instance_uuid)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        # Check if Nova gave the required information"},{"line_number":99,"context_line":"        if not hasattr(server, \u0027OS-EXT-SRV-ATTR:hypervisor_hostname\u0027):"},{"line_number":100,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" not used (insufficient rights for \u0027"},{"line_number":101,"context_line":"                          \u0027current context; you may consider changing \u0027"},{"line_number":102,"context_line":"                          \u0027extended_server_attributes in Nova policy)\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_4e77ef3b","line":99,"in_reply_to":"fa98f980_565dcb14","updated":"2014-09-17 08:15:26.000000000","message":"Right. Done.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if not hasattr(server, \u0027OS-EXT-SRV-ATTR:hypervisor_hostname\u0027):"},{"line_number":100,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" not used (insufficient rights for \u0027"},{"line_number":101,"context_line":"                          \u0027current context; you may consider changing \u0027"},{"line_number":102,"context_line":"                          \u0027extended_server_attributes in Nova policy)\u0027)"},{"line_number":103,"context_line":"                        % hint_keyword)"},{"line_number":104,"context_line":"            return True"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_969e53b7","line":102,"updated":"2014-09-17 06:15:45.000000000","message":"Put a stop in the end of the message.","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"c7e5c4c1db6169c646ef4453302b98e5293c69f3","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            return True"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        self._cache[instance_uuid] \u003d \\"},{"line_number":107,"context_line":"            getattr(server, \u0027OS-EXT-SRV-ATTR:hypervisor_hostname\u0027)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        # Match if given instance is hosted on host"},{"line_number":110,"context_line":"        return self._cache[instance_uuid] \u003d\u003d host"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa98f980_9677339f","line":107,"updated":"2014-09-17 06:15:45.000000000","message":"Suggest to not hardcode \"OS-EXT-SRV-ATTR:hypervisor_hostname\".","commit_id":"e9fd5090eca84a8734c55871c5ca3e98a3fb4427"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"7d405f70575114a35db4d36797bd5841551edf1f","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        if not hasattr(server, instance_host_prop):"},{"line_number":106,"context_line":"            LOG.warning(_(\u0027Hint \"%s\" not used (insufficient rights for \u0027"},{"line_number":107,"context_line":"                          \u0027current context; you may consider changing \u0027"},{"line_number":108,"context_line":"                          \u0027extended_server_attributes in Nova policy).\u0027),"},{"line_number":109,"context_line":"                        hint_keyword)"},{"line_number":110,"context_line":"            return True"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_51441474","line":108,"updated":"2014-09-19 21:21:21.000000000","message":"As discussed in IRC, asking for deployer to change policy for extended_server_attributes really isn\u0027t a good/practical idea.  We\u0027d instead configure cinder to use a user with admin role to do the query.","commit_id":"fcfdc9558649f65c08fc7a723b378c5dd7f4997f"}],"cinder/tests/scheduler/test_host_filters.py":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"6d9a07da94419be617d7df5f239846def59e35e4","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        self.assertFalse(filt_cls.host_passes(host, filter_properties))"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"class InstanceLocalityFilterTestCase(HostFiltersTestCase):"},{"line_number":333,"context_line":"    def setUp(self):"},{"line_number":334,"context_line":"        super(InstanceLocalityFilterTestCase, self).setUp()"},{"line_number":335,"context_line":"        self.override_config(\u0027nova_endpoint_template\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_865c257f","line":332,"updated":"2014-12-01 16:45:56.000000000","message":"Do we need to add test cases for attribute not available cases?","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"},{"author":{"_account_id":12561,"name":"Adrien Vergé","email":"adrienverge@gmail.com","username":"adrien.verge"},"change_message_id":"1c42582c0442dae373dfe1219b840b8c49a30f74","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        self.assertFalse(filt_cls.host_passes(host, filter_properties))"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"class InstanceLocalityFilterTestCase(HostFiltersTestCase):"},{"line_number":333,"context_line":"    def setUp(self):"},{"line_number":334,"context_line":"        super(InstanceLocalityFilterTestCase, self).setUp()"},{"line_number":335,"context_line":"        self.override_config(\u0027nova_endpoint_template\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a890539_4c86dbdc","line":332,"in_reply_to":"5a890539_865c257f","updated":"2014-12-01 18:08:52.000000000","message":"This can be done.","commit_id":"5adf9facce99e5ba2a65329c2f348df42ef705c6"}]}
