)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d0ab6b05cd1af9b479754eda8e4cf15329c339bc","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Choose VMware datastore by the least provisioned space"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"At the moment the _select_datastore method in the VMware driver chooses"},{"line_number":10,"context_line":"the in dependence of the free space. The datastore with the most free"},{"line_number":11,"context_line":"space will be chosen for a new instance. But some users may want to"},{"line_number":12,"context_line":"place new instances on the datastore with the less provisioned space or"},{"line_number":13,"context_line":"most connected hosts."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a71b18c_93be1d63","line":10,"updated":"2016-12-07 11:23:51.000000000","message":"nit: extra \"the\" in the beginning","commit_id":"63cba5af87f1f8d19b3d9e4315b5d32dcb354c22"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"573f6cba6ff6e5d87fb9053e0857451fc8c79404","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Choose VMware datastore by the least provisioned space"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"At the moment the _select_datastore method in the VMware driver chooses"},{"line_number":10,"context_line":"in dependence of the free space. The datastore with the most free"},{"line_number":11,"context_line":"space will be chosen for a new instance. But some users may want to"},{"line_number":12,"context_line":"place new instances on the datastore with the less provisioned space or"},{"line_number":13,"context_line":"most connected hosts."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"7f515b1d_13488c2a","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":20},"updated":"2017-10-02 18:58:20.000000000","message":"depending on","commit_id":"b9d273eeebd5b44f3fd1960e76e9691903080a81"}],"nova/conf/vmware.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f9c6fb431e524d71b2f815527fc62a586c11e3dd","unresolved":false,"context_lines":[{"line_number":284,"context_line":"datastore_allocation_opts \u003d ["},{"line_number":285,"context_line":"    cfg.StrOpt(\u0027datastore_allocation_type\u0027,"},{"line_number":286,"context_line":"               default\u003d\u0027freeSpace\u0027,"},{"line_number":287,"context_line":"               help\u003d\"\"\""},{"line_number":288,"context_line":"This option specifies how to select best datastore for a new instance."},{"line_number":289,"context_line":"When datastore_allocation_type is set to \u0027provisionedSpace\u0027, the datastore"},{"line_number":290,"context_line":"with the lowest value for provisionedSpace will be chosen. If set to"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_a6c88b23","line":287,"updated":"2016-11-28 08:40:49.000000000","message":"you should have choices\u003d(\u0027freeSpace\u0027, \u0027provisionedSpace\u0027)","commit_id":"cb80230bb48f4498269a4ba226d4d4cadb10410e"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d0ab6b05cd1af9b479754eda8e4cf15329c339bc","unresolved":false,"context_lines":[{"line_number":284,"context_line":"datastore_allocation_opts \u003d ["},{"line_number":285,"context_line":"    cfg.StrOpt(\u0027datastore_allocation_type\u0027,"},{"line_number":286,"context_line":"               default\u003d\u0027freeSpace\u0027,"},{"line_number":287,"context_line":"               choices\u003d(\u0027freeSpace\u0027, \u0027provisionedSpace\u0027, \u0027mostConnectedHosts\u0027),"},{"line_number":288,"context_line":"               help\u003d\"\"\""},{"line_number":289,"context_line":"This option specifies how to select best datastore for a new instance."},{"line_number":290,"context_line":"When datastore_allocation_type is set to \u0027provisionedSpace\u0027, the datastore"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_337549ca","line":287,"updated":"2016-12-07 11:23:51.000000000","message":"consider changing to \u0027mostFreeSpace\u0027, \u0027leastProvisionedSpace\u0027, \u0027mostConnectedHosts\u0027","commit_id":"63cba5af87f1f8d19b3d9e4315b5d32dcb354c22"}],"nova/tests/unit/virt/vmwareapi/fake.py":[{"author":{"_account_id":23913,"name":"David Rabel","email":"rabel@b1-systems.de","username":"rabel"},"change_message_id":"7e90fa3214637361fdff00731b24f28f5c82e850","unresolved":false,"context_lines":[{"line_number":674,"context_line":"    \"\"\"Datastore class.\"\"\""},{"line_number":675,"context_line":""},{"line_number":676,"context_line":"    def __init__(self, name\u003d\"fake-ds\", capacity\u003d1024, free\u003d500,"},{"line_number":677,"context_line":"                 uncommitted\u003d0, accessible\u003dTrue, maintenance_mode\u003d\"normal\"):"},{"line_number":678,"context_line":"        super(Datastore, self).__init__(\"ds\")"},{"line_number":679,"context_line":"        self.set(\"summary.type\", \"VMFS\")"},{"line_number":680,"context_line":"        self.set(\"summary.name\", name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f2577a7_ab856eaf","line":677,"range":{"start_line":677,"start_character":17,"end_line":677,"end_character":31},"updated":"2017-09-12 08:50:47.000000000","message":"Nit: Shouldn\u0027t new parameters always be added at the end of the parameters? No problem here though, since Datastore() is not called with unnamed parameters.","commit_id":"9739f0c25b14fab97c4eb934526b3311f98e6f68"}],"nova/tests/unit/virt/vmwareapi/test_ds_util_datastore_selection.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8b3616d3c74153cc84fa74560ef8680d6622744b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import collections"},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":"import re"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_utils import units"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_f6598c5b","line":15,"updated":"2016-12-25 11:45:53.000000000","message":"mock is third party and should be in the section below","commit_id":"219d4647c17fecd1c5f6a92c7655c33aa70f08cc"}],"nova/virt/vmwareapi/ds_util.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f9c6fb431e524d71b2f815527fc62a586c11e3dd","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                    ref\u003dobj_content.obj,"},{"line_number":63,"context_line":"                    name\u003dpropdict[\u0027summary.name\u0027],"},{"line_number":64,"context_line":"                    capacity\u003dpropdict[\u0027summary.capacity\u0027],"},{"line_number":65,"context_line":"                    freespace\u003dpropdict[\u0027summary.freeSpace\u0027])"},{"line_number":66,"context_line":"            # favor datastores with more free space"},{"line_number":67,"context_line":"            if (best_match is None or"},{"line_number":68,"context_line":"                new_ds.freespace \u003e best_match.freespace):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_86f70f58","line":65,"updated":"2016-11-28 08:40:49.000000000","message":"why not fill in the uncommitted here?","commit_id":"cb80230bb48f4498269a4ba226d4d4cadb10410e"},{"author":{"_account_id":21479,"name":"int32bit","email":"krystism@gmail.com","username":"int32bit"},"change_message_id":"4bafebc7405222530d9f362e6e362425bc71c488","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                    ref\u003dobj_content.obj,"},{"line_number":63,"context_line":"                    name\u003dpropdict[\u0027summary.name\u0027],"},{"line_number":64,"context_line":"                    capacity\u003dpropdict[\u0027summary.capacity\u0027],"},{"line_number":65,"context_line":"                    freespace\u003dpropdict[\u0027summary.freeSpace\u0027])"},{"line_number":66,"context_line":"            # favor datastores with more free space"},{"line_number":67,"context_line":"            if (best_match is None or"},{"line_number":68,"context_line":"                new_ds.freespace \u003e best_match.freespace):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_21e9c5e6","line":65,"in_reply_to":"5a74a57a_86f70f58","updated":"2016-11-28 15:22:16.000000000","message":"Because I think we don\u0027t need it here.","commit_id":"cb80230bb48f4498269a4ba226d4d4cadb10410e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f9c6fb431e524d71b2f815527fc62a586c11e3dd","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        return _select_by_most_free_space(matching_ds, best_match,"},{"line_number":140,"context_line":"                                           datastore_regex, allowed_ds_types)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    raise exception.UnsupportedDatastoreAllocationTypeException("},{"line_number":143,"context_line":"        allocation_type \u003d allocation_type)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_a6bdeb69","line":142,"updated":"2016-11-28 08:40:49.000000000","message":"no need for this if you use choices","commit_id":"cb80230bb48f4498269a4ba226d4d4cadb10410e"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"98a74a699583d34538433030bdb039727326424d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                               datastore_regex, allowed_ds_types,"},{"line_number":53,"context_line":"                               min_free_space):"},{"line_number":54,"context_line":"    # data_stores is actually a RetrieveResult object from vSphere API call"},{"line_number":55,"context_line":"    for obj_content in data_stores.objects:"},{"line_number":56,"context_line":"        # the propset attribute \"need not be set\" by returning API"},{"line_number":57,"context_line":"        if not hasattr(obj_content, \u0027propSet\u0027):"},{"line_number":58,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_96c098e2","line":55,"updated":"2016-11-30 14:44:03.000000000","message":"there is a lot of code duplication between those 3 functions: iterating over the result set, checking if valid and creating a new datastore object; is it possible to keep the common stuff in _select_datastore() and just use different comparing function?","commit_id":"1d3eacc1892c32a23b283ad6712dacfb09c06bd7"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"98a74a699583d34538433030bdb039727326424d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                     - best_match.freespace"},{"line_number":85,"context_line":"                                     - best_match.uncommitted)"},{"line_number":86,"context_line":"    else:"},{"line_number":87,"context_line":"        current_provisioned_space \u003d 0"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    # data_stores is actually a RetrieveResult object from vSphere API call"},{"line_number":90,"context_line":"    for obj_content in data_stores.objects:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_c140880a","line":87,"updated":"2016-11-30 14:44:03.000000000","message":"initializing this with 0 is confusing; either use maxint or remove the \u0027else\u0027 clause","commit_id":"1d3eacc1892c32a23b283ad6712dacfb09c06bd7"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d0ab6b05cd1af9b479754eda8e4cf15329c339bc","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        return provisioned_space_2 - provisioned_space_1"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def _compare_by_connected_hosts(session, ds_1, ds_2, reverse\u003dFalse):"},{"line_number":67,"context_line":"    connected_hosts_count_1 \u003d len(get_connected_hosts(session, ds_1))"},{"line_number":68,"context_line":"    connected_hosts_count_2 \u003d len(get_connected_hosts(session, ds_2))"},{"line_number":69,"context_line":"    if connected_hosts_count_1 \u003d\u003d connected_hosts_count_2:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_f336714f","line":66,"updated":"2016-12-07 11:23:51.000000000","message":"what is \u0027reverse\u0027 used for?","commit_id":"63cba5af87f1f8d19b3d9e4315b5d32dcb354c22"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"5288621991505ded59b8acc63232fa5b1dae180c","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def _compare_by_connected_hosts(session, ds_1, ds_2):"},{"line_number":67,"context_line":"    connected_hosts_count_1 \u003d len(get_connected_hosts(session, ds_1))"},{"line_number":68,"context_line":"    connected_hosts_count_2 \u003d len(get_connected_hosts(session, ds_2))"},{"line_number":69,"context_line":"    if connected_hosts_count_1 \u003d\u003d connected_hosts_count_2:"},{"line_number":70,"context_line":"        return _compare_by_free_space(session, ds_1, ds_2)"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_0a7d9a1b","line":67,"updated":"2017-12-01 18:55:33.000000000","message":"get_connected_hosts doesn\u0027t filter out unusable hosts (for e.g. those in maintenance mode)/mount points. So merely using the number of connected hosts may not be appropriate.\n\nSee the oslo.vmware implementation  for more details:\n\nhttps://github.com/openstack/oslo.vmware/blob/stable/ocata/oslo_vmware/objects/datastore.py#L127","commit_id":"c583f2412a0739f5df730df8c403f9829b928e33"}]}
