)]}'
{"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3278,"context_line":"            rc_id for rc_id in requested_resources"},{"line_number":3279,"context_line":"            if _RC_CACHE.string_from_id(rc_id) in ns_resource_class_names"},{"line_number":3280,"context_line":"        )"},{"line_number":3281,"context_line":"        shared_resources \u003d set(requested_resources) - ns_resources"},{"line_number":3282,"context_line":""},{"line_number":3283,"context_line":"        # We need to figure out which traits are NOT provided by the \"local\""},{"line_number":3284,"context_line":"        # provider and that would need to be provided by the sharing"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_46fe0e06","side":"PARENT","line":3281,"range":{"start_line":3281,"start_character":8,"end_line":3281,"end_character":24},"updated":"2018-03-20 01:25:30.000000000","message":"Note that in the test case that @jaypipes has pointed out, this would be an empty set.","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3310,"context_line":"                                                   ns_rp_uuid)"},{"line_number":3311,"context_line":"            alloc_requests.append(req)"},{"line_number":3312,"context_line":"            continue"},{"line_number":3313,"context_line":""},{"line_number":3314,"context_line":"        has_none \u003d len(ns_resources) \u003d\u003d 0"},{"line_number":3315,"context_line":"        if has_none:"},{"line_number":3316,"context_line":"            # This resource provider doesn\u0027t actually provide any requested"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_265bda2e","side":"PARENT","line":3313,"updated":"2018-03-20 01:25:30.000000000","message":"This is just a short cut. Even if we don\u0027t catch the non-sharing RP here, it will be appeared again in allocation candidates, because...","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3323,"context_line":"        # non-sharing provider AND shared resources from each sharing"},{"line_number":3324,"context_line":"        # provider of that resource class. This is where we construct all the"},{"line_number":3325,"context_line":"        # possible permutations of non-shared resources and shared resources."},{"line_number":3326,"context_line":"        ns_res_requests \u003d ["},{"line_number":3327,"context_line":"            AllocationRequestResource("},{"line_number":3328,"context_line":"                ctx, resource_provider\u003dResourceProvider(ctx, uuid\u003dns_rp_uuid),"},{"line_number":3329,"context_line":"                resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":3330,"context_line":"                amount\u003damount,"},{"line_number":3331,"context_line":"            ) for rc_id, amount in requested_resources.items()"},{"line_number":3332,"context_line":"            if rc_id in ns_resources"},{"line_number":3333,"context_line":"        ]"},{"line_number":3334,"context_line":""},{"line_number":3335,"context_line":"        # Build a dict, keyed by resource class ID, of lists of"},{"line_number":3336,"context_line":"        # AllocationRequestResource objects that represent each"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_c302103f","side":"PARENT","line":3333,"range":{"start_line":3326,"start_character":0,"end_line":3333,"end_character":9},"updated":"2018-03-20 01:25:30.000000000","message":"...because It will be put into here, and ....","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3341,"context_line":""},{"line_number":3342,"context_line":"        # A list of lists of AllocationRequestResource objects for each type of"},{"line_number":3343,"context_line":"        # shared resource class"},{"line_number":3344,"context_line":"        shared_request_groups \u003d ["},{"line_number":3345,"context_line":"            sharing_resource_requests[shared_rc_id]"},{"line_number":3346,"context_line":"            for shared_rc_id in shared_resources"},{"line_number":3347,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_066fb6c5","side":"PARENT","line":3344,"range":{"start_line":3344,"start_character":8,"end_line":3344,"end_character":29},"updated":"2018-03-20 01:25:30.000000000","message":"... and in the test case this would be an empty list, because \"share_resources\" is an empty set, and ...","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3345,"context_line":"            sharing_resource_requests[shared_rc_id]"},{"line_number":3346,"context_line":"            for shared_rc_id in shared_resources"},{"line_number":3347,"context_line":"        ]"},{"line_number":3348,"context_line":"        for shared_res_requests in itertools.product(*shared_request_groups):"},{"line_number":3349,"context_line":"            # Before we add the allocation request to our list, we first need"},{"line_number":3350,"context_line":"            # to ensure that the sharing providers involved in this allocation"},{"line_number":3351,"context_line":"            # request have all of the traits that the non-sharing providers"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_46360eb7","side":"PARENT","line":3348,"range":{"start_line":3348,"start_character":8,"end_line":3348,"end_character":77},"updated":"2018-03-20 01:25:30.000000000","message":"... and in the test case this iteration would be *processed* once with an empty tuple of shared_res_requests, and...","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"d70eb48db85b269b6a7d113586cc080af2ee72c3","unresolved":false,"context_lines":[{"line_number":3379,"context_line":"                continue"},{"line_number":3380,"context_line":""},{"line_number":3381,"context_line":"            alloc_prov_ids.append(prov_ids)"},{"line_number":3382,"context_line":"            resource_requests \u003d ns_res_requests + list(shared_res_requests)"},{"line_number":3383,"context_line":"            req \u003d AllocationRequest(ctx, resource_requests\u003dresource_requests)"},{"line_number":3384,"context_line":"            alloc_requests.append(req)"},{"line_number":3385,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_2613da0f","side":"PARENT","line":3382,"range":{"start_line":3382,"start_character":12,"end_line":3382,"end_character":29},"updated":"2018-03-20 01:25:30.000000000","message":"...and finally we get the same thing as ns_res_requests because shared_res_requests is empty.","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a9f1fcbde34dbccc4db2d77dbc4d8bf08e6818af","unresolved":false,"context_lines":[{"line_number":3379,"context_line":"                continue"},{"line_number":3380,"context_line":""},{"line_number":3381,"context_line":"            alloc_prov_ids.append(prov_ids)"},{"line_number":3382,"context_line":"            resource_requests \u003d ns_res_requests + list(shared_res_requests)"},{"line_number":3383,"context_line":"            req \u003d AllocationRequest(ctx, resource_requests\u003dresource_requests)"},{"line_number":3384,"context_line":"            alloc_requests.append(req)"},{"line_number":3385,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_6b6ab4b3","side":"PARENT","line":3382,"range":{"start_line":3382,"start_character":12,"end_line":3382,"end_character":29},"in_reply_to":"df7087c5_2613da0f","updated":"2018-03-28 15:16:00.000000000","message":"ack, yes, good detective work Tetsuro. Your analysis is absolutely correct.","commit_id":"9e328b7bb40fb3552d269a70fb03d375f21abe7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ab403c8310ee34ae77626cf5c478de571476ebef","unresolved":false,"context_lines":[{"line_number":3330,"context_line":"        # Determine if the non-sharing provider actually has all the"},{"line_number":3331,"context_line":"        # resources requested. If not, we need to add an AllocationRequest"},{"line_number":3332,"context_line":"        # alternative containing this resource for each sharing provider."},{"line_number":3333,"context_line":"        # NOTE(jaypipes): If a provider has inventory for a resource class and"},{"line_number":3334,"context_line":"        # ALSO has that resource class shared with it, we currently ALWAYS take"},{"line_number":3335,"context_line":"        # the non-shared inventory."},{"line_number":3336,"context_line":"        # See: https://bugs.launchpad.net/nova/+bug/1724613"},{"line_number":3337,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":3338,"context_line":"        if has_all:"},{"line_number":3339,"context_line":"            # If this resource provider has all the requested resources, then"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_96b856e5","side":"PARENT","line":3336,"range":{"start_line":3333,"start_character":8,"end_line":3336,"end_character":59},"updated":"2018-03-30 15:06:23.000000000","message":"OK so clearly this will be a behavior change in GET /allocation_candidates now, although we don\u0027t claim to yet support shared resource pools so I guess maybe it\u0027s OK to make the change now as we\u0027re building up to eventually supporting shared resource pools.\n\nThe thing about all of this is what the compute nodes do, i.e. the resource tracker in the compute service has no concept of sharing providers or that the instances running on it might be consuming resources, like DISK_GB, from a shared aggregate provider. That\u0027s what has caused a lot of the pain in the past with shared resource providers, although that might have also been before Pike where computes would overwrite the allocations created in the scheduler. Once computes are upgraded to be new enough in a cell, they shouldn\u0027t be overwriting allocations.","commit_id":"ac51b5beda7c56612eda47ca6c9977fac1ff0f92"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ed3f4fda4207dd33162b25e3eb76327832f021a","unresolved":false,"context_lines":[{"line_number":3330,"context_line":"        # Determine if the non-sharing provider actually has all the"},{"line_number":3331,"context_line":"        # resources requested. If not, we need to add an AllocationRequest"},{"line_number":3332,"context_line":"        # alternative containing this resource for each sharing provider."},{"line_number":3333,"context_line":"        # NOTE(jaypipes): If a provider has inventory for a resource class and"},{"line_number":3334,"context_line":"        # ALSO has that resource class shared with it, we currently ALWAYS take"},{"line_number":3335,"context_line":"        # the non-shared inventory."},{"line_number":3336,"context_line":"        # See: https://bugs.launchpad.net/nova/+bug/1724613"},{"line_number":3337,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":3338,"context_line":"        if has_all:"},{"line_number":3339,"context_line":"            # If this resource provider has all the requested resources, then"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_36406aa5","side":"PARENT","line":3336,"range":{"start_line":3333,"start_character":8,"end_line":3336,"end_character":59},"in_reply_to":"bf659307_96b856e5","updated":"2018-03-30 15:19:24.000000000","message":"So, this particular short-circuit being removed here is actually redundant due to the detective work that Tetsuro did on a previous revision. See his notes here:\n\nhttps://review.openstack.org/#/c/553122/1/nova/api/openstack/placement/objects/resource_provider.py\n\nThe issue with the compute node\u0027s resource tracker not properly understanding whether an allocation for DISK_GB is to be consumed from the local compute node or the shared storage pool is indeed an issue. However, it\u0027s tangential to whether the response from GET /allocation_candidates can even handle situations where *both* a compute node and a shared storage pool have DISK_GB.\n\nBefore the next patch in this series, if a compute node has local disk and it is also associated with a shared storage pool via aggregate, GET /allocation_candidates will *only* return the local compute node as providing DISK_GB in the allocation requests part of the response.\n\nIt is this particular bug (of not reporting the shared storage provider in the allocation requests) that this and the next patch address.\n\nWe still need to fix the compute node resource tracker\u0027s \"understanding\" of where DISK_GB resources are actually being consumed from, but the first step is to actually allow allocation from a shared storage pool when both the local compute and a shared storage provider have DISK_GB inventory.","commit_id":"ac51b5beda7c56612eda47ca6c9977fac1ff0f92"}]}
