)]}'
{"setup.cfg":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    basic \u003d watcher.decision_engine.strategy.strategies.basic_consolidation:BasicConsolidation"},{"line_number":51,"context_line":"    outlet_temp_control \u003d watcher.decision_engine.strategy.strategies.outlet_temp_control:OutletTempControl"},{"line_number":52,"context_line":"    workload_balance \u003d watcher.decision_engine.strategy.strategies.workload_balance:WorkloadBalance"},{"line_number":53,"context_line":"watcher_actions \u003d"},{"line_number":54,"context_line":"    migrate \u003d watcher.applier.actions.migration:Migrate"},{"line_number":55,"context_line":"    nop \u003d watcher.applier.actions.nop:Nop"},{"line_number":56,"context_line":"    sleep \u003d watcher.applier.actions.sleep:Sleep"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"1af94dfe_10a56db4","line":53,"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you add a newline here please?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    basic \u003d watcher.decision_engine.strategy.strategies.basic_consolidation:BasicConsolidation"},{"line_number":51,"context_line":"    outlet_temp_control \u003d watcher.decision_engine.strategy.strategies.outlet_temp_control:OutletTempControl"},{"line_number":52,"context_line":"    workload_balance \u003d watcher.decision_engine.strategy.strategies.workload_balance:WorkloadBalance"},{"line_number":53,"context_line":"watcher_actions \u003d"},{"line_number":54,"context_line":"    migrate \u003d watcher.applier.actions.migration:Migrate"},{"line_number":55,"context_line":"    nop \u003d watcher.applier.actions.nop:Nop"},{"line_number":56,"context_line":"    sleep \u003d watcher.applier.actions.sleep:Sleep"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"fa0719c6_c199b121","line":53,"in_reply_to":"1af94dfe_10a56db4","updated":"2016-03-21 01:47:38.000000000","message":"sure","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"}],"watcher/decision_engine/strategy/strategies/workload_balance.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from watcher._i18n import _LE"},{"line_number":22,"context_line":"from watcher.common import exception as wexc"},{"line_number":23,"context_line":"from watcher.decision_engine.model.resource import ResourceType"},{"line_number":24,"context_line":"from watcher.decision_engine.model.vm_state import VMState"},{"line_number":25,"context_line":"from watcher.decision_engine.strategy.strategies.base import BaseStrategy"},{"line_number":26,"context_line":"from watcher.metrics_engine.cluster_history import ceilometer  \\"},{"line_number":27,"context_line":"    as ceil"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_f0a0c1a1","line":25,"range":{"start_line":23,"start_character":0,"end_line":25,"end_character":73},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you import the module instead of the class itself?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from watcher._i18n import _LE"},{"line_number":22,"context_line":"from watcher.common import exception as wexc"},{"line_number":23,"context_line":"from watcher.decision_engine.model.resource import ResourceType"},{"line_number":24,"context_line":"from watcher.decision_engine.model.vm_state import VMState"},{"line_number":25,"context_line":"from watcher.decision_engine.strategy.strategies.base import BaseStrategy"},{"line_number":26,"context_line":"from watcher.metrics_engine.cluster_history import ceilometer  \\"},{"line_number":27,"context_line":"    as ceil"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_c11c117a","line":25,"range":{"start_line":23,"start_character":0,"end_line":25,"end_character":73},"in_reply_to":"1af94dfe_f0a0c1a1","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":32,"context_line":"class WorkloadBalance(BaseStrategy):"},{"line_number":33,"context_line":"    \"\"\"[PoC]Workload balance using live migration"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    *Description*"},{"line_number":36,"context_line":"        It is a migration strategy based on the VM workload of physical"},{"line_number":37,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":38,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_0e2a642c","line":36,"range":{"start_line":35,"start_character":17,"end_line":36,"end_character":8},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you add a new blank line here please?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":32,"context_line":"class WorkloadBalance(BaseStrategy):"},{"line_number":33,"context_line":"    \"\"\"[PoC]Workload balance using live migration"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    *Description*"},{"line_number":36,"context_line":"        It is a migration strategy based on the VM workload of physical"},{"line_number":37,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":38,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_21122d63","line":36,"range":{"start_line":35,"start_character":17,"end_line":36,"end_character":8},"in_reply_to":"1af94dfe_0e2a642c","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":38,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    *Requirements*"},{"line_number":41,"context_line":"        * Hardware: computer node should use the same physical CPUs"},{"line_number":42,"context_line":"        * Software: Ceilometer component ceilometer-agent-compute running"},{"line_number":43,"context_line":"          in each compute node, and Ceilometer API can report such telemetry"},{"line_number":44,"context_line":"          \"cpu_util\" successfully."}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_4e1c6c13","line":41,"range":{"start_line":40,"start_character":18,"end_line":41,"end_character":8},"updated":"2016-03-18 10:51:29.000000000","message":"ditto","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":38,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    *Requirements*"},{"line_number":41,"context_line":"        * Hardware: computer node should use the same physical CPUs"},{"line_number":42,"context_line":"        * Software: Ceilometer component ceilometer-agent-compute running"},{"line_number":43,"context_line":"          in each compute node, and Ceilometer API can report such telemetry"},{"line_number":44,"context_line":"          \"cpu_util\" successfully."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_01172952","line":41,"range":{"start_line":40,"start_character":18,"end_line":41,"end_character":8},"in_reply_to":"1af94dfe_4e1c6c13","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":51,"context_line":"         reason why we only plan a single virtual machine migration at a time."},{"line_number":52,"context_line":"         So it\u0027s better to use this algorithm with `CONTINUOUS` audits."},{"line_number":53,"context_line":"       - It assume that live migrations are possible"},{"line_number":54,"context_line":"        :param name: the name of the strategy"},{"line_number":55,"context_line":"        :param description: a description of the strategy"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_90c69d47","line":55,"range":{"start_line":54,"start_character":8,"end_line":55,"end_character":57},"updated":"2016-03-18 10:51:29.000000000","message":"This bit is used to generate the HTML doc, so I would move the params into the __init__() docstring so it doesn\u0027t get included.","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":51,"context_line":"         reason why we only plan a single virtual machine migration at a time."},{"line_number":52,"context_line":"         So it\u0027s better to use this algorithm with `CONTINUOUS` audits."},{"line_number":53,"context_line":"       - It assume that live migrations are possible"},{"line_number":54,"context_line":"        :param name: the name of the strategy"},{"line_number":55,"context_line":"        :param description: a description of the strategy"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_41092131","line":55,"range":{"start_line":54,"start_character":8,"end_line":55,"end_character":57},"in_reply_to":"1af94dfe_90c69d47","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        vcpus_used \u003d 0"},{"line_number":95,"context_line":"        memory_mb_used \u003d 0"},{"line_number":96,"context_line":"        disk_gb_used \u003d 0"},{"line_number":97,"context_line":"        if len(vms) \u003e 0:"},{"line_number":98,"context_line":"            for vm_id in vms:"},{"line_number":99,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":100,"context_line":"                vcpus_used +\u003d cap_cores.get_capacity(vm)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_ae825092","line":97,"range":{"start_line":97,"start_character":0,"end_line":97,"end_character":24},"updated":"2016-03-18 10:51:29.000000000","message":"if len(vms) \u003d\u003d 0, then the for loop that follows will not be able to iterate anyway, so I would assume that this statement is useless here.","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        vcpus_used \u003d 0"},{"line_number":95,"context_line":"        memory_mb_used \u003d 0"},{"line_number":96,"context_line":"        disk_gb_used \u003d 0"},{"line_number":97,"context_line":"        if len(vms) \u003e 0:"},{"line_number":98,"context_line":"            for vm_id in vms:"},{"line_number":99,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":100,"context_line":"                vcpus_used +\u003d cap_cores.get_capacity(vm)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_8103390f","line":97,"range":{"start_line":97,"start_character":0,"end_line":97,"end_character":24},"in_reply_to":"1af94dfe_ae825092","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":107,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        for hvmap in hosts:"},{"line_number":110,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":111,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_312181a0","line":108,"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you remove this blank line please?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":107,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        for hvmap in hosts:"},{"line_number":110,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":111,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_841a276d","line":108,"in_reply_to":"1af94dfe_312181a0","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                        # select the first active VM to migrate"},{"line_number":119,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":120,"context_line":"                        if vm.state !\u003d VMState.ACTIVE.value:"},{"line_number":121,"context_line":"                            LOG.info(_LE(\"VM not active, skipped: %s\"),"},{"line_number":122,"context_line":"                                     vm.uuid)"},{"line_number":123,"context_line":"                            continue"},{"line_number":124,"context_line":"                        tmp \u003d delta_workload - workload_map[vm_id]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_117285ad","line":121,"range":{"start_line":121,"start_character":37,"end_line":121,"end_character":40},"updated":"2016-03-18 10:51:29.000000000","message":"s/_LE/_LI","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                        # select the first active VM to migrate"},{"line_number":119,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":120,"context_line":"                        if vm.state !\u003d VMState.ACTIVE.value:"},{"line_number":121,"context_line":"                            LOG.info(_LE(\"VM not active, skipped: %s\"),"},{"line_number":122,"context_line":"                                     vm.uuid)"},{"line_number":123,"context_line":"                            continue"},{"line_number":124,"context_line":"                        tmp \u003d delta_workload - workload_map[vm_id]"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_84b6a73b","line":121,"range":{"start_line":121,"start_character":37,"end_line":121,"end_character":40},"in_reply_to":"1af94dfe_117285ad","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                            min_delta \u003d tmp"},{"line_number":127,"context_line":"                            instance_id \u003d vm_id"},{"line_number":128,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":129,"context_line":"                        LOG.info(\"VM not found Error: %s\" % e.message)"},{"line_number":130,"context_line":"                        pass"},{"line_number":131,"context_line":"                for vm_id in vms_of_src:"},{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_b05f5940","line":129,"range":{"start_line":129,"start_character":33,"end_line":129,"end_character":69},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you wrap this with _LI() for i18n please?\nAlso, the string interpolation should be done as explained in http://docs.openstack.org/developer/hacking/#internationalization-i18n-strings","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                            min_delta \u003d tmp"},{"line_number":127,"context_line":"                            instance_id \u003d vm_id"},{"line_number":128,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":129,"context_line":"                        LOG.info(\"VM not found Error: %s\" % e.message)"},{"line_number":130,"context_line":"                        pass"},{"line_number":131,"context_line":"                for vm_id in vms_of_src:"},{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_a44beb58","line":129,"range":{"start_line":129,"start_character":33,"end_line":129,"end_character":69},"in_reply_to":"1af94dfe_b05f5940","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                            instance_id \u003d vm_id"},{"line_number":128,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":129,"context_line":"                        LOG.info(\"VM not found Error: %s\" % e.message)"},{"line_number":130,"context_line":"                        pass"},{"line_number":131,"context_line":"                for vm_id in vms_of_src:"},{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":133,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_31422111","line":130,"range":{"start_line":130,"start_character":24,"end_line":130,"end_character":28},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you remove this?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                            instance_id \u003d vm_id"},{"line_number":128,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":129,"context_line":"                        LOG.info(\"VM not found Error: %s\" % e.message)"},{"line_number":130,"context_line":"                        pass"},{"line_number":131,"context_line":"                for vm_id in vms_of_src:"},{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":133,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_c4789f92","line":130,"range":{"start_line":130,"start_character":24,"end_line":130,"end_character":28},"in_reply_to":"1af94dfe_31422111","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":133,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        return None"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def filter_dest_servers(self, model, hosts, vm_to_migrate,"},{"line_number":138,"context_line":"                            avg_workload, workload_map):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_f10559c2","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":19},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you remove this?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":133,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        return None"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def filter_dest_servers(self, model, hosts, vm_to_migrate,"},{"line_number":138,"context_line":"                            avg_workload, workload_map):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_845fc70d","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":19},"in_reply_to":"1af94dfe_f10559c2","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":174,"context_line":"        hypervisors \u003d model.get_all_hypervisors()"},{"line_number":175,"context_line":"        size_cluster \u003d len(hypervisors)"},{"line_number":176,"context_line":"        if size_cluster \u003d\u003d 0:"},{"line_number":177,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":178,"context_line":"        # get cpu cores capacity of hypervisors and vms"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_7196694d","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":20},"updated":"2016-03-18 10:51:29.000000000","message":"s/size_cluster/cluster_size","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":174,"context_line":"        hypervisors \u003d model.get_all_hypervisors()"},{"line_number":175,"context_line":"        size_cluster \u003d len(hypervisors)"},{"line_number":176,"context_line":"        if size_cluster \u003d\u003d 0:"},{"line_number":177,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":178,"context_line":"        # get cpu cores capacity of hypervisors and vms"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_e481634f","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":20},"in_reply_to":"1af94dfe_7196694d","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                for vm_id in vms:"},{"line_number":192,"context_line":"                    vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":193,"context_line":"                    if vm.state !\u003d VMState.ACTIVE.value:"},{"line_number":194,"context_line":"                            LOG.info(_LE(\"VM not active, skipped: %s\"),"},{"line_number":195,"context_line":"                                     vm.uuid)"},{"line_number":196,"context_line":"                            continue"},{"line_number":197,"context_line":"                    cpu_util \u003d self.ceilometer.statistic_aggregation("}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_31b501ee","line":194,"range":{"start_line":194,"start_character":37,"end_line":194,"end_character":40},"updated":"2016-03-18 10:51:29.000000000","message":"s/_LE/_LI","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                        continue"},{"line_number":206,"context_line":"                    workload_map[vm_id] \u003d cpu_util * vm_cores / 100"},{"line_number":207,"context_line":"                    workload_of_hypervisor +\u003d workload_map[vm_id]"},{"line_number":208,"context_line":"                    LOG.debug(\"%s: cpu_util %f\" % (vm_id, cpu_util))"},{"line_number":209,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":210,"context_line":"            hy_cpu_util \u003d workload_of_hypervisor / hypervisor_cores * 100"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_b1c5913d","line":208,"range":{"start_line":208,"start_character":20,"end_line":208,"end_character":68},"updated":"2016-03-18 10:51:29.000000000","message":"LOG.debug(\"%s: cpu_util %f\", vm_id, cpu_util)","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                        continue"},{"line_number":206,"context_line":"                    workload_map[vm_id] \u003d cpu_util * vm_cores / 100"},{"line_number":207,"context_line":"                    workload_of_hypervisor +\u003d workload_map[vm_id]"},{"line_number":208,"context_line":"                    LOG.debug(\"%s: cpu_util %f\" % (vm_id, cpu_util))"},{"line_number":209,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":210,"context_line":"            hy_cpu_util \u003d workload_of_hypervisor / hypervisor_cores * 100"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_0481f74a","line":208,"range":{"start_line":208,"start_character":20,"end_line":208,"end_character":68},"in_reply_to":"1af94dfe_b1c5913d","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        return hosts_need_release, hosts_target, avg_workload, workload_map"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def execute(self, orign_model):"},{"line_number":227,"context_line":"        LOG.debug(\"Initializing Workload Balance Strategy\")"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        if orign_model is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_51f40d86","line":226,"range":{"start_line":226,"start_character":22,"end_line":226,"end_character":33},"updated":"2016-03-18 10:51:29.000000000","message":"s/orign_model/origin_model","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        return hosts_need_release, hosts_target, avg_workload, workload_map"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def execute(self, orign_model):"},{"line_number":227,"context_line":"        LOG.debug(\"Initializing Workload Balance Strategy\")"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        if orign_model is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_6496f395","line":226,"range":{"start_line":226,"start_character":22,"end_line":226,"end_character":33},"in_reply_to":"1af94dfe_51f40d86","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            return self.solution"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        if len(hosts_target) \u003d\u003d 0:"},{"line_number":241,"context_line":"            LOG.warning(_LE(\"No hosts under cpu_util threshold found\"))"},{"line_number":242,"context_line":"            return self.solution"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # choose the server with largest cpu_util"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_310d0191","line":241,"range":{"start_line":241,"start_character":24,"end_line":241,"end_character":27},"updated":"2016-03-18 10:51:29.000000000","message":"s/_LE/_LW","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        # choose the server with largest cpu_util"},{"line_number":245,"context_line":"        hosts_need_release \u003d sorted(hosts_need_release,"},{"line_number":246,"context_line":"                                    reverse\u003dTrue,"},{"line_number":247,"context_line":"                                    key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        vm_to_migrate \u003d self.choose_vm_to_migrate(current_model,"},{"line_number":250,"context_line":"                                                  hosts_need_release,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_5169ad24","line":247,"range":{"start_line":247,"start_character":54,"end_line":247,"end_character":62},"updated":"2016-03-18 10:51:29.000000000","message":"can you create a constant for this ceilometer metric (which would then have a better name)?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f99ab8a7f6fc3f1fdef986bc499b4cf35680d5a3","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        # choose the server with largest cpu_util"},{"line_number":245,"context_line":"        hosts_need_release \u003d sorted(hosts_need_release,"},{"line_number":246,"context_line":"                                    reverse\u003dTrue,"},{"line_number":247,"context_line":"                                    key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        vm_to_migrate \u003d self.choose_vm_to_migrate(current_model,"},{"line_number":250,"context_line":"                                                  hosts_need_release,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_24f35b0c","line":247,"range":{"start_line":247,"start_character":54,"end_line":247,"end_character":62},"in_reply_to":"1af94dfe_5169ad24","updated":"2016-03-21 01:47:38.000000000","message":"Done","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        if len(dest_servers) \u003d\u003d 0:"},{"line_number":264,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":265,"context_line":"            # for instance."},{"line_number":266,"context_line":"            LOG.info(_LE(\"No proper target host could be found\"))"},{"line_number":267,"context_line":"            return self.solution"},{"line_number":268,"context_line":"        dest_servers \u003d sorted(dest_servers, reverse\u003dTrue,"},{"line_number":269,"context_line":"                              key\u003dlambda x: (x[\"cpu_util\"]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_b14f51bc","line":266,"range":{"start_line":266,"start_character":21,"end_line":266,"end_character":24},"updated":"2016-03-18 10:51:29.000000000","message":"s/_LE/_LI","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"0932ea58c60aa747ed3099afb5ea36cc5cf6a73b","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                            min_delta \u003d tmp"},{"line_number":132,"context_line":"                            instance_id \u003d vm_id"},{"line_number":133,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":134,"context_line":"                        LOG.info(\"VM not found Error: %s\" % e.message)"},{"line_number":135,"context_line":"                for vm_id in vms_of_src:"},{"line_number":136,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":137,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa0719c6_2d6ac5b3","line":134,"range":{"start_line":134,"start_character":24,"end_line":134,"end_character":70},"updated":"2016-03-22 16:12:04.000000000","message":"You forgot the _LI here","commit_id":"fa7a8694cb3b6ddf176447a6a5ff2dab922c2d62"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    *Description*"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        It is a migration strategy based on the VM workload of physical"},{"line_number":39,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":40,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    *Requirements*"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd468d4e","line":39,"updated":"2016-03-23 06:48:50.000000000","message":"Can you briefly explain in the comment how it is determined which VMs to migrate and to which host?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    *Description*"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        It is a migration strategy based on the VM workload of physical"},{"line_number":39,"context_line":"        servers. It generates solutions to move a workload whenever a server\u0027s"},{"line_number":40,"context_line":"        CPU utilization % is higher than the specified threshold."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    *Requirements*"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_b33c5ac9","line":39,"in_reply_to":"fa0719c6_cd468d4e","updated":"2016-03-23 09:12:13.000000000","message":"sure, will do","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    *Requirements*"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        * Hardware: computer node should use the same physical CPUs"},{"line_number":45,"context_line":"        * Software: Ceilometer component ceilometer-agent-compute running"},{"line_number":46,"context_line":"          in each compute node, and Ceilometer API can report such telemetry"},{"line_number":47,"context_line":"          \"cpu_util\" successfully."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_4d71dda7","line":44,"updated":"2016-03-23 06:48:50.000000000","message":"s/computer/compute\n\nDoes this mean that each compute node in your cluster has to have the same number of physical CPUs? That seems unlikely.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    *Requirements*"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        * Hardware: computer node should use the same physical CPUs"},{"line_number":45,"context_line":"        * Software: Ceilometer component ceilometer-agent-compute running"},{"line_number":46,"context_line":"          in each compute node, and Ceilometer API can report such telemetry"},{"line_number":47,"context_line":"          \"cpu_util\" successfully."}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_3065e01d","line":44,"in_reply_to":"fa0719c6_4d71dda7","updated":"2016-03-23 09:12:13.000000000","message":"Yes, just make it easy to normalize the CPU workload.\nCurrently, it\u0027s POC purpose only. Need to find a better way in future.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    # The meter to report CPU utilization % of VM in ceilometer"},{"line_number":63,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":64,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":65,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":66,"context_line":"    # choose 300 seconds as the default duration"},{"line_number":67,"context_line":"    PERIOD \u003d 300"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_8d6775e8","line":65,"updated":"2016-03-23 06:48:50.000000000","message":"This needs to be configurable.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    # The meter to report CPU utilization % of VM in ceilometer"},{"line_number":63,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":64,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":65,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":66,"context_line":"    # choose 300 seconds as the default duration"},{"line_number":67,"context_line":"    PERIOD \u003d 300"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_93403636","line":65,"in_reply_to":"fa0719c6_8d6775e8","updated":"2016-03-23 09:12:13.000000000","message":"Yes, wait for https://blueprints.launchpad.net/watcher/+spec/optimization-threshold","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":64,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":65,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":66,"context_line":"    # choose 300 seconds as the default duration"},{"line_number":67,"context_line":"    PERIOD \u003d 300"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    MIGRATION \u003d \"migrate\""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0da245fd","line":66,"updated":"2016-03-23 06:48:50.000000000","message":"Duration / period of what? It isn\u0027t immediately clear from the comment / variable name.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":64,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":65,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":66,"context_line":"    # choose 300 seconds as the default duration"},{"line_number":67,"context_line":"    PERIOD \u003d 300"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    MIGRATION \u003d \"migrate\""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_b3b1fa49","line":66,"in_reply_to":"fa0719c6_0da245fd","updated":"2016-03-23 09:12:13.000000000","message":"will add more comments","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def ceilometer(self, c):"},{"line_number":96,"context_line":"        self._ceilometer \u003d c"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":99,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":100,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":101,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_adc6b997","line":98,"range":{"start_line":98,"start_character":47,"end_line":98,"end_character":75},"updated":"2016-03-23 06:48:50.000000000","message":"Not a huge fan of these names but I can\u0027t think of anything much better.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def ceilometer(self, c):"},{"line_number":96,"context_line":"        self._ceilometer \u003d c"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":99,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":100,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":101,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_4d7f1d66","line":98,"range":{"start_line":98,"start_character":18,"end_line":98,"end_character":21},"updated":"2016-03-23 06:48:50.000000000","message":"resources","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def ceilometer(self, c):"},{"line_number":96,"context_line":"        self._ceilometer \u003d c"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":99,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":100,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":101,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_5344de19","line":98,"range":{"start_line":98,"start_character":47,"end_line":98,"end_character":75},"in_reply_to":"fa0719c6_adc6b997","updated":"2016-03-23 09:12:13.000000000","message":"understood, just want to make it short","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        vcpus_used \u003d 0"},{"line_number":102,"context_line":"        memory_mb_used \u003d 0"},{"line_number":103,"context_line":"        disk_gb_used \u003d 0"},{"line_number":104,"context_line":"        for vm_id in vms:"},{"line_number":105,"context_line":"            vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":106,"context_line":"            vcpus_used +\u003d cap_cores.get_capacity(vm)"},{"line_number":107,"context_line":"            memory_mb_used +\u003d cap_mem.get_capacity(vm)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cdb96d17","line":104,"updated":"2016-03-23 06:48:50.000000000","message":"Ugh, I wish we could let the nova scheduler figure this stuff out for us instead of having to recompute it. But alas, we can\u0027t currently.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        vcpus_used \u003d 0"},{"line_number":102,"context_line":"        memory_mb_used \u003d 0"},{"line_number":103,"context_line":"        disk_gb_used \u003d 0"},{"line_number":104,"context_line":"        for vm_id in vms:"},{"line_number":105,"context_line":"            vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":106,"context_line":"            vcpus_used +\u003d cap_cores.get_capacity(vm)"},{"line_number":107,"context_line":"            memory_mb_used +\u003d cap_mem.get_capacity(vm)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_f3e53238","line":104,"in_reply_to":"fa0719c6_cdb96d17","updated":"2016-03-23 09:12:13.000000000","message":"agree, i have put it in the spec.\nwait for : https://blueprints.launchpad.net/watcher/+spec/select-destinations-filter","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        return vcpus_used, memory_mb_used, disk_gb_used"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd532d38","line":112,"range":{"start_line":112,"start_character":8,"end_line":112,"end_character":28},"updated":"2016-03-23 06:48:50.000000000","message":"Needs better docstring for what\u0027s going on here and the parameters.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        return vcpus_used, memory_mb_used, disk_gb_used"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_931f9607","line":112,"range":{"start_line":112,"start_character":8,"end_line":112,"end_character":28},"in_reply_to":"fa0719c6_cd532d38","updated":"2016-03-23 09:12:13.000000000","message":"Sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d3ec58b","line":114,"range":{"start_line":114,"start_character":12,"end_line":114,"end_character":17},"updated":"2016-03-23 06:48:50.000000000","message":"host or hypervisor","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_33a32ab4","line":114,"range":{"start_line":114,"start_character":12,"end_line":114,"end_character":17},"in_reply_to":"fa0719c6_0d3ec58b","updated":"2016-03-23 09:12:13.000000000","message":"hvmap is a dict contains hypervisor object","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d6525b4","line":115,"range":{"start_line":115,"start_character":12,"end_line":115,"end_character":30},"updated":"2016-03-23 06:48:50.000000000","message":"source_hypervisor is sufficient IMO - it implies migration.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_map):"},{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_93c9565c","line":115,"range":{"start_line":115,"start_character":12,"end_line":115,"end_character":30},"in_reply_to":"fa0719c6_0d6525b4","updated":"2016-03-23 09:12:13.000000000","message":"agree","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_ad74f967","line":116,"range":{"start_line":116,"start_character":12,"end_line":116,"end_character":22},"updated":"2016-03-23 06:48:50.000000000","message":"source_vms","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        \u0027\u0027\u0027pick up an active vm instance to migrate from provided hosts\u0027\u0027\u0027"},{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_f37532fa","line":116,"range":{"start_line":116,"start_character":12,"end_line":116,"end_character":22},"in_reply_to":"fa0719c6_ad74f967","updated":"2016-03-23 09:12:13.000000000","message":"Done","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"},{"line_number":120,"context_line":"                instance_id \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_ed6a7180","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":35},"updated":"2016-03-23 06:48:50.000000000","message":"if source_vms:\n\nand there should be an else block with a debug / info statement explaining why no VM was chosen.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        for hvmap in hosts:"},{"line_number":115,"context_line":"            mig_src_hypervisor \u003d hvmap[\u0027hv\u0027]"},{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"},{"line_number":120,"context_line":"                instance_id \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_7358028b","line":117,"range":{"start_line":117,"start_character":12,"end_line":117,"end_character":35},"in_reply_to":"fa0719c6_ed6a7180","updated":"2016-03-23 09:12:13.000000000","message":"make sense","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"},{"line_number":120,"context_line":"                instance_id \u003d None"},{"line_number":121,"context_line":"                for vm_id in vms_of_src:"},{"line_number":122,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d0c05ec","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":32},"updated":"2016-03-23 06:48:50.000000000","message":"Where is this constant coming from?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            vms_of_src \u003d model.get_mapping().get_node_vms(mig_src_hypervisor)"},{"line_number":117,"context_line":"            if len(vms_of_src) \u003e 0:"},{"line_number":118,"context_line":"                delta_workload \u003d hvmap[\u0027workload\u0027] - avg_workload"},{"line_number":119,"context_line":"                min_delta \u003d 1000"},{"line_number":120,"context_line":"                instance_id \u003d None"},{"line_number":121,"context_line":"                for vm_id in vms_of_src:"},{"line_number":122,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_9301563b","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":32},"in_reply_to":"fa0719c6_0d0c05ec","updated":"2016-03-23 09:12:13.000000000","message":"it just uses a initial number which is large enough for comparing.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    try:"},{"line_number":123,"context_line":"                        # select the first active VM to migrate"},{"line_number":124,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":125,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":126,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":127,"context_line":"                                     vm.uuid)"},{"line_number":128,"context_line":"                            continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_8d2495c5","line":125,"updated":"2016-03-23 06:48:50.000000000","message":"Ugh, again, there\u0027s a bunch of other stuff that would need to be checked here which would preferably be done by the nova scheduler running through the filters, but alas, we can\u0027t do that currently.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    try:"},{"line_number":123,"context_line":"                        # select the first active VM to migrate"},{"line_number":124,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":125,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":126,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":127,"context_line":"                                     vm.uuid)"},{"line_number":128,"context_line":"                            continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_3397aaed","line":125,"in_reply_to":"fa0719c6_8d2495c5","updated":"2016-03-23 09:12:13.000000000","message":"agree","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":127,"context_line":"                                     vm.uuid)"},{"line_number":128,"context_line":"                            continue"},{"line_number":129,"context_line":"                        tmp \u003d delta_workload - workload_map[vm_id]"},{"line_number":130,"context_line":"                        if tmp \u003e\u003d 0 and tmp \u003c min_delta:"},{"line_number":131,"context_line":"                            min_delta \u003d tmp"},{"line_number":132,"context_line":"                            instance_id \u003d vm_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_70075818","line":129,"range":{"start_line":129,"start_character":24,"end_line":129,"end_character":27},"updated":"2016-03-23 06:48:50.000000000","message":"Better variable name is needed.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":127,"context_line":"                                     vm.uuid)"},{"line_number":128,"context_line":"                            continue"},{"line_number":129,"context_line":"                        tmp \u003d delta_workload - workload_map[vm_id]"},{"line_number":130,"context_line":"                        if tmp \u003e\u003d 0 and tmp \u003c min_delta:"},{"line_number":131,"context_line":"                            min_delta \u003d tmp"},{"line_number":132,"context_line":"                            instance_id \u003d vm_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_93af9629","line":129,"range":{"start_line":129,"start_character":24,"end_line":129,"end_character":27},"in_reply_to":"fa0719c6_70075818","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                            min_delta \u003d tmp"},{"line_number":132,"context_line":"                            instance_id \u003d vm_id"},{"line_number":133,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":134,"context_line":"                        LOG.info(_LI(\"VM not found Error: %s\"), e.message)"},{"line_number":135,"context_line":"                for vm_id in vms_of_src:"},{"line_number":136,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":137,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_502334a7","line":134,"range":{"start_line":134,"start_character":28,"end_line":134,"end_character":32},"updated":"2016-03-23 06:48:50.000000000","message":"Why is this an info instead of an error or warning?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                            min_delta \u003d tmp"},{"line_number":132,"context_line":"                            instance_id \u003d vm_id"},{"line_number":133,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":134,"context_line":"                        LOG.info(_LI(\"VM not found Error: %s\"), e.message)"},{"line_number":135,"context_line":"                for vm_id in vms_of_src:"},{"line_number":136,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":137,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_736be2f1","line":134,"range":{"start_line":134,"start_character":28,"end_line":134,"end_character":32},"in_reply_to":"fa0719c6_502334a7","updated":"2016-03-23 09:12:13.000000000","message":"good point","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                            instance_id \u003d vm_id"},{"line_number":133,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":134,"context_line":"                        LOG.info(_LI(\"VM not found Error: %s\"), e.message)"},{"line_number":135,"context_line":"                for vm_id in vms_of_src:"},{"line_number":136,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":137,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_d0e2a42e","line":135,"updated":"2016-03-23 06:48:50.000000000","message":"Why not just return mig_src_hypervisor, model.get_vm_from_id(instance_id) ?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                            instance_id \u003d vm_id"},{"line_number":133,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":134,"context_line":"                        LOG.info(_LI(\"VM not found Error: %s\"), e.message)"},{"line_number":135,"context_line":"                for vm_id in vms_of_src:"},{"line_number":136,"context_line":"                    if vm_id \u003d\u003d instance_id:"},{"line_number":137,"context_line":"                        return mig_src_hypervisor, model.get_vm_from_id(vm_id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_1e2d4d95","line":135,"in_reply_to":"fa0719c6_d0e2a42e","updated":"2016-03-23 09:12:13.000000000","message":"make sense","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        for hvmap in hosts:"},{"line_number":155,"context_line":"            host \u003d hvmap[\u0027hv\u0027]"},{"line_number":156,"context_line":"            workload \u003d hvmap[\u0027workload\u0027]"},{"line_number":157,"context_line":"            # available"},{"line_number":158,"context_line":"            cores_used, mem_used, disk_used \u003d self.calc_used_res(model,"},{"line_number":159,"context_line":"                                                                 host,"},{"line_number":160,"context_line":"                                                                 cap_cores,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_705598f8","line":157,"range":{"start_line":157,"start_character":14,"end_line":157,"end_character":23},"updated":"2016-03-23 06:48:50.000000000","message":"?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        for hvmap in hosts:"},{"line_number":155,"context_line":"            host \u003d hvmap[\u0027hv\u0027]"},{"line_number":156,"context_line":"            workload \u003d hvmap[\u0027workload\u0027]"},{"line_number":157,"context_line":"            # available"},{"line_number":158,"context_line":"            cores_used, mem_used, disk_used \u003d self.calc_used_res(model,"},{"line_number":159,"context_line":"                                                                 host,"},{"line_number":160,"context_line":"                                                                 cap_cores,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_1e7b8d8d","line":157,"range":{"start_line":157,"start_character":14,"end_line":157,"end_character":23},"in_reply_to":"fa0719c6_705598f8","updated":"2016-03-23 09:12:13.000000000","message":"more comments will be added","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            cores_available \u003d cap_cores.get_capacity(host) - cores_used"},{"line_number":164,"context_line":"            disk_available \u003d cap_disk.get_capacity(host) - disk_used"},{"line_number":165,"context_line":"            mem_available \u003d cap_mem.get_capacity(host) - mem_used"},{"line_number":166,"context_line":"            if cores_available \u003e\u003d required_cores and \\"},{"line_number":167,"context_line":"                disk_available \u003e\u003d required_disk and \\"},{"line_number":168,"context_line":"                mem_available \u003e\u003d required_mem and \\"},{"line_number":169,"context_line":"               (src_vm_workload + workload) \u003c self.threshold / 100 * \\"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_90402c36","line":166,"updated":"2016-03-23 06:48:50.000000000","message":"Please use parens instead.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        return dest_servers"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":176,"context_line":"        hypervisors \u003d model.get_all_hypervisors()"},{"line_number":177,"context_line":"        cluster_size \u003d len(hypervisors)"},{"line_number":178,"context_line":"        if cluster_size \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_8dcdb587","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":31},"updated":"2016-03-23 06:48:50.000000000","message":"Method needs docstring for what it is doing.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        return dest_servers"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":176,"context_line":"        hypervisors \u003d model.get_all_hypervisors()"},{"line_number":177,"context_line":"        cluster_size \u003d len(hypervisors)"},{"line_number":178,"context_line":"        if cluster_size \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_a4c36e88","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":31},"in_reply_to":"fa0719c6_8dcdb587","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":176,"context_line":"        hypervisors \u003d model.get_all_hypervisors()"},{"line_number":177,"context_line":"        cluster_size \u003d len(hypervisors)"},{"line_number":178,"context_line":"        if cluster_size \u003d\u003d 0:"},{"line_number":179,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":180,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":181,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd15ede5","line":178,"range":{"start_line":178,"start_character":8,"end_line":178,"end_character":29},"updated":"2016-03-23 06:48:50.000000000","message":"if not hypervisors:","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":180,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":181,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":182,"context_line":"        hosts_need_release \u003d []"},{"line_number":183,"context_line":"        hosts_target \u003d []"},{"line_number":184,"context_line":"        # total workload of cluster"},{"line_number":185,"context_line":"        workload_cluster \u003d 0.0"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_edef11e7","line":182,"range":{"start_line":182,"start_character":8,"end_line":182,"end_character":26},"updated":"2016-03-23 06:48:50.000000000","message":"Suggestions: stressed_hosts, violated_hosts, hosts_gte_threshold","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":181,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":182,"context_line":"        hosts_need_release \u003d []"},{"line_number":183,"context_line":"        hosts_target \u003d []"},{"line_number":184,"context_line":"        # total workload of cluster"},{"line_number":185,"context_line":"        workload_cluster \u003d 0.0"},{"line_number":186,"context_line":"        # use workload_map to store the workload of VMs for reuse purpose"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_2da3c9b3","line":183,"range":{"start_line":183,"start_character":8,"end_line":183,"end_character":20},"updated":"2016-03-23 06:48:50.000000000","message":"Suggestions: nonviolated_hosts, relaxed_hosts, quiet_hosts, hosts_lt_threshold","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":182,"context_line":"        hosts_need_release \u003d []"},{"line_number":183,"context_line":"        hosts_target \u003d []"},{"line_number":184,"context_line":"        # total workload of cluster"},{"line_number":185,"context_line":"        workload_cluster \u003d 0.0"},{"line_number":186,"context_line":"        # use workload_map to store the workload of VMs for reuse purpose"},{"line_number":187,"context_line":"        workload_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd716d46","line":184,"updated":"2016-03-23 06:48:50.000000000","message":"In what units? What is this representing? Is utilization a better term? Need to better describe what \"workload\" means.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        # total workload of cluster"},{"line_number":185,"context_line":"        workload_cluster \u003d 0.0"},{"line_number":186,"context_line":"        # use workload_map to store the workload of VMs for reuse purpose"},{"line_number":187,"context_line":"        workload_map \u003d {}"},{"line_number":188,"context_line":"        for hypervisor_id in hypervisors:"},{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_4d38bd3d","line":187,"range":{"start_line":187,"start_character":8,"end_line":187,"end_character":20},"updated":"2016-03-23 06:48:50.000000000","message":"vm_util_cache?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        # total workload of cluster"},{"line_number":185,"context_line":"        workload_cluster \u003d 0.0"},{"line_number":186,"context_line":"        # use workload_map to store the workload of VMs for reuse purpose"},{"line_number":187,"context_line":"        workload_map \u003d {}"},{"line_number":188,"context_line":"        for hypervisor_id in hypervisors:"},{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_24a8fe8c","line":187,"range":{"start_line":187,"start_character":8,"end_line":187,"end_character":20},"in_reply_to":"fa0719c6_4d38bd3d","updated":"2016-03-23 09:12:13.000000000","message":"yes","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        for hypervisor_id in hypervisors:"},{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d96c53e","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":34},"updated":"2016-03-23 06:48:50.000000000","message":"hypervisor_util?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        for hypervisor_id in hypervisors:"},{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_9e015d3b","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":34},"in_reply_to":"fa0719c6_0d96c53e","updated":"2016-03-23 09:12:13.000000000","message":"yes,cpu being utilized of a hypervisor.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_edab9173","line":192,"updated":"2016-03-23 06:48:50.000000000","message":"Is it not possible to get this stat from ceilometer directly instead of computing each individual VM utilization in order to get the overall host utilization?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            hypervisor \u003d model.get_hypervisor_from_id(hypervisor_id)"},{"line_number":190,"context_line":"            vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_9e24bdc5","line":192,"in_reply_to":"fa0719c6_edab9173","updated":"2016-03-23 09:12:13.000000000","message":"This algorithm still requires the VM cpu utilization anyway.\nDoing this way can reduce the RPC calling times.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":196,"context_line":"                                 vm.uuid)"},{"line_number":197,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_4db39de9","line":194,"updated":"2016-03-23 06:48:50.000000000","message":"Why are we skipping non-active VMs? VMs that aren\u0027t active could still be chewing up a ton of CPU on the hypervisor.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            workload_of_hypervisor \u003d 0.0"},{"line_number":192,"context_line":"            for vm_id in vms:"},{"line_number":193,"context_line":"                vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":194,"context_line":"                if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":196,"context_line":"                                 vm.uuid)"},{"line_number":197,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_99121756","line":194,"in_reply_to":"fa0719c6_4db39de9","updated":"2016-03-23 09:12:13.000000000","message":"Good to know about that case. let\u0027s remove it","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":196,"context_line":"                                 vm.uuid)"},{"line_number":197,"context_line":"                        continue"},{"line_number":198,"context_line":"                cpu_util \u003d self.ceilometer.statistic_aggregation("},{"line_number":199,"context_line":"                    resource_id\u003dvm_id,"},{"line_number":200,"context_line":"                    meter_name\u003dself._meter,"},{"line_number":201,"context_line":"                    period\u003dself._period,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_6d58218b","line":198,"updated":"2016-03-23 06:48:50.000000000","message":"Does this throw any exceptions?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                        LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":196,"context_line":"                                 vm.uuid)"},{"line_number":197,"context_line":"                        continue"},{"line_number":198,"context_line":"                cpu_util \u003d self.ceilometer.statistic_aggregation("},{"line_number":199,"context_line":"                    resource_id\u003dvm_id,"},{"line_number":200,"context_line":"                    meter_name\u003dself._meter,"},{"line_number":201,"context_line":"                    period\u003dself._period,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_39602ba5","line":198,"in_reply_to":"fa0719c6_6d58218b","updated":"2016-03-23 09:12:13.000000000","message":"it just raises the uncorrectable one","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                    meter_name\u003dself._meter,"},{"line_number":201,"context_line":"                    period\u003dself._period,"},{"line_number":202,"context_line":"                    aggregate\u003d\u0027avg\u0027)"},{"line_number":203,"context_line":"                vm_cores \u003d cap_cores.get_capacity(vm)"},{"line_number":204,"context_line":"                if cpu_util is None:"},{"line_number":205,"context_line":"                    LOG.debug(\"%s: cpu_util is None\", vm_id)"},{"line_number":206,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd1b2dc9","line":203,"updated":"2016-03-23 06:48:50.000000000","message":"Shouldn\u0027t this come after the None check on cpu_util?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                    meter_name\u003dself._meter,"},{"line_number":201,"context_line":"                    period\u003dself._period,"},{"line_number":202,"context_line":"                    aggregate\u003d\u0027avg\u0027)"},{"line_number":203,"context_line":"                vm_cores \u003d cap_cores.get_capacity(vm)"},{"line_number":204,"context_line":"                if cpu_util is None:"},{"line_number":205,"context_line":"                    LOG.debug(\"%s: cpu_util is None\", vm_id)"},{"line_number":206,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_b9fb9bc0","line":203,"in_reply_to":"fa0719c6_cd1b2dc9","updated":"2016-03-23 09:12:13.000000000","message":"yes.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                    period\u003dself._period,"},{"line_number":202,"context_line":"                    aggregate\u003d\u0027avg\u0027)"},{"line_number":203,"context_line":"                vm_cores \u003d cap_cores.get_capacity(vm)"},{"line_number":204,"context_line":"                if cpu_util is None:"},{"line_number":205,"context_line":"                    LOG.debug(\"%s: cpu_util is None\", vm_id)"},{"line_number":206,"context_line":"                    continue"},{"line_number":207,"context_line":"                workload_map[vm_id] \u003d cpu_util * vm_cores / 100"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_8d6c9536","line":204,"updated":"2016-03-23 06:48:50.000000000","message":"Is this due to not sufficient time for ceilometer to collect enough data?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                    period\u003dself._period,"},{"line_number":202,"context_line":"                    aggregate\u003d\u0027avg\u0027)"},{"line_number":203,"context_line":"                vm_cores \u003d cap_cores.get_capacity(vm)"},{"line_number":204,"context_line":"                if cpu_util is None:"},{"line_number":205,"context_line":"                    LOG.debug(\"%s: cpu_util is None\", vm_id)"},{"line_number":206,"context_line":"                    continue"},{"line_number":207,"context_line":"                workload_map[vm_id] \u003d cpu_util * vm_cores / 100"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_99a21798","line":204,"in_reply_to":"fa0719c6_8d6c9536","updated":"2016-03-23 09:12:13.000000000","message":"Yes, also to avoid other kind of exceptions.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                workload_of_hypervisor +\u003d workload_map[vm_id]"},{"line_number":209,"context_line":"                LOG.debug(\"%s: cpu_util %f\", vm_id, cpu_util)"},{"line_number":210,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":211,"context_line":"            hy_cpu_util \u003d workload_of_hypervisor / hypervisor_cores * 100"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            workload_cluster +\u003d workload_of_hypervisor"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_6dcf8129","line":211,"range":{"start_line":211,"start_character":26,"end_line":211,"end_character":48},"updated":"2016-03-23 06:48:50.000000000","message":"So this is actually the number of cores that are currently being utilized?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                workload_of_hypervisor +\u003d workload_map[vm_id]"},{"line_number":209,"context_line":"                LOG.debug(\"%s: cpu_util %f\", vm_id, cpu_util)"},{"line_number":210,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":211,"context_line":"            hy_cpu_util \u003d workload_of_hypervisor / hypervisor_cores * 100"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            workload_cluster +\u003d workload_of_hypervisor"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_59019f69","line":211,"range":{"start_line":211,"start_character":26,"end_line":211,"end_character":48},"in_reply_to":"fa0719c6_6dcf8129","updated":"2016-03-23 09:12:13.000000000","message":"yes","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            raise wexc.ClusterStateNotDefined()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        current_model \u003d origin_model"},{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d9c050e","line":234,"range":{"start_line":234,"start_character":8,"end_line":234,"end_character":40},"updated":"2016-03-23 06:48:50.000000000","message":"Need better names.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            raise wexc.ClusterStateNotDefined()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        current_model \u003d origin_model"},{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_2d9749ed","line":234,"range":{"start_line":234,"start_character":71,"end_line":234,"end_character":72},"updated":"2016-03-23 06:48:50.000000000","message":"Please don\u0027t use backslashes - use parens instead.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            raise wexc.ClusterStateNotDefined()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        current_model \u003d origin_model"},{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_9925f70a","line":234,"range":{"start_line":234,"start_character":8,"end_line":234,"end_character":40},"in_reply_to":"fa0719c6_0d9c050e","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        current_model \u003d origin_model"},{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"},{"line_number":238,"context_line":"            LOG.debug(\"No hosts require optimization\")"},{"line_number":239,"context_line":"            return self.solution"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_cd7ccdb7","line":236,"updated":"2016-03-23 06:48:50.000000000","message":"LOG message for the hosts that are violated?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"},{"line_number":238,"context_line":"            LOG.debug(\"No hosts require optimization\")"},{"line_number":239,"context_line":"            return self.solution"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_8d8815c7","line":237,"updated":"2016-03-23 06:48:50.000000000","message":"if not hosts...","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        hosts_need_release, hosts_target, avg_workload, workload_map \u003d \\"},{"line_number":235,"context_line":"            self.group_hosts_by_cpu_util(current_model)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        if len(hosts_need_release) \u003d\u003d 0:"},{"line_number":238,"context_line":"            LOG.debug(\"No hosts require optimization\")"},{"line_number":239,"context_line":"            return self.solution"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_f9e353a2","line":237,"in_reply_to":"fa0719c6_8d8815c7","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            LOG.debug(\"No hosts require optimization\")"},{"line_number":239,"context_line":"            return self.solution"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        if len(hosts_target) \u003d\u003d 0:"},{"line_number":242,"context_line":"            LOG.warning(_LW(\"No hosts under cpu_util threshold found\"))"},{"line_number":243,"context_line":"            return self.solution"},{"line_number":244,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_ed91d1f2","line":241,"updated":"2016-03-23 06:48:50.000000000","message":"Ditto","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            return self.solution"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        if len(hosts_target) \u003d\u003d 0:"},{"line_number":242,"context_line":"            LOG.warning(_LW(\"No hosts under cpu_util threshold found\"))"},{"line_number":243,"context_line":"            return self.solution"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        # choose the server with largest cpu_util"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_0d6a45ee","line":242,"range":{"start_line":242,"start_character":29,"end_line":242,"end_character":68},"updated":"2016-03-23 06:48:50.000000000","message":"No hosts currently have CPU utilization under %(threshold)s percent; therefore there are no possible target hosts for any migrations.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            return self.solution"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        if len(hosts_target) \u003d\u003d 0:"},{"line_number":242,"context_line":"            LOG.warning(_LW(\"No hosts under cpu_util threshold found\"))"},{"line_number":243,"context_line":"            return self.solution"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        # choose the server with largest cpu_util"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_44289286","line":242,"range":{"start_line":242,"start_character":29,"end_line":242,"end_character":68},"in_reply_to":"fa0719c6_0d6a45ee","updated":"2016-03-23 09:12:13.000000000","message":"this is good","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            return self.solution"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        # choose the server with largest cpu_util"},{"line_number":246,"context_line":"        hosts_need_release \u003d sorted(hosts_need_release,"},{"line_number":247,"context_line":"                                    reverse\u003dTrue,"},{"line_number":248,"context_line":"                                    key\u003dlambda x: (x[self.METER_NAME]))"},{"line_number":249,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_90714c79","line":246,"updated":"2016-03-23 06:48:50.000000000","message":"So only a single host gets helped for any single execution of the strategy? That doesn\u0027t seem ideal.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            return self.solution"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        # choose the server with largest cpu_util"},{"line_number":246,"context_line":"        hosts_need_release \u003d sorted(hosts_need_release,"},{"line_number":247,"context_line":"                                    reverse\u003dTrue,"},{"line_number":248,"context_line":"                                    key\u003dlambda x: (x[self.METER_NAME]))"},{"line_number":249,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_24f0fefd","line":246,"in_reply_to":"fa0719c6_90714c79","updated":"2016-03-23 09:12:13.000000000","message":"Correct, that\u0027s why we suggest to use this strategy with `CONTINUOUS` audits.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                                                  avg_workload,"},{"line_number":253,"context_line":"                                                  workload_map)"},{"line_number":254,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_b06a90b1","line":255,"updated":"2016-03-23 06:48:50.000000000","message":"if not vm_to_migrate","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                                                  avg_workload,"},{"line_number":253,"context_line":"                                                  workload_map)"},{"line_number":254,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_44f09267","line":255,"in_reply_to":"fa0719c6_b06a90b1","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                                                  workload_map)"},{"line_number":254,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"},{"line_number":259,"context_line":"                                                hosts_target,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_50a854db","line":256,"updated":"2016-03-23 06:48:50.000000000","message":"There needs to be better logs to determine why no VM was chosen for migration.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                                                  workload_map)"},{"line_number":254,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"},{"line_number":259,"context_line":"                                                hosts_target,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_64a2f64c","line":256,"in_reply_to":"fa0719c6_50a854db","updated":"2016-03-23 09:12:13.000000000","message":"yes, the function choose_vm_to_migrate will log it.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"},{"line_number":259,"context_line":"                                                hosts_target,"},{"line_number":260,"context_line":"                                                vm_src,"},{"line_number":261,"context_line":"                                                avg_workload, workload_map)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_f0c6c866","line":258,"updated":"2016-03-23 06:48:50.000000000","message":"Should probably be named destination_hosts instead of using servers, since that is used a lot for the notion of a VM.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        if vm_to_migrate is None:"},{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":"        mig_src_hypervisor, vm_src \u003d vm_to_migrate"},{"line_number":258,"context_line":"        dest_servers \u003d self.filter_dest_servers(current_model,"},{"line_number":259,"context_line":"                                                hosts_target,"},{"line_number":260,"context_line":"                                                vm_src,"},{"line_number":261,"context_line":"                                                avg_workload, workload_map)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_24511e37","line":258,"in_reply_to":"fa0719c6_f0c6c866","updated":"2016-03-23 09:12:13.000000000","message":"sure","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                                                avg_workload, workload_map)"},{"line_number":262,"context_line":"        # sort the filtered result by workload"},{"line_number":263,"context_line":"        # pick up the lowest one as dest server"},{"line_number":264,"context_line":"        if len(dest_servers) \u003d\u003d 0:"},{"line_number":265,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":266,"context_line":"            # for instance."},{"line_number":267,"context_line":"            LOG.info(_LI(\"No proper target host could be found\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_d01584e5","line":264,"updated":"2016-03-23 06:48:50.000000000","message":"if not dest_servers","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        if len(dest_servers) \u003d\u003d 0:"},{"line_number":265,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":266,"context_line":"            # for instance."},{"line_number":267,"context_line":"            LOG.info(_LI(\"No proper target host could be found\"))"},{"line_number":268,"context_line":"            return self.solution"},{"line_number":269,"context_line":"        dest_servers \u003d sorted(dest_servers, reverse\u003dTrue,"},{"line_number":270,"context_line":"                              key\u003dlambda x: (x[\"cpu_util\"]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_b07e1017","line":267,"updated":"2016-03-23 06:48:50.000000000","message":"Why not? There needs to be some sort of logging to figure out what is going on.","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"6d55f5008cd61f2831e797bcfb4ccfb458182ba5","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        if len(dest_servers) \u003d\u003d 0:"},{"line_number":265,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":266,"context_line":"            # for instance."},{"line_number":267,"context_line":"            LOG.info(_LI(\"No proper target host could be found\"))"},{"line_number":268,"context_line":"            return self.solution"},{"line_number":269,"context_line":"        dest_servers \u003d sorted(dest_servers, reverse\u003dTrue,"},{"line_number":270,"context_line":"                              key\u003dlambda x: (x[\"cpu_util\"]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_f0740837","line":267,"range":{"start_line":267,"start_character":16,"end_line":267,"end_character":20},"updated":"2016-03-23 06:48:50.000000000","message":"warn?","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"5a2f66c843d48d239aea55a4fc059f4acede9e73","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        if len(dest_servers) \u003d\u003d 0:"},{"line_number":265,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":266,"context_line":"            # for instance."},{"line_number":267,"context_line":"            LOG.info(_LI(\"No proper target host could be found\"))"},{"line_number":268,"context_line":"            return self.solution"},{"line_number":269,"context_line":"        dest_servers \u003d sorted(dest_servers, reverse\u003dTrue,"},{"line_number":270,"context_line":"                              key\u003dlambda x: (x[\"cpu_util\"]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_ff3213f1","line":267,"in_reply_to":"fa0719c6_b07e1017","updated":"2016-03-23 09:12:13.000000000","message":"yes, will add more information","commit_id":"4786021796f8f15cdeb087b5887e2c476f6380f0"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from watcher.decision_engine.model import resource"},{"line_number":25,"context_line":"from watcher.decision_engine.model import vm_state"},{"line_number":26,"context_line":"from watcher.decision_engine.strategy.strategies import base"},{"line_number":27,"context_line":"from watcher.metrics_engine.cluster_history import ceilometer  \\"},{"line_number":28,"context_line":"    as ceil"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_a73238a5","line":28,"range":{"start_line":27,"start_character":0,"end_line":28,"end_character":11},"updated":"2016-03-31 12:30:35.000000000","message":"Here it can be combined into one line","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from watcher.decision_engine.model import resource"},{"line_number":25,"context_line":"from watcher.decision_engine.model import vm_state"},{"line_number":26,"context_line":"from watcher.decision_engine.strategy.strategies import base"},{"line_number":27,"context_line":"from watcher.metrics_engine.cluster_history import ceilometer  \\"},{"line_number":28,"context_line":"    as ceil"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_ac9e6604","line":28,"range":{"start_line":27,"start_character":0,"end_line":28,"end_character":11},"in_reply_to":"ba0121b8_a73238a5","updated":"2016-04-01 03:08:44.000000000","message":"Done","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    DEFAULT_DESCRIPTION \u003d \"workload balance migration strategy\""},{"line_number":64,"context_line":"    # The meter to report CPU utilization % of VM in ceilometer"},{"line_number":65,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":66,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":67,"context_line":"    # TODO(Junjie): make it configurable"},{"line_number":68,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":69,"context_line":"    # choose 300 seconds as the default duration of meter aggregation"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_47d07c1f","line":66,"range":{"start_line":66,"start_character":15,"end_line":66,"end_character":38},"updated":"2016-03-31 12:30:35.000000000","message":"\"value range is [0, 100]\" will be better, like you write in your specs","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    DEFAULT_DESCRIPTION \u003d \"workload balance migration strategy\""},{"line_number":64,"context_line":"    # The meter to report CPU utilization % of VM in ceilometer"},{"line_number":65,"context_line":"    METER_NAME \u003d \"cpu_util\""},{"line_number":66,"context_line":"    # Unit: %, value is from [0 , 100]"},{"line_number":67,"context_line":"    # TODO(Junjie): make it configurable"},{"line_number":68,"context_line":"    THRESHOLD \u003d 25.0"},{"line_number":69,"context_line":"    # choose 300 seconds as the default duration of meter aggregation"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_ec8cdedb","line":66,"range":{"start_line":66,"start_character":15,"end_line":66,"end_character":38},"in_reply_to":"ba0121b8_47d07c1f","updated":"2016-04-01 03:08:44.000000000","message":"sure.","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def ceilometer(self, c):"},{"line_number":100,"context_line":"        self._ceilometer \u003d c"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":103,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":104,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":105,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_67edc0b6","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":21},"updated":"2016-03-31 12:30:35.000000000","message":"Not use abbreviation here will be clearly because this method name isn\u0027t long. as you can see def calculte_score_node() or def cacilte_weight() in\n/watcher/decsion_engine/strategy/strategies/basic_consolidation.py","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def ceilometer(self, c):"},{"line_number":100,"context_line":"        self._ceilometer \u003d c"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":103,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":104,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":105,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_ec7a1ebc","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":21},"in_reply_to":"ba0121b8_67edc0b6","updated":"2016-04-01 03:08:44.000000000","message":"yes, but the whole word should be calculate_used_resource, a bit long, need to break line.","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                        # select the first active VM to migrate"},{"line_number":133,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":135,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":136,"context_line":"                                     vm.uuid)"},{"line_number":137,"context_line":"                            continue"},{"line_number":138,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_967916cb","line":135,"range":{"start_line":135,"start_character":32,"end_line":135,"end_character":36},"updated":"2016-03-31 12:30:35.000000000","message":"Maybe  change to LOG.debug will better. Log will be too much if  there are a lot of instance which not in ACTIVE. more important is we do not need to print out the selection process.","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                        # select the first active VM to migrate"},{"line_number":133,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":135,"context_line":"                            LOG.info(_LI(\"VM not active, skipped: %s\"),"},{"line_number":136,"context_line":"                                     vm.uuid)"},{"line_number":137,"context_line":"                            continue"},{"line_number":138,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_cc759acb","line":135,"range":{"start_line":135,"start_character":32,"end_line":135,"end_character":36},"in_reply_to":"ba0121b8_967916cb","updated":"2016-04-01 03:08:44.000000000","message":"ok","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        for hvmap in hosts:"},{"line_number":166,"context_line":"            host \u003d hvmap[\u0027hv\u0027]"},{"line_number":167,"context_line":"            workload \u003d hvmap[\u0027workload\u0027]"},{"line_number":168,"context_line":"            # calculate the available resources"},{"line_number":169,"context_line":"            cores_used, mem_used, disk_used \u003d self.calc_used_res(model,"},{"line_number":170,"context_line":"                                                                 host,"},{"line_number":171,"context_line":"                                                                 cap_cores,"},{"line_number":172,"context_line":"                                                                 cap_mem,"},{"line_number":173,"context_line":"                                                                 cap_disk)"},{"line_number":174,"context_line":"            cores_available \u003d cap_cores.get_capacity(host) - cores_used"},{"line_number":175,"context_line":"            disk_available \u003d cap_disk.get_capacity(host) - disk_used"},{"line_number":176,"context_line":"            mem_available \u003d cap_mem.get_capacity(host) - mem_used"},{"line_number":177,"context_line":"            if (cores_available \u003e\u003d required_cores and"},{"line_number":178,"context_line":"                disk_available \u003e\u003d required_disk and"},{"line_number":179,"context_line":"                mem_available \u003e\u003d required_mem and"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_b6c37a56","line":176,"range":{"start_line":168,"start_character":12,"end_line":176,"end_character":65},"updated":"2016-03-31 12:30:35.000000000","message":"Perhaps we need to refactor this part code to a method name \"calculate_available_resources\"","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        for hvmap in hosts:"},{"line_number":166,"context_line":"            host \u003d hvmap[\u0027hv\u0027]"},{"line_number":167,"context_line":"            workload \u003d hvmap[\u0027workload\u0027]"},{"line_number":168,"context_line":"            # calculate the available resources"},{"line_number":169,"context_line":"            cores_used, mem_used, disk_used \u003d self.calc_used_res(model,"},{"line_number":170,"context_line":"                                                                 host,"},{"line_number":171,"context_line":"                                                                 cap_cores,"},{"line_number":172,"context_line":"                                                                 cap_mem,"},{"line_number":173,"context_line":"                                                                 cap_disk)"},{"line_number":174,"context_line":"            cores_available \u003d cap_cores.get_capacity(host) - cores_used"},{"line_number":175,"context_line":"            disk_available \u003d cap_disk.get_capacity(host) - disk_used"},{"line_number":176,"context_line":"            mem_available \u003d cap_mem.get_capacity(host) - mem_used"},{"line_number":177,"context_line":"            if (cores_available \u003e\u003d required_cores and"},{"line_number":178,"context_line":"                disk_available \u003e\u003d required_disk and"},{"line_number":179,"context_line":"                mem_available \u003e\u003d required_mem and"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_6c344efb","line":176,"range":{"start_line":168,"start_character":12,"end_line":176,"end_character":65},"in_reply_to":"ba0121b8_b6c37a56","updated":"2016-04-01 03:08:44.000000000","message":"the method would be too short, let\u0027s just keep it.","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":199,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":200,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":201,"context_line":"        violated_hosts \u003d []"},{"line_number":202,"context_line":"        nonviolated_hosts \u003d []"},{"line_number":203,"context_line":"        # total workload of cluster"},{"line_number":204,"context_line":"        # it\u0027s the total core numbers being utilized in a cluster."}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_cdeaed0e","line":201,"range":{"start_line":201,"start_character":8,"end_line":201,"end_character":16},"updated":"2016-03-31 12:30:35.000000000","message":"violated_hosts change to overload_hosts may be better?","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            raise wexc.ClusterEmpty()"},{"line_number":199,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":200,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":201,"context_line":"        violated_hosts \u003d []"},{"line_number":202,"context_line":"        nonviolated_hosts \u003d []"},{"line_number":203,"context_line":"        # total workload of cluster"},{"line_number":204,"context_line":"        # it\u0027s the total core numbers being utilized in a cluster."}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_cc0aba25","line":201,"range":{"start_line":201,"start_character":8,"end_line":201,"end_character":16},"in_reply_to":"ba0121b8_cdeaed0e","updated":"2016-04-01 03:08:44.000000000","message":"sure","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        # get cpu cores capacity of hypervisors and vms"},{"line_number":200,"context_line":"        cap_cores \u003d model.get_resource_from_id(resource.ResourceType.cpu_cores)"},{"line_number":201,"context_line":"        violated_hosts \u003d []"},{"line_number":202,"context_line":"        nonviolated_hosts \u003d []"},{"line_number":203,"context_line":"        # total workload of cluster"},{"line_number":204,"context_line":"        # it\u0027s the total core numbers being utilized in a cluster."},{"line_number":205,"context_line":"        workload_cluster \u003d 0.0"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_8dbc7507","line":202,"range":{"start_line":202,"start_character":11,"end_line":202,"end_character":19},"updated":"2016-03-31 12:30:35.000000000","message":"and this","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":231,"context_line":"            hy_cpu_util \u003d hypervisor_workload / hypervisor_cores * 100"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"            workload_cluster +\u003d hypervisor_workload"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"            hvmap \u003d {\u0027hv\u0027: hypervisor, \"cpu_util\": hy_cpu_util, \u0027workload\u0027:"},{"line_number":236,"context_line":"                     hypervisor_workload}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_fe3dd5dd","line":233,"range":{"start_line":233,"start_character":12,"end_line":233,"end_character":51},"updated":"2016-03-31 12:30:35.000000000","message":"workload_cluster change to cluster_workload consistent with hypervisor_workload","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            hypervisor_cores \u003d cap_cores.get_capacity(hypervisor)"},{"line_number":231,"context_line":"            hy_cpu_util \u003d hypervisor_workload / hypervisor_cores * 100"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"            workload_cluster +\u003d hypervisor_workload"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"            hvmap \u003d {\u0027hv\u0027: hypervisor, \"cpu_util\": hy_cpu_util, \u0027workload\u0027:"},{"line_number":236,"context_line":"                     hypervisor_workload}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_9f08e229","line":233,"range":{"start_line":233,"start_character":12,"end_line":233,"end_character":51},"in_reply_to":"ba0121b8_fe3dd5dd","updated":"2016-04-01 03:08:44.000000000","message":"Done","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return violated_hosts, nonviolated_hosts, avg_workload, workload_cache"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def execute(self, origin_model):"},{"line_number":248,"context_line":"        LOG.debug(\"Initializing Workload Balance Strategy\")"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        if origin_model is None:"},{"line_number":251,"context_line":"            raise wexc.ClusterStateNotDefined()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_930132b2","line":248,"range":{"start_line":248,"start_character":12,"end_line":248,"end_character":17},"updated":"2016-03-31 12:30:35.000000000","message":"this should be LOG.info","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return violated_hosts, nonviolated_hosts, avg_workload, workload_cache"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def execute(self, origin_model):"},{"line_number":248,"context_line":"        LOG.debug(\"Initializing Workload Balance Strategy\")"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        if origin_model is None:"},{"line_number":251,"context_line":"            raise wexc.ClusterStateNotDefined()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_1f1df265","line":248,"range":{"start_line":248,"start_character":12,"end_line":248,"end_character":17},"in_reply_to":"ba0121b8_930132b2","updated":"2016-04-01 03:08:44.000000000","message":"Done","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                                                  src_hypervisors,"},{"line_number":274,"context_line":"                                                  avg_workload,"},{"line_number":275,"context_line":"                                                  workload_cache)"},{"line_number":276,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":277,"context_line":"        if not vm_to_migrate:"},{"line_number":278,"context_line":"            return self.solution"},{"line_number":279,"context_line":"        source_hypervisor, vm_src \u003d vm_to_migrate"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_1856e1cd","line":276,"range":{"start_line":276,"start_character":8,"end_line":276,"end_character":56},"updated":"2016-03-31 12:30:35.000000000","message":"The comment isn\u0027t accurate, The following code be used to select the migration destination host","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"408694c89c4b7cd47b36a40dc4dc0c288a6fdd8b","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                                                  src_hypervisors,"},{"line_number":274,"context_line":"                                                  avg_workload,"},{"line_number":275,"context_line":"                                                  workload_cache)"},{"line_number":276,"context_line":"        # calculate the vm\u0027s cpu cores,memory,disk needs"},{"line_number":277,"context_line":"        if not vm_to_migrate:"},{"line_number":278,"context_line":"            return self.solution"},{"line_number":279,"context_line":"        source_hypervisor, vm_src \u003d vm_to_migrate"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_bf3fa6b2","line":276,"range":{"start_line":276,"start_character":8,"end_line":276,"end_character":56},"in_reply_to":"ba0121b8_1856e1cd","updated":"2016-04-01 03:08:44.000000000","message":"good point","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"3beea4d771e8cc66f89ce4c252179a1979ea5a36","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    def ceilometer(self, c):"},{"line_number":99,"context_line":"        self._ceilometer \u003d c"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":102,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":103,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":104,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba0121b8_df57fa55","line":101,"range":{"start_line":101,"start_character":8,"end_line":101,"end_character":21},"updated":"2016-04-01 03:37:35.000000000","message":"Hmmm,I think method name（not long name）can explain method func is a better python code style. Break line is ok. Like you define filter_destination_host.","commit_id":"32242d66f8d215e042f350f691d79cd93725d6d4"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"f018d7dbda81e94af0bfef0cf76019a201d0f644","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    def ceilometer(self, c):"},{"line_number":99,"context_line":"        self._ceilometer \u003d c"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def calc_used_res(self, model, hypervisor, cap_cores, cap_mem, cap_disk):"},{"line_number":102,"context_line":"        \u0027\u0027\u0027calculate the used vcpus, memory and disk based on VM flavors\u0027\u0027\u0027"},{"line_number":103,"context_line":"        vms \u003d model.get_mapping().get_node_vms(hypervisor)"},{"line_number":104,"context_line":"        vcpus_used \u003d 0"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba0121b8_ddd422ed","line":101,"range":{"start_line":101,"start_character":8,"end_line":101,"end_character":21},"in_reply_to":"ba0121b8_df57fa55","updated":"2016-04-01 05:12:29.000000000","message":"Done","commit_id":"32242d66f8d215e042f350f691d79cd93725d6d4"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher._i18n import _LE"},{"line_number":21,"context_line":"from watcher._i18n import _LI"},{"line_number":22,"context_line":"from watcher._i18n import _LW"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_e83c0dca","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":24},"updated":"2016-04-06 14:53:05.000000000","message":"nit: missing blank line after this import","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher._i18n import _LE"},{"line_number":21,"context_line":"from watcher._i18n import _LI"},{"line_number":22,"context_line":"from watcher._i18n import _LW"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_f87f9fdd","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":24},"in_reply_to":"9a061dce_e83c0dca","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher._i18n import _LE"},{"line_number":21,"context_line":"from watcher._i18n import _LI"},{"line_number":22,"context_line":"from watcher._i18n import _LW"},{"line_number":23,"context_line":"from watcher.common import exception as wexc"},{"line_number":24,"context_line":"from watcher.decision_engine.model import resource"},{"line_number":25,"context_line":"from watcher.decision_engine.model import vm_state"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_6828fd86","line":22,"range":{"start_line":20,"start_character":0,"end_line":22,"end_character":29},"updated":"2016-04-06 14:53:05.000000000","message":"nit: can you make it into a single line? see https://github.com/openstack/watcher/blob/master/watcher/db/purge.py#L30","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher._i18n import _LE"},{"line_number":21,"context_line":"from watcher._i18n import _LI"},{"line_number":22,"context_line":"from watcher._i18n import _LW"},{"line_number":23,"context_line":"from watcher.common import exception as wexc"},{"line_number":24,"context_line":"from watcher.decision_engine.model import resource"},{"line_number":25,"context_line":"from watcher.decision_engine.model import vm_state"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_9856635a","line":22,"range":{"start_line":20,"start_character":0,"end_line":22,"end_character":29},"in_reply_to":"9a061dce_6828fd86","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self, name\u003dDEFAULT_NAME, description\u003dDEFAULT_DESCRIPTION,"},{"line_number":75,"context_line":"                 osc\u003dNone):"},{"line_number":76,"context_line":"        \"\"\"using live migration"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param name: the name of the strategy"},{"line_number":79,"context_line":"        :param description: a description of the strategy"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_085ea111","line":76,"range":{"start_line":76,"start_character":11,"end_line":76,"end_character":16},"updated":"2016-04-06 14:53:05.000000000","message":"s/using/Using","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self, name\u003dDEFAULT_NAME, description\u003dDEFAULT_DESCRIPTION,"},{"line_number":75,"context_line":"                 osc\u003dNone):"},{"line_number":76,"context_line":"        \"\"\"using live migration"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param name: the name of the strategy"},{"line_number":79,"context_line":"        :param description: a description of the strategy"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_18c9b326","line":76,"range":{"start_line":76,"start_character":11,"end_line":76,"end_character":16},"in_reply_to":"9a061dce_085ea111","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                        # select the first active VM to migrate"},{"line_number":133,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":135,"context_line":"                            LOG.debug(_LI(\"VM not active, skipped: %s\"),"},{"line_number":136,"context_line":"                                      vm.uuid)"},{"line_number":137,"context_line":"                            continue"},{"line_number":138,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_88cd91b9","line":135,"range":{"start_line":135,"start_character":38,"end_line":135,"end_character":41},"updated":"2016-04-06 14:53:05.000000000","message":"no need for _LI if you do a log.debug()","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                        # select the first active VM to migrate"},{"line_number":133,"context_line":"                        vm \u003d model.get_vm_from_id(vm_id)"},{"line_number":134,"context_line":"                        if vm.state !\u003d vm_state.VMState.ACTIVE.value:"},{"line_number":135,"context_line":"                            LOG.debug(_LI(\"VM not active, skipped: %s\"),"},{"line_number":136,"context_line":"                                      vm.uuid)"},{"line_number":137,"context_line":"                            continue"},{"line_number":138,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_78da6fe9","line":135,"range":{"start_line":135,"start_character":38,"end_line":135,"end_character":41},"in_reply_to":"9a061dce_88cd91b9","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        return destination_hosts"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":184,"context_line":"        \"\"\"calculate the workloads of each hypervisor"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        try to find out the hypervisors which have reached threshold"},{"line_number":187,"context_line":"        and the hypervisors which are under threshold."}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_4819b9d6","line":184,"range":{"start_line":184,"start_character":11,"end_line":184,"end_character":20},"updated":"2016-04-06 14:53:05.000000000","message":"s/calculate/Calculate","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        return destination_hosts"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def group_hosts_by_cpu_util(self, model):"},{"line_number":184,"context_line":"        \"\"\"calculate the workloads of each hypervisor"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        try to find out the hypervisors which have reached threshold"},{"line_number":187,"context_line":"        and the hypervisors which are under threshold."}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_f8f4bf5b","line":184,"range":{"start_line":184,"start_character":11,"end_line":184,"end_character":20},"in_reply_to":"9a061dce_4819b9d6","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        if not target_hypervisors:"},{"line_number":259,"context_line":"            LOG.warning(_LW(\"No hosts current have CPU utilization under %s \\"},{"line_number":260,"context_line":"                             percent, therefore there are no possible target \\"},{"line_number":261,"context_line":"                             hosts for any migration\"), self.threshold)"},{"line_number":262,"context_line":"            return self.solution"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_a89df50b","line":259,"range":{"start_line":259,"start_character":76,"end_line":259,"end_character":77},"updated":"2016-04-06 14:53:05.000000000","message":"nit: can you avoid using backslashes here?\n\nLOG.warning(\n    _LW(\"No hosts current have CPU utilization under %s \"\n        \"percent, therefore there are no possible target \"\n        \"hosts for any migration\"),\n    self.threshold)","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"291cb1c4aed90a87539a7bc64cba8045662a25d3","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            return self.solution"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        if not target_hypervisors:"},{"line_number":259,"context_line":"            LOG.warning(_LW(\"No hosts current have CPU utilization under %s \\"},{"line_number":260,"context_line":"                             percent, therefore there are no possible target \\"},{"line_number":261,"context_line":"                             hosts for any migration\"), self.threshold)"},{"line_number":262,"context_line":"            return self.solution"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_f89b1f16","line":259,"range":{"start_line":259,"start_character":76,"end_line":259,"end_character":77},"in_reply_to":"9a061dce_a89df50b","updated":"2016-04-07 01:27:33.000000000","message":"Done","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b564bf7ef7f0a709bff396bd7602bb0b99378d70","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        if not destination_hosts:"},{"line_number":285,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":286,"context_line":"            # for instance."},{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \\"},{"line_number":288,"context_line":"                            be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a061dce_88b9117c","line":287,"range":{"start_line":287,"start_character":76,"end_line":287,"end_character":77},"updated":"2016-04-06 14:53:05.000000000","message":"ditto","commit_id":"d4f2b79ee556ab1e8f61e793733357ebf4583e27"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"8f3cb4e3f55943e716ff26880f4d6a2514854241","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_6da3709f","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"updated":"2016-04-12 07:38:08.000000000","message":"Your algorithm will be selected the same vm_src and mig_dst_hypervisor If the last migration failed. workload_balance will enter a loop. maybe  we need remove the  mig_dst_hypervisor in last migration from destination_hosts.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"2cc4c3020999959c72973acc56947365007d7cc8","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_a303d9b7","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"in_reply_to":"5a18252c_08462a23","updated":"2016-04-12 08:19:09.000000000","message":"There are many reasons such as libvirt service/neutron agent exception or disk I/O error on dest host .Mostly,these issues need to artificially repair. So,it may not be successed in next loop.\nAnd these hosts with exception  can\u0027t be filter in watcher indeed. So,we need remove these hosts in next Migration to avoid useless operation.\nAs we can see in nova-shceduler,During reschedule, the compute node will be add to ignore_host if spawning instance failed on it.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"4e0194e317c219e8a1eefebb111ea468a2cc474a","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_08462a23","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"in_reply_to":"5a18252c_6da3709f","updated":"2016-04-12 07:57:02.000000000","message":"Why it failed? Why it could not be successed in next loop?\nSure, we need to filter out these hosts before loop if we really know the host is not suitable to migrate to.\nSo, let\u0027s optimize it when we really know some other kind of bad conditions.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"471275df2c776045e83688597564c3783f18ceab","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_a3fc793f","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"in_reply_to":"5a18252c_a303d9b7","updated":"2016-04-12 08:30:01.000000000","message":"Actually, the Strategy can not detect whether the migration is success or not, it just generates the Solution with action plan.\nYou can give suggestion in the weekly meeting, to see how Watcher Strategy can do better.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"1a8e4e181b4dbc089a3b8127ff26e153cec961b9","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_e3e150d2","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"in_reply_to":"5a18252c_a3bbd80d","updated":"2016-04-12 08:48:06.000000000","message":"This might be a method. \nBut i think the best way is to make the migration component report result, then Watcher engine can pass down the ignore_hosts to Strategy.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"98123575f7ced4fadd9168889e8f7825b986920a","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":288,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"},{"line_number":289,"context_line":"            return self.solution"},{"line_number":290,"context_line":"        destination_hosts \u003d sorted(destination_hosts, reverse\u003dTrue,"},{"line_number":291,"context_line":"                                   key\u003dlambda x: (x[\"cpu_util\"]))"},{"line_number":292,"context_line":"        # always use the host with lowerest CPU utilization"},{"line_number":293,"context_line":"        mig_dst_hypervisor \u003d destination_hosts[0][\u0027hv\u0027]"},{"line_number":294,"context_line":"        # generate solution to migrate the vm to the dest server,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_a3bbd80d","line":291,"range":{"start_line":290,"start_character":7,"end_line":291,"end_character":64},"in_reply_to":"5a18252c_a3fc793f","updated":"2016-04-12 08:40:49.000000000","message":"OK, I see. Thank you for your patience to answer ：）.\nMaybe we can check （vm_src \u003d\u003d last vm_src and dest_migration \u003d\u003d last_dest_migration）. We can think last migration failed if it\u0027s True.","commit_id":"9f9c42eee16f22343eab1ac7758217649713d34a"},{"author":{"_account_id":16495,"name":"Jean-Emile DARTOIS","email":"jean-emile.dartois@b-com.com","username":"JeD"},"change_message_id":"7ed8f220f5ee81b63367e077ef056209d4be8ede","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_cache):"},{"line_number":116,"context_line":"        \"\"\"pick up an active vm instance to migrate from provided hosts"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        :param hosts: the array of dict which contains hypervisor object"},{"line_number":119,"context_line":"        :param avg_workload: the average workload value of all hypervisors"},{"line_number":120,"context_line":"        :param workload_cache: the map contains vm to workload mapping"},{"line_number":121,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_dae4410e","line":118,"updated":"2016-04-28 09:17:21.000000000","message":"nit: Missing docstring model","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"cf21006c7ab4dd43cc0eae349a1f8ffc8d1d88d3","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def choose_vm_to_migrate(self, model, hosts, avg_workload, workload_cache):"},{"line_number":116,"context_line":"        \"\"\"pick up an active vm instance to migrate from provided hosts"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        :param hosts: the array of dict which contains hypervisor object"},{"line_number":119,"context_line":"        :param avg_workload: the average workload value of all hypervisors"},{"line_number":120,"context_line":"        :param workload_cache: the map contains vm to workload mapping"},{"line_number":121,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_d5f07893","line":118,"in_reply_to":"1a122d0e_dae4410e","updated":"2016-04-29 08:12:50.000000000","message":"Done","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":16495,"name":"Jean-Emile DARTOIS","email":"jean-emile.dartois@b-com.com","username":"JeD"},"change_message_id":"7ed8f220f5ee81b63367e077ef056209d4be8ede","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                                      vm.uuid)"},{"line_number":136,"context_line":"                            continue"},{"line_number":137,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"},{"line_number":138,"context_line":"                        if current_delta \u003e\u003d 0 and current_delta \u003c min_delta:"},{"line_number":139,"context_line":"                            min_delta \u003d current_delta"},{"line_number":140,"context_line":"                            instance_id \u003d vm_id"},{"line_number":141,"context_line":"                    except wexc.VMNotFound as e:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_9ab5a9ee","line":138,"updated":"2016-04-28 09:17:21.000000000","message":"You can simplified the comparison:\nif 0 \u003c\u003d current_delta \u003c min_delta:","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"cf21006c7ab4dd43cc0eae349a1f8ffc8d1d88d3","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                                      vm.uuid)"},{"line_number":136,"context_line":"                            continue"},{"line_number":137,"context_line":"                        current_delta \u003d delta_workload - workload_cache[vm_id]"},{"line_number":138,"context_line":"                        if current_delta \u003e\u003d 0 and current_delta \u003c min_delta:"},{"line_number":139,"context_line":"                            min_delta \u003d current_delta"},{"line_number":140,"context_line":"                            instance_id \u003d vm_id"},{"line_number":141,"context_line":"                    except wexc.VMNotFound as e:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_95fa8073","line":138,"in_reply_to":"1a122d0e_9ab5a9ee","updated":"2016-04-29 08:12:50.000000000","message":"good to know.","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":16495,"name":"Jean-Emile DARTOIS","email":"jean-emile.dartois@b-com.com","username":"JeD"},"change_message_id":"7ed8f220f5ee81b63367e077ef056209d4be8ede","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        if current_delta \u003e\u003d 0 and current_delta \u003c min_delta:"},{"line_number":139,"context_line":"                            min_delta \u003d current_delta"},{"line_number":140,"context_line":"                            instance_id \u003d vm_id"},{"line_number":141,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":142,"context_line":"                        LOG.error(_LE(\"VM not found Error: %s\"), e.message)"},{"line_number":143,"context_line":"                if instance_id:"},{"line_number":144,"context_line":"                    return source_hypervisor, model.get_vm_from_id(instance_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_9aac89a0","line":141,"updated":"2016-04-28 09:17:21.000000000","message":"I cannot find the class VMNotFound in exception.py.\nYou should create this class and add a unit-test.","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"cf21006c7ab4dd43cc0eae349a1f8ffc8d1d88d3","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        if current_delta \u003e\u003d 0 and current_delta \u003c min_delta:"},{"line_number":139,"context_line":"                            min_delta \u003d current_delta"},{"line_number":140,"context_line":"                            instance_id \u003d vm_id"},{"line_number":141,"context_line":"                    except wexc.VMNotFound as e:"},{"line_number":142,"context_line":"                        LOG.error(_LE(\"VM not found Error: %s\"), e.message)"},{"line_number":143,"context_line":"                if instance_id:"},{"line_number":144,"context_line":"                    return source_hypervisor, model.get_vm_from_id(instance_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_b5d4dce8","line":141,"in_reply_to":"1a122d0e_9aac89a0","updated":"2016-04-29 08:12:50.000000000","message":"The VMNotFound was in exception.py.\nIt has been changed to InstanceNotFound recently, i will update the code.","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"cf9671a7d8049679a0e6a65a6ea8cf06792fa537","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                        period\u003dself._period,"},{"line_number":216,"context_line":"                        aggregate\u003d\u0027avg\u0027)"},{"line_number":217,"context_line":"                except Exception as e:"},{"line_number":218,"context_line":"                    LOG.error(_LE(\"can not get cpu_util: %s\"), e.message)"},{"line_number":219,"context_line":"                    continue"},{"line_number":220,"context_line":"                if cpu_util is None:"},{"line_number":221,"context_line":"                    LOG.debug(\"%s: cpu_util is None\", vm_id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"dab17558_b66444e5","line":218,"updated":"2016-05-09 21:06:44.000000000","message":"Should start with an uppercase","commit_id":"71953be799d2de65bfec396c282d58484e3e50a7"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"cf9671a7d8049679a0e6a65a6ea8cf06792fa537","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        # sort the filtered result by workload"},{"line_number":284,"context_line":"        # pick up the lowest one as dest server"},{"line_number":285,"context_line":"        if not destination_hosts:"},{"line_number":286,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":287,"context_line":"            # for instance."},{"line_number":288,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":289,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"}],"source_content_type":"text/x-python","patch_set":14,"id":"dab17558_362a147f","line":286,"updated":"2016-05-09 21:06:44.000000000","message":"This comment is unecessary","commit_id":"71953be799d2de65bfec396c282d58484e3e50a7"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"70df664a59e10ed85e9575f9cdbf43989491f857","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        # sort the filtered result by workload"},{"line_number":284,"context_line":"        # pick up the lowest one as dest server"},{"line_number":285,"context_line":"        if not destination_hosts:"},{"line_number":286,"context_line":"            # maybe to warn that there\u0027s no resource"},{"line_number":287,"context_line":"            # for instance."},{"line_number":288,"context_line":"            LOG.warning(_LW(\"No proper target host could be found, it might \""},{"line_number":289,"context_line":"                            \"be because of there\u0027s no enough CPU/Memory/DISK\"))"}],"source_content_type":"text/x-python","patch_set":14,"id":"bab6814e_3bc66068","line":286,"in_reply_to":"dab17558_362a147f","updated":"2016-05-26 02:02:01.000000000","message":"Done","commit_id":"71953be799d2de65bfec396c282d58484e3e50a7"}],"watcher/tests/decision_engine/strategy/strategies/faker_cluster_state.py":[{"author":{"_account_id":17898,"name":"Jinquan Ni","email":"ni.jinquan@zte.com.cn","username":"jinquanni"},"change_message_id":"05e59d851629a2456d4e8223aada85a36da01ed4","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        # number of nodes"},{"line_number":243,"context_line":"        count_node \u003d 2"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        # define ressouce ( CPU, MEM disk, ... )"},{"line_number":246,"context_line":"        mem \u003d resource.Resource(resource.ResourceType.memory)"},{"line_number":247,"context_line":"        # 2199.954 Mhz"},{"line_number":248,"context_line":"        num_cores \u003d resource.Resource(resource.ResourceType.cpu_cores)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_934c92c9","line":245,"range":{"start_line":245,"start_character":17,"end_line":245,"end_character":25},"updated":"2016-03-31 12:30:35.000000000","message":"resource","commit_id":"9c9db80faf5ca43f8f704c1dced6046ab51a5708"}],"watcher/tests/decision_engine/strategy/strategies/faker_metrics_collector.py":[{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"cf9671a7d8049679a0e6a65a6ea8cf06792fa537","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            result \u003d self.get_average_outlet_temperature(resource_id)"},{"line_number":39,"context_line":"        return result"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def mock_get_statistics2(self, resource_id, meter_name, period,"},{"line_number":42,"context_line":"                             aggregate\u003d\u0027avg\u0027):"},{"line_number":43,"context_line":"        result \u003d 0"},{"line_number":44,"context_line":"        if meter_name \u003d\u003d \"cpu_util\":"}],"source_content_type":"text/x-python","patch_set":14,"id":"dab17558_1c572fcf","line":41,"updated":"2016-05-09 21:06:44.000000000","message":"Method name should be different. i.e. mock_get_statistics_v2 or mock_get_statistics_wb or mock_get_stat_workload_balance","commit_id":"71953be799d2de65bfec396c282d58484e3e50a7"},{"author":{"_account_id":20676,"name":"daniel.pawlik","display_name":"Daniel Pawlik","email":"dpawlik@redhat.com","username":"daniel.pawlik"},"change_message_id":"cf9671a7d8049679a0e6a65a6ea8cf06792fa537","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        return float(mock[str(uuid)])"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def get_average_usage_vm_cpu2(self, uuid):"},{"line_number":93,"context_line":"        \"\"\"The last VM CPU usage values to average"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"            :param uuid:00"}],"source_content_type":"text/x-python","patch_set":14,"id":"dab17558_9cacbfa1","line":92,"updated":"2016-05-09 21:06:44.000000000","message":"Ditto","commit_id":"71953be799d2de65bfec396c282d58484e3e50a7"}],"watcher/tests/decision_engine/strategy/strategies/test_workload_balance.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9f98c79bd90cfc6218adf958c367303d92e1e092","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from watcher.decision_engine.model import model_root"},{"line_number":25,"context_line":"from watcher.decision_engine.model import resource"},{"line_number":26,"context_line":"from watcher.decision_engine.strategy.strategies.workload_balance \\"},{"line_number":27,"context_line":"    import WorkloadBalance"},{"line_number":28,"context_line":"from watcher.tests import base"},{"line_number":29,"context_line":"from watcher.tests.decision_engine.strategy.strategies \\"},{"line_number":30,"context_line":"    import faker_cluster_state"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af94dfe_beb7ba38","line":27,"range":{"start_line":27,"start_character":4,"end_line":27,"end_character":26},"updated":"2016-03-18 10:51:29.000000000","message":"nit: can you import the module and not the class itself please?","commit_id":"8c4ec8aa1b06470bea6b7243eb6aaa4b6abe0f01"},{"author":{"_account_id":16495,"name":"Jean-Emile DARTOIS","email":"jean-emile.dartois@b-com.com","username":"JeD"},"change_message_id":"7ed8f220f5ee81b63367e077ef056209d4be8ede","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    import faker_cluster_state"},{"line_number":30,"context_line":"from watcher.tests.decision_engine.strategy.strategies \\"},{"line_number":31,"context_line":"    import faker_metrics_collector"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class TestWorkloadBalance(base.BaseTestCase):"},{"line_number":35,"context_line":"    # fake metrics"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_fafadd73","line":32,"updated":"2016-04-28 09:17:21.000000000","message":"You should add a test for \"VMNotFound\"","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"},{"author":{"_account_id":19573,"name":"junjie.huang","email":"junjie.huang@intel.com","username":"junjiehuang"},"change_message_id":"cf21006c7ab4dd43cc0eae349a1f8ffc8d1d88d3","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    import faker_cluster_state"},{"line_number":30,"context_line":"from watcher.tests.decision_engine.strategy.strategies \\"},{"line_number":31,"context_line":"    import faker_metrics_collector"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class TestWorkloadBalance(base.BaseTestCase):"},{"line_number":35,"context_line":"    # fake metrics"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a122d0e_09f3f973","line":32,"in_reply_to":"1a122d0e_fafadd73","updated":"2016-04-29 08:12:50.000000000","message":"Done","commit_id":"ffa4fde5e6297482d4751217f124438c7e6302fb"}]}
