)]}'
{"doc/source/block_device_mapping.rst":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5a844b8a932e8b67e20d9737edef6140fcd172d1","unresolved":false,"context_lines":[{"line_number":239,"context_line":"Can be replaced by creating a standard flavor, and adding the extra-specs key:"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"`nova flavor-key \u003cflavor-id\u003e set is_bdm_flavor\u003dTrue`"},{"line_number":242,"context_line":"`nova boot --flavor \u003cflavor-id\u003e --image \u003cimage-id\u003e foo`"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa31d9ce_e1ee488a","line":242,"updated":"2017-02-11 18:19:52.000000000","message":"Hmm, doesn\u0027t the image or the flavor also need to have things like source\u003dimage and dest\u003dvolume set on it too?","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"75d032d1d2ca996b2c5bab36ddba71709ab39d1a","unresolved":false,"context_lines":[{"line_number":239,"context_line":"Can be replaced by creating a standard flavor, and adding the extra-specs key:"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"`nova flavor-key \u003cflavor-id\u003e set is_bdm_flavor\u003dTrue`"},{"line_number":242,"context_line":"`nova boot --flavor \u003cflavor-id\u003e --image \u003cimage-id\u003e foo`"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa31d9ce_a73540db","line":242,"in_reply_to":"fa31d9ce_8cd783be","updated":"2017-02-11 19:22:24.000000000","message":"Yes, but I\u0027m perfectly content with NOT allowing it to over-ridden if that\u0027s honestly the sticking point here.  Provide that single pre-defined BDM directly from the block_device dict that Nova is already maintaining and setting up and that concern pretty much \"goes away\" in my opinion.\n\nKeep in mind though I am verifying that the keys are valid BDM keys, if they\u0027re not I ignore them completely.","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eefd885aac0e090db2ad4783d2814bb729aeb5c7","unresolved":false,"context_lines":[{"line_number":239,"context_line":"Can be replaced by creating a standard flavor, and adding the extra-specs key:"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"`nova flavor-key \u003cflavor-id\u003e set is_bdm_flavor\u003dTrue`"},{"line_number":242,"context_line":"`nova boot --flavor \u003cflavor-id\u003e --image \u003cimage-id\u003e foo`"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa31d9ce_8cd783be","line":242,"in_reply_to":"fa31d9ce_ac4a87c3","updated":"2017-02-11 18:33:54.000000000","message":"Oh I see, but also overridden if you change it to something else I guess.","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3253ccaa636eb7b2a23422467dfad03dbbf17830","unresolved":false,"context_lines":[{"line_number":239,"context_line":"Can be replaced by creating a standard flavor, and adding the extra-specs key:"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"`nova flavor-key \u003cflavor-id\u003e set is_bdm_flavor\u003dTrue`"},{"line_number":242,"context_line":"`nova boot --flavor \u003cflavor-id\u003e --image \u003cimage-id\u003e foo`"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa31d9ce_ac4a87c3","line":242,"in_reply_to":"fa31d9ce_e1ee488a","updated":"2017-02-11 18:27:00.000000000","message":"No that happens here:\n\nhttps://review.openstack.org/#/c/432503/2/nova/block_device.py@280\n\nand here:\n\nhttps://review.openstack.org/#/c/432503/2/nova/compute/api.py@1176","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"}],"nova/block_device.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5a844b8a932e8b67e20d9737edef6140fcd172d1","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    for key, val in six.iteritems(kwargs):"},{"line_number":267,"context_line":"        if key in bdm_new_fields:"},{"line_number":268,"context_line":"            LOG.debug(\"Setting bdm %s to %s\", key, val)"},{"line_number":269,"context_line":"            bdm[key] \u003d val"},{"line_number":270,"context_line":"    return bdm"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_815aec4e","line":269,"updated":"2017-02-11 18:19:52.000000000","message":"Doesn\u0027t this end up with un-namespaced extra_specs having to be put on the image or the flavor? If I already use a (poorly-named) extra spec for my own scheduling stuff, it will now conflict with the BDM one.\n\nIf we were to do this, I think we *have* to have some namespacing.\n\nAlso, BDMv2 has plenty of issues and is almost universally hated. What happens when we have BDMv3? We\u0027ve got images and flavors with bits of the public API buried in them that we now have to try to support.\n\nI too am concerned with the lack of validation here. I guess that could be plumbed through the existing API code, but...","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"75d032d1d2ca996b2c5bab36ddba71709ab39d1a","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    for key, val in six.iteritems(kwargs):"},{"line_number":267,"context_line":"        if key in bdm_new_fields:"},{"line_number":268,"context_line":"            LOG.debug(\"Setting bdm %s to %s\", key, val)"},{"line_number":269,"context_line":"            bdm[key] \u003d val"},{"line_number":270,"context_line":"    return bdm"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_8764bce5","line":269,"in_reply_to":"fa31d9ce_4c102ba9","updated":"2017-02-11 19:22:24.000000000","message":"Maybe I\u0027m screwing up here; my intent is that by saying \"if key in bdm_new_fields\" I\u0027m doing exactly that (white-listing) but I\u0027m not introducing any new code or lists to maintain, I\u0027m using the dict that Nova already has, uses and maintains.  It\u0027s net-zero, but yes it\u0027s only keys; so maybe your concerns are values, or maybe something else that I\u0027m not quite following?","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"75d032d1d2ca996b2c5bab36ddba71709ab39d1a","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    for key, val in six.iteritems(kwargs):"},{"line_number":267,"context_line":"        if key in bdm_new_fields:"},{"line_number":268,"context_line":"            LOG.debug(\"Setting bdm %s to %s\", key, val)"},{"line_number":269,"context_line":"            bdm[key] \u003d val"},{"line_number":270,"context_line":"    return bdm"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_a74c6071","line":269,"in_reply_to":"fa31d9ce_815aec4e","updated":"2017-02-11 19:22:24.000000000","message":"Not sure; the intent here is that if there\u0027s some extra-specs key that does not coorespond to a valid BDM key as per the bdm_new_fields provided already (and used for checking in other places) then I\u0027m ignoring it and not doing anything with it.\n\nI think I might be missing a subtlety here that you\u0027re much more familiar with than I am.  I fully admit there\u0027s a lack of validation of the values; I\u0027m happy to add something to deal with that (re-use existing validation checks of course, NOT introduce new code to maintain).","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3253ccaa636eb7b2a23422467dfad03dbbf17830","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    for key, val in six.iteritems(kwargs):"},{"line_number":267,"context_line":"        if key in bdm_new_fields:"},{"line_number":268,"context_line":"            LOG.debug(\"Setting bdm %s to %s\", key, val)"},{"line_number":269,"context_line":"            bdm[key] \u003d val"},{"line_number":270,"context_line":"    return bdm"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_4c102ba9","line":269,"in_reply_to":"fa31d9ce_815aec4e","updated":"2017-02-11 18:27:00.000000000","message":"Yeah I thought about this too. You\u0027d have to basically whitelist the valid BDM keys I think (which might already be in here somewhere with all of the legacy bdm conversion code) and then filter anything else in extra_specs from being set on the BDM object. The nova.objects.BlockDeviceMapping object itself won\u0027t care about extra attributes, but the bdmv2 schema will since it doesn\u0027t allow additionalProperties:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/block_device_mapping_v1.py#L41\n\nSo validation of that stuff would get a bit tricky. Not impossible though.","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"47904e844f204adabf360030b1b4d463e7a709a7","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    for key, val in six.iteritems(kwargs):"},{"line_number":267,"context_line":"        if key in bdm_new_fields:"},{"line_number":268,"context_line":"            LOG.debug(\"Setting bdm %s to %s\", key, val)"},{"line_number":269,"context_line":"            bdm[key] \u003d val"},{"line_number":270,"context_line":"    return bdm"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_fc2c2e4c","line":269,"in_reply_to":"fa31d9ce_a74c6071","updated":"2017-02-12 01:54:34.000000000","message":"I missed the \"if key in bdm_new_fields\" part, that is the whitelist on keys, yeah. The part that\u0027s missing is the value validation, which we get with the json request schema validation in the REST API handlers.","commit_id":"c84820406240d223a033e6e9c86fe41cfc9235c6"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97c310cd5dd45a966535b4bd7dd14a8a107755d2","unresolved":false,"context_lines":[{"line_number":684,"context_line":"        image_properties \u003d image_meta.get(\u0027properties\u0027, {})"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        # Get the block device mappings defined by the image."},{"line_number":687,"context_line":"        image_defined_bdms \u003d image_properties.get(\u0027block_device_mapping\u0027, [])"},{"line_number":688,"context_line":"        legacy_image_defined \u003d not image_properties.get(\u0027bdm_v2\u0027, False)"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        image_mapping \u003d image_properties.get(\u0027mappings\u0027, [])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_14c54e8d","line":687,"updated":"2017-02-13 00:56:57.000000000","message":"This is something else I got thinking about. We can define BDMs via the image metadata. Like, I believe we have a test in Tempest which creates volume-backed server, takes a snapshot of that server, and then creates a 2nd server from the image snapshot. The image snapshot has BDM info about the volume snapshot so that when we create the 2nd server from the image snapshot, it actually creates a new volume because of the source_type\u003dsnapshot / destination_type\u003dvolume in the image metadata BDM properties.\n\nSo it seems another way to do what you want with existing code is to just have your images defined with an ephemeral image BDM in it already. The tricky parts with that are (1) no overrides like you\u0027re trying to do here and (2) if you allow snapshot by your users, and those snapshots aren\u0027t from volume-backed instances, then the image snapshot won\u0027t have a snapshot BDM in them.","commit_id":"b5486816f3f16c7326b6a69cc9dd2d6c7e02ae3d"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"9ea15b85079c792d1021f49f06d9c3a38a1dd355","unresolved":false,"context_lines":[{"line_number":684,"context_line":"        image_properties \u003d image_meta.get(\u0027properties\u0027, {})"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        # Get the block device mappings defined by the image."},{"line_number":687,"context_line":"        image_defined_bdms \u003d image_properties.get(\u0027block_device_mapping\u0027, [])"},{"line_number":688,"context_line":"        legacy_image_defined \u003d not image_properties.get(\u0027bdm_v2\u0027, False)"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        image_mapping \u003d image_properties.get(\u0027mappings\u0027, [])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_94cd8cb9","line":687,"in_reply_to":"fa31d9ce_14c54e8d","updated":"2017-02-13 22:52:18.000000000","message":"Seems like that might end up being more of a pain from a usability perspective, especially without the override behavior, compared to just specifying the BDM as part of the creation call for the instance.\n\nIMO even if we do support that route we still probably would end up wanting flavors that default to using volumes too.","commit_id":"b5486816f3f16c7326b6a69cc9dd2d6c7e02ae3d"}],"nova/conf/compute.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2ed81e730f78af237493dc18b102919b6b65bc8","unresolved":false,"context_lines":[{"line_number":1090,"context_line":""},{"line_number":1091,"context_line":"* not to be confused with: ``multi_instance_display_name_template``"},{"line_number":1092,"context_line":"\"\"\"),"},{"line_number":1093,"context_line":"    cfg.BoolOpt(\u0027allow_bdm_flavors\u0027,"},{"line_number":1094,"context_line":"                default\u003dFalse,"},{"line_number":1095,"context_line":"                help\u003d\"\"\""},{"line_number":1096,"context_line":"Allow BDM information to be obtained from Flavor extra-specs."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_dcba0a0a","line":1093,"updated":"2017-02-12 01:55:25.000000000","message":"We\u0027d really not do this since it\u0027s config-driven API behavior, which we want to avoid more of since there are all sorts of API behavior wrinkles from years past with stuff like this in Nova. So if we did the thing, it\u0027d always be available as long as you had the code (unless we also microversioned it).","commit_id":"b5486816f3f16c7326b6a69cc9dd2d6c7e02ae3d"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d02fe965e33bfca62c227be2e52ea2fe985f621f","unresolved":false,"context_lines":[{"line_number":1090,"context_line":""},{"line_number":1091,"context_line":"* not to be confused with: ``multi_instance_display_name_template``"},{"line_number":1092,"context_line":"\"\"\"),"},{"line_number":1093,"context_line":"    cfg.BoolOpt(\u0027allow_bdm_flavors\u0027,"},{"line_number":1094,"context_line":"                default\u003dFalse,"},{"line_number":1095,"context_line":"                help\u003d\"\"\""},{"line_number":1096,"context_line":"Allow BDM information to be obtained from Flavor extra-specs."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_41015f69","line":1093,"in_reply_to":"fa31d9ce_dcba0a0a","updated":"2017-02-14 21:57:56.000000000","message":"Sure, I added this as a response to your concern that it was only controlled by policy; so the other mechanism is config (which I don\u0027t personally like either), but just responding to your concern.","commit_id":"b5486816f3f16c7326b6a69cc9dd2d6c7e02ae3d"}]}
