)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     rsritesh \u003crsritesh@rediff.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-04-19 15:56:12 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add image flatten when unshelve rbd image backend"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When using the rbd image backend, snapshots used"},{"line_number":10,"context_line":"to shelve an instance cannot be deleted."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_8c92bc4a","line":7,"updated":"2017-04-25 21:43:20.000000000","message":"How about \"rbd: flatten images when unshelving\"","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     rsritesh \u003crsritesh@rediff.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-04-19 15:56:12 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add image flatten when unshelve rbd image backend"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When using the rbd image backend, snapshots used"},{"line_number":10,"context_line":"to shelve an instance cannot be deleted."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_13600032","line":7,"in_reply_to":"5ff73747_8c92bc4a","updated":"2017-04-26 09:13:26.000000000","message":"Done","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When using the rbd image backend, snapshots used"},{"line_number":10,"context_line":"to shelve an instance cannot be deleted."},{"line_number":11,"context_line":"During the unshelve the snapshot image is not"},{"line_number":12,"context_line":"deattaching from the instance image."},{"line_number":13,"context_line":"This patch flatten the image, which detaches"},{"line_number":14,"context_line":"from the instance boot image."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_6c99b06c","line":12,"updated":"2017-04-25 21:43:20.000000000","message":"Here and throughout, please use the term \"detach\", not \"deattach\".","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When using the rbd image backend, snapshots used"},{"line_number":10,"context_line":"to shelve an instance cannot be deleted."},{"line_number":11,"context_line":"During the unshelve the snapshot image is not"},{"line_number":12,"context_line":"deattaching from the instance image."},{"line_number":13,"context_line":"This patch flatten the image, which detaches"},{"line_number":14,"context_line":"from the instance boot image."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_f356b45c","line":12,"in_reply_to":"5ff73747_6c99b06c","updated":"2017-04-26 09:13:26.000000000","message":"Done","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"During the unshelve the snapshot image is not"},{"line_number":12,"context_line":"deattaching from the instance image."},{"line_number":13,"context_line":"This patch flatten the image, which detaches"},{"line_number":14,"context_line":"from the instance boot image."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: If3c9d1de3ce0fe394405bd1e1f0fa08ce2baeda8"},{"line_number":17,"context_line":"Closes-Bug: #1653953"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_4c9cb45c","line":14,"updated":"2017-04-25 21:43:20.000000000","message":"s/flatten the image, which detaches from the instance boot image/flattens the image when unshelving, allowing the image originally booted from to be detached./","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":11,"context_line":"During the unshelve the snapshot image is not"},{"line_number":12,"context_line":"deattaching from the instance image."},{"line_number":13,"context_line":"This patch flatten the image, which detaches"},{"line_number":14,"context_line":"from the instance boot image."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: If3c9d1de3ce0fe394405bd1e1f0fa08ce2baeda8"},{"line_number":17,"context_line":"Closes-Bug: #1653953"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5ff73747_d3517864","line":14,"in_reply_to":"5ff73747_4c9cb45c","updated":"2017-04-26 09:13:26.000000000","message":"Done","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d8f6f869e8cfed84596aaa200570788ea53884c7","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Vladyslav Drok \u003cvdrok@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-10-26 20:01:33 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rbd: flatten images when unshelving"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When using the rbd image backend, snapshots used"},{"line_number":10,"context_line":"to shelve an instance cannot be deleted."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"df87a7cf_5350045f","line":7,"range":{"start_line":7,"start_character":25,"end_line":7,"end_character":35},"updated":"2017-12-15 03:12:06.000000000","message":"This patch flattens images during normal instance create too, not just during unshelve.","commit_id":"1afeb2f38e9f0714678885447a1c6cc87ef1deb4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Previously attempts to remove the shelved snapshot of an unshelved"},{"line_number":10,"context_line":"instance when using the rbd backends for both Nova and Glance would"},{"line_number":11,"context_line":"fail. This was due to the instance disk being clone from and still"},{"line_number":12,"context_line":"referencing the shelved snapshot image in Glance, blocking any attempt"},{"line_number":13,"context_line":"to remove this image later in the unshelve process."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"9fb8cfa7_0547404e","line":11,"range":{"start_line":11,"start_character":46,"end_line":11,"end_character":51},"updated":"2019-06-26 21:32:54.000000000","message":"cloned","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Previously attempts to remove the shelved snapshot of an unshelved"},{"line_number":10,"context_line":"instance when using the rbd backends for both Nova and Glance would"},{"line_number":11,"context_line":"fail. This was due to the instance disk being clone from and still"},{"line_number":12,"context_line":"referencing the shelved snapshot image in Glance, blocking any attempt"},{"line_number":13,"context_line":"to remove this image later in the unshelve process."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"9fb8cfa7_7a056f0f","line":11,"range":{"start_line":11,"start_character":46,"end_line":11,"end_character":51},"in_reply_to":"9fb8cfa7_0547404e","updated":"2019-06-27 08:53:07.000000000","message":"Done","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":12,"context_line":"referencing the shelved snapshot image in Glance, blocking any attempt"},{"line_number":13,"context_line":"to remove this image later in the unshelve process."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"After much debate this change attempts to fix this issue by flattening"},{"line_number":16,"context_line":"the instance disk while the instance is being spawned as part of an"},{"line_number":17,"context_line":"unshelve. For the rbd imagebackend this removes any reference to the"},{"line_number":18,"context_line":"shelved snapshot in Glance allowing this image to be removed. For all"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"9fb8cfa7_2544c446","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":17},"updated":"2019-06-26 21:32:54.000000000","message":"Ohhhh the drama - I\u0027m assuming this is referring to the discussions in the bug about whether or not this is really a bug since Lee said we have the same issue with a spawned instance until it\u0027s deleted:\n\nhttps://bugs.launchpad.net/nova/+bug/1653953/comments/8\n\nI think that because the shelve snapshot image is meant to be temporary and we try to delete it automatically anyway this can be considered a bug.\n\nI can already tell I\u0027m going to have to deal with this in the cross-cell resize series as well:\n\nhttps://review.opendev.org/#/c/635080/32/nova/compute/manager.py@5073","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"referencing the shelved snapshot image in Glance, blocking any attempt"},{"line_number":13,"context_line":"to remove this image later in the unshelve process."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"After much debate this change attempts to fix this issue by flattening"},{"line_number":16,"context_line":"the instance disk while the instance is being spawned as part of an"},{"line_number":17,"context_line":"unshelve. For the rbd imagebackend this removes any reference to the"},{"line_number":18,"context_line":"shelved snapshot in Glance allowing this image to be removed. For all"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"9fb8cfa7_da049b17","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":17},"in_reply_to":"9fb8cfa7_2544c446","updated":"2019-06-27 08:53:07.000000000","message":"\u003e Ohhhh the drama - I\u0027m assuming this is referring to the discussions\n \u003e in the bug about whether or not this is really a bug since Lee said\n \u003e we have the same issue with a spawned instance until it\u0027s deleted:\n \u003e \n \u003e https://bugs.launchpad.net/nova/+bug/1653953/comments/8\n \u003e \n \u003e I think that because the shelve snapshot image is meant to be\n \u003e temporary and we try to delete it automatically anyway this can be\n \u003e considered a bug.\n\nThat and the various different implementations that have been put forward in this change.\n\n \u003e I can already tell I\u0027m going to have to deal with this in the\n \u003e cross-cell resize series as well:\n \u003e \n \u003e https://review.opendev.org/#/c/635080/32/nova/compute/manager.py@5073\n\nYup, I\u0027ll try to look over that this week.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"179c8866e3f8e5cebb8f996e75f9abd7305db8ee","unresolved":false,"context_lines":[{"line_number":12,"context_line":"referencing the shelved snapshot image in Glance, blocking any attempt"},{"line_number":13,"context_line":"to remove this image later in the unshelve process."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"After much debate this change attempts to fix this issue by flattening"},{"line_number":16,"context_line":"the instance disk while the instance is being spawned as part of an"},{"line_number":17,"context_line":"unshelve. For the rbd imagebackend this removes any reference to the"},{"line_number":18,"context_line":"shelved snapshot in Glance allowing this image to be removed. For all"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"9fb8cfa7_b3c1cd56","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":17},"in_reply_to":"9fb8cfa7_da049b17","updated":"2019-06-27 14:16:19.000000000","message":"\u003e \u003e I can already tell I\u0027m going to have to deal with this in the\n \u003e \u003e cross-cell resize series as well:\n \u003e \u003e\n \u003e \u003e https://review.opendev.org/#/c/635080/32/nova/compute/manager.py@5073\n \u003e \n \u003e Yup, I\u0027ll try to look over that this week.\n\nIt\u0027s actually going to be quite a bit trickier in the cross-cell case because what you have here won\u0027t work for that since the vm_state won\u0027t be SHELVED_OFFLOADED and we won\u0027t have the migration record within the libvirt driver (down at those levels) to tell if we\u0027re doing a cross-cell resize. Therefore I might need some external hooks into the driver to flatten the image (or pass something along as image meta that the driver would then look at, which is pretty gross as well).","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"}],"nova/conf/compute.py":[{"author":{"_account_id":29991,"name":"Henry Spanka","email":"henry@spanka.eu"},"change_message_id":"153c69bc2167b1978b563c0db899b0aea4a82374","unresolved":false,"context_lines":[{"line_number":217,"context_line":"Enable use of copy-on-write (cow) images."},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"QEMU/KVM allow the use of qcow2 as backing files. By disabling this,"},{"line_number":220,"context_line":"backing files will not be used. This option is also used by image backends."},{"line_number":221,"context_line":"If the value is False, images are flattened after fetching or cloning."},{"line_number":222,"context_line":"This makes instance images completely independent from parent images."},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_fe151a9c","line":220,"updated":"2019-02-24 17:28:26.000000000","message":"We should use another config option flatten_on_unshelve instead as this prevents using cow images at all.","commit_id":"958d07544d6a694d7e1567aec72ddf68458caa30"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"e53f2cd936ab3164cf1c1b278bd4d442a37ac575","unresolved":false,"context_lines":[{"line_number":19950,"context_line":"            params\u003d{\u0027vm_state\u0027: vm_states.SHELVED_OFFLOADED})"},{"line_number":19951,"context_line":"        drvr \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)"},{"line_number":19952,"context_line":"        mock_imagebackend \u003d mock.Mock(spec\u003dimagebackend.Lvm)"},{"line_number":19953,"context_line":"        mock_imagebackend.flatten.side_effect \u003d NotImplementedError()"},{"line_number":19954,"context_line":""},{"line_number":19955,"context_line":"        # Assert that this doesn\u0027t raise NotImplementedError"},{"line_number":19956,"context_line":"        drvr._try_fetch_image_cache(mock_imagebackend, mock.sentinel.fetch,"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fb8cfa7_b15fe43f","line":19953,"updated":"2019-06-21 12:57:01.000000000","message":"Ack.","commit_id":"0ca46b17c2d1410a06c1106dc3e80bac0ac090ec"}],"nova/tests/unit/virt/libvirt/test_imagebackend.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d8f6f869e8cfed84596aaa200570788ea53884c7","unresolved":false,"context_lines":[{"line_number":1523,"context_line":"    @mock.patch.object(rbd_utils.RBDDriver, \u0027flatten\u0027)"},{"line_number":1524,"context_line":"    def test_flatten(self, mock_flatten):"},{"line_number":1525,"context_line":"        image \u003d self.image_class(self.INSTANCE, self.NAME)"},{"line_number":1526,"context_line":"        self.assertFalse(image.flatten())"},{"line_number":1527,"context_line":""},{"line_number":1528,"context_line":"    def test_import_file(self):"},{"line_number":1529,"context_line":"        image \u003d self.image_class(self.INSTANCE, self.NAME)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_53c6c44b","line":1526,"range":{"start_line":1526,"start_character":8,"end_line":1526,"end_character":41},"updated":"2017-12-15 03:12:06.000000000","message":"Instead of this, you should have something like:\n\n image.flatten()\n\n mock_flatten.assert_called_once_with(image.rbd_name)","commit_id":"1afeb2f38e9f0714678885447a1c6cc87ef1deb4"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":3204,"context_line":"                def clone_fallback_to_fetch(*args, **kwargs):"},{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten image, which deattachs from boot image"},{"line_number":3208,"context_line":"                        backend.flatten()"},{"line_number":3209,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3210,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_2ca3a8a0","line":3207,"updated":"2017-04-25 21:43:20.000000000","message":"s/deattachs from boot image/allows the boot image to be detached/","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":3204,"context_line":"                def clone_fallback_to_fetch(*args, **kwargs):"},{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten image, which deattachs from boot image"},{"line_number":3208,"context_line":"                        backend.flatten()"},{"line_number":3209,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3210,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_934bf0ae","line":3207,"in_reply_to":"5ff73747_2ca3a8a0","updated":"2017-04-26 09:13:26.000000000","message":"Done","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten image, which deattachs from boot image"},{"line_number":3208,"context_line":"                        backend.flatten()"},{"line_number":3209,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3210,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3211,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_0c9eac53","line":3208,"updated":"2017-04-25 21:43:20.000000000","message":"Also, I\u0027m a little uncertain whether this is an appropriate place to put a call to flatten the image (which is RBD-specific and frankly can just go in the RBD driver... see below)","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten image, which deattachs from boot image"},{"line_number":3208,"context_line":"                        backend.flatten()"},{"line_number":3209,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3210,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3211,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_b3e5ccaa","line":3208,"in_reply_to":"5ff73747_0c9eac53","updated":"2017-04-26 09:13:26.000000000","message":"Though it is RBD-specifc, in the general cases it will pass when the function flatten is not available. \nI could not more appropriate to call this function.","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"ecd9438d9d8c2f95fc929232c12bd80fa12b35fc","unresolved":false,"context_lines":[{"line_number":3204,"context_line":"                def clone_fallback_to_fetch(*args, **kwargs):"},{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten the image allows boot image to be"},{"line_number":3208,"context_line":"                        # detached."},{"line_number":3209,"context_line":"                        backend.flatten()"},{"line_number":3210,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3211,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3212,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_56f7dcf6","line":3209,"range":{"start_line":3207,"start_character":0,"end_line":3209,"end_character":41},"updated":"2017-05-29 10:45:30.000000000","message":"There\u0027s still nothing testing that this is actually called in the context of _create_and_inject_local_root for rbd images right?","commit_id":"a187b584f7671d457fef52f0bb7d1b4ac07905bf"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"029008d30d2fba6e6992175a2eb39cca25a65710","unresolved":false,"context_lines":[{"line_number":3204,"context_line":"                def clone_fallback_to_fetch(*args, **kwargs):"},{"line_number":3205,"context_line":"                    try:"},{"line_number":3206,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3207,"context_line":"                        # Flatten the image allows boot image to be"},{"line_number":3208,"context_line":"                        # detached."},{"line_number":3209,"context_line":"                        backend.flatten()"},{"line_number":3210,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3211,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3212,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_fc06cf20","line":3209,"range":{"start_line":3207,"start_character":0,"end_line":3209,"end_character":41},"in_reply_to":"df140735_56f7dcf6","updated":"2017-05-29 12:40:26.000000000","message":"Yes, becuase this function is generic does not specific to RBD. \nIn existing UT test cases, they are testing with respect to the mock functions rather the RBD or NON RBD. \n\nThe tempest test case is suitable for this kind of scenario\nhttps://review.openstack.org/#/c/463248/\nWhich has been merged now.","commit_id":"a187b584f7671d457fef52f0bb7d1b4ac07905bf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"264b8cf3afce2730a182d9875027e9f232d4e52d","unresolved":false,"context_lines":[{"line_number":3305,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3306,"context_line":"                        # Flatten the image allows boot image to be"},{"line_number":3307,"context_line":"                        # detached."},{"line_number":3308,"context_line":"                        backend.flatten()"},{"line_number":3309,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3310,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3311,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_cd3aefc2","line":3308,"updated":"2017-10-31 19:22:49.000000000","message":"As mentioned in my other comment, we already flatten the image after the clone for the snapshot. Why is that not sufficient? I\u0027d like to see that explained in the code comment here too.","commit_id":"1afeb2f38e9f0714678885447a1c6cc87ef1deb4"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d8f6f869e8cfed84596aaa200570788ea53884c7","unresolved":false,"context_lines":[{"line_number":3305,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3306,"context_line":"                        # Flatten the image allows boot image to be"},{"line_number":3307,"context_line":"                        # detached."},{"line_number":3308,"context_line":"                        backend.flatten()"},{"line_number":3309,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3310,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3311,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_c8c0dfe3","line":3308,"in_reply_to":"3f4b6375_cd3aefc2","updated":"2017-12-15 03:12:06.000000000","message":"I asked around and didn\u0027t get a detailed explanation about how this works, so I dug around in the code and from what I can tell, this is how shelve and unshelve work with ceph:\n\n1. During shelve, a snapshot of the disk is created and it\u0027s cloned into glance\u0027s storage pool and flattened. Thus the image in glance is independent.\n\n2. During unshelve, if the instance has been SHELVED_OFFLOADED, the image will be cloned from the glance storage pool into the nova storage pool and used to bring up the instance. If that second clone (shown here) is not flattened, the snapshot in glance can\u0027t be deleted because this clone is now depending on it.\n\nAs mentioned on the launchpad bug, this code flow also affects a regular instance create, where if you create an instance from a ceph image in glance, you cannot delete the image from glance because it is \"in use\" by the instance because the clone was not flattened.","commit_id":"1afeb2f38e9f0714678885447a1c6cc87ef1deb4"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"4ea092f76319e07562c0baeeed7497dd01f31404","unresolved":false,"context_lines":[{"line_number":3279,"context_line":"                        # This clones the image from the glance storage pool to"},{"line_number":3280,"context_line":"                        # the nova storage pool."},{"line_number":3281,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3282,"context_line":"                        # Flatten the image to allow the boot image to be"},{"line_number":3283,"context_line":"                        # detached. This allows the glance image to be deleted."},{"line_number":3284,"context_line":"                        backend.flatten()"},{"line_number":3285,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3286,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3287,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_87a39cb1","line":3284,"range":{"start_line":3282,"start_character":0,"end_line":3284,"end_character":41},"updated":"2017-12-15 11:20:45.000000000","message":"I wonder if we need to make this behaviour configurable?\n\nThis will flatten images, making them independent but it will lead to more storage being consumed from the pool as we copy data from the image to the clone [1] for each instance boot, unshelve etc.\n\nDoing this by default during instance creation might catch some operators out who assume the old COW behaviour of cloning directly from the image pool is still being used on the backend. \n\n[1] http://docs.ceph.com/docs/giant/rbd/rbd-snapshot/#flattening-a-cloned-image","commit_id":"f60b9a108bce6056c9bd69e1885733b15fa9be0b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"317c25ad5c7b03674f75c99550d3ce6c9f1c6940","unresolved":false,"context_lines":[{"line_number":3279,"context_line":"                        # This clones the image from the glance storage pool to"},{"line_number":3280,"context_line":"                        # the nova storage pool."},{"line_number":3281,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3282,"context_line":"                        # Flatten the image to allow the boot image to be"},{"line_number":3283,"context_line":"                        # detached. This allows the glance image to be deleted."},{"line_number":3284,"context_line":"                        backend.flatten()"},{"line_number":3285,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3286,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3287,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_e5634e19","line":3284,"range":{"start_line":3282,"start_character":0,"end_line":3284,"end_character":41},"in_reply_to":"df87a7cf_5c300308","updated":"2017-12-18 10:02:18.000000000","message":"Yeah, using `use_cow_images` here seems sensible, if an operator really wants COW instance images then they will need to live with this design wrinkle until some form of per-node cache is available in the future.","commit_id":"f60b9a108bce6056c9bd69e1885733b15fa9be0b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"668c175a0667f0dfaa54ae06873fe23c4c0916f0","unresolved":false,"context_lines":[{"line_number":3279,"context_line":"                        # This clones the image from the glance storage pool to"},{"line_number":3280,"context_line":"                        # the nova storage pool."},{"line_number":3281,"context_line":"                        backend.clone(context, disk_images[\u0027image_id\u0027])"},{"line_number":3282,"context_line":"                        # Flatten the image to allow the boot image to be"},{"line_number":3283,"context_line":"                        # detached. This allows the glance image to be deleted."},{"line_number":3284,"context_line":"                        backend.flatten()"},{"line_number":3285,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3286,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3287,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_5c300308","line":3284,"range":{"start_line":3282,"start_character":0,"end_line":3284,"end_character":41},"in_reply_to":"df87a7cf_87a39cb1","updated":"2017-12-15 16:37:12.000000000","message":"I don\u0027t know 100% what operators expectation are around how this is supposed to work. I assumed from the opened bugs that they assume it should behave like local storage where they can delete images at-will from glance.\n\nBut, I think your point is important that each instance would be making a full copy and that\u0027s very different from what was happening before and also different from local storage with the default use_cow_images\u003dTrue where each instance has a COW behavior from the backing file.\n\nSo, I wonder if we could re-use the use_cow_images config setting for this validly? That is, if use_cow_images\u003dFalse then make copies per instance, same as local storage.\n\nThe last thing I wanted to mention is that this sounds like yet another application for some caching behavior of ceph images in the nova storage pool that\u0027s been brought up before. Copy-flatten the image into the nova pool once per image and then have instances use COW copies of that. That would perhaps be the best solution to this problem and something mdbooth has said was his plan for imagebackend all along anyway.","commit_id":"f60b9a108bce6056c9bd69e1885733b15fa9be0b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a16d47cab3a6f318712f22c3039b3f3469f9cb3d","unresolved":false,"context_lines":[{"line_number":3545,"context_line":"                                                 CONF.libvirt.images_type)"},{"line_number":3546,"context_line":"            if instance.task_state \u003d\u003d task_states.RESIZE_FINISH:"},{"line_number":3547,"context_line":"                backend.create_snap(libvirt_utils.RESIZE_SNAPSHOT_NAME)"},{"line_number":3548,"context_line":"            if backend.SUPPORTS_CLONE:"},{"line_number":3549,"context_line":"                def clone_fallback_to_fetch(*args, **kwargs):"},{"line_number":3550,"context_line":"                    try:"},{"line_number":3551,"context_line":"                        # This clones the image from the glance storage pool to"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_f5622116","line":3548,"range":{"start_line":3548,"start_character":15,"end_line":3548,"end_character":37},"updated":"2018-04-10 16:50:55.000000000","message":"Note to reviewers, this is only true for RBD, which tells me it is poorly-named.","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a16d47cab3a6f318712f22c3039b3f3469f9cb3d","unresolved":false,"context_lines":[{"line_number":3559,"context_line":"                            # Flatten the image to allow the boot image to be"},{"line_number":3560,"context_line":"                            # detached. This allows the glance image to be"},{"line_number":3561,"context_line":"                            # deleted."},{"line_number":3562,"context_line":"                            backend.flatten()"},{"line_number":3563,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3564,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3565,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_3580998b","line":3562,"updated":"2018-04-10 16:50:55.000000000","message":"Why wouldn\u0027t we just do this after fetch for all types? It doesn\u0027t make as much sense for qcow2, but it would be a lot more straightforward in the code, and it would make any cow-based storage flatten itself if that\u0027s how the user configured it.","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d344fcd70ff071ea568d3edfeb9a1fdc4336da8a","unresolved":false,"context_lines":[{"line_number":3559,"context_line":"                            # Flatten the image to allow the boot image to be"},{"line_number":3560,"context_line":"                            # detached. This allows the glance image to be"},{"line_number":3561,"context_line":"                            # deleted."},{"line_number":3562,"context_line":"                            backend.flatten()"},{"line_number":3563,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3564,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3565,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_d8115406","line":3562,"in_reply_to":"bf659307_183a6c97","updated":"2018-04-10 17:08:37.000000000","message":"Only because the kinda default arrangement is that use_cow_images\u003dFalse implies we don\u0027t use the Qcow2 backend. But, as I said in my other comment, I think you can still arrange for that by specifying the images_type","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"1792aa80cead0f22abdb016272560ca74f20d3db","unresolved":false,"context_lines":[{"line_number":3559,"context_line":"                            # Flatten the image to allow the boot image to be"},{"line_number":3560,"context_line":"                            # detached. This allows the glance image to be"},{"line_number":3561,"context_line":"                            # deleted."},{"line_number":3562,"context_line":"                            backend.flatten()"},{"line_number":3563,"context_line":"                    except exception.ImageUnacceptable:"},{"line_number":3564,"context_line":"                        libvirt_utils.fetch_image(*args, **kwargs)"},{"line_number":3565,"context_line":"                fetch_func \u003d clone_fallback_to_fetch"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_183a6c97","line":3562,"in_reply_to":"bf659307_3580998b","updated":"2018-04-10 17:04:22.000000000","message":"There might be a gap in my understanding of how things work but I had thought that doing this for RBD brings it into parity with the way that use_cow_images already works for non-RBD.","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"79368e29b585916077d2a79ba4d057f0089d6923","unresolved":false,"context_lines":[{"line_number":8502,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"},{"line_number":8503,"context_line":"                # our inability to call flatten here, however given this isn\u0027t"},{"line_number":8504,"context_line":"                # yet implemented for most of the backends it may do more harm"},{"line_number":8505,"context_line":"                # than good, concerning ops etc so for now just pass."},{"line_number":8506,"context_line":"                pass"},{"line_number":8507,"context_line":""},{"line_number":8508,"context_line":"    def _create_images_and_backing(self, context, instance, instance_dir,"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fb8cfa7_82bf94a8","line":8505,"updated":"2019-06-12 14:49:20.000000000","message":"Similarly, logging the \"attempt to flatten\" message when we\u0027re not going to be able to do it for most of the drivers is a little odd as well. Might be better to just put that after the call, saying it\u0027s done. Definitely weird to see that if you\u0027re using raw images :)","commit_id":"d0670e81bc2910f6fd44f257a964a94edb8d1cda"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3e845637fbd8a2181ff6abf4d1087736af20db52","unresolved":false,"context_lines":[{"line_number":8502,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"},{"line_number":8503,"context_line":"                # our inability to call flatten here, however given this isn\u0027t"},{"line_number":8504,"context_line":"                # yet implemented for most of the backends it may do more harm"},{"line_number":8505,"context_line":"                # than good, concerning ops etc so for now just pass."},{"line_number":8506,"context_line":"                pass"},{"line_number":8507,"context_line":""},{"line_number":8508,"context_line":"    def _create_images_and_backing(self, context, instance, instance_dir,"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fb8cfa7_287c87ea","line":8505,"in_reply_to":"9fb8cfa7_82bf94a8","updated":"2019-06-12 16:11:48.000000000","message":"Yeah fair point, I\u0027ll respin to switch that around.","commit_id":"d0670e81bc2910f6fd44f257a964a94edb8d1cda"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"338566dcefc95696d46b08f3822bbbf11ad78e9e","unresolved":false,"context_lines":[{"line_number":8457,"context_line":""},{"line_number":8458,"context_line":"        # NOTE(lyarwood): If the instance vm_state is shelved offloaded then we"},{"line_number":8459,"context_line":"        # must be unshelving for _try_fetch_image_cache to be called."},{"line_number":8460,"context_line":"        if instance.vm_state \u003d\u003d vm_states.SHELVED_OFFLOADED:"},{"line_number":8461,"context_line":"            # NOTE(lyarwood): When using the rbd imagebackend the call to cache"},{"line_number":8462,"context_line":"            # above will attempt to clone from the shelved snapshot in Glance"},{"line_number":8463,"context_line":"            # if available from this compute. We then need to flatten the"}],"source_content_type":"text/x-python","patch_set":22,"id":"9fb8cfa7_49c5e15a","line":8460,"updated":"2019-06-18 14:35:18.000000000","message":"Not a fan of this, or putting this here. This kind of logic works much better if it\u0027s a natural part of the code flow.\n\nHowever... I don\u0027t think we can improve this much without a major refactor, so I\u0027m ok with it. It would be better placed in _create_and_inject_local_root immediately after _try_fetch_image_cache, imho, as the blast radius would be slightly smaller, but I wouldn\u0027t hold out for that change.","commit_id":"cb19db1dcf52e3abecdffac27e30f38b2a63ceba"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"338566dcefc95696d46b08f3822bbbf11ad78e9e","unresolved":false,"context_lines":[{"line_number":8465,"context_line":"            # blocking the removal of the shelved snapshot at the end of the"},{"line_number":8466,"context_line":"            # unshelve. This is a no-op for all but the rbd imagebackend."},{"line_number":8467,"context_line":"            try:"},{"line_number":8468,"context_line":"                image.flatten()"},{"line_number":8469,"context_line":"                LOG.debug(\u0027Image %s flattened successfully for unshelving \u0027"},{"line_number":8470,"context_line":"                          \u0027instance %s\u0027, image.path, instance.uuid)"},{"line_number":8471,"context_line":"            except NotImplementedError:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9fb8cfa7_c99c715f","line":8468,"updated":"2019-06-18 14:35:18.000000000","message":"I\u0027m ok with this. Qcow2 should also implement this, btw, but not in this change. However, if you think through the *ideal* qcow2 action here, it would be:\n\n* Download the original image to the image cache, if available\n* Rebase the unshelved image onto the original image\n\nThis is more akin to make_it_like_it_was_before_shelve() than flatten(). Does ceph support an operation like this? Can it be retrofitted?","commit_id":"cb19db1dcf52e3abecdffac27e30f38b2a63ceba"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"db24754bddfd82d8626ba5dba4d67f515d3c669d","unresolved":false,"context_lines":[{"line_number":8465,"context_line":"            # blocking the removal of the shelved snapshot at the end of the"},{"line_number":8466,"context_line":"            # unshelve. This is a no-op for all but the rbd imagebackend."},{"line_number":8467,"context_line":"            try:"},{"line_number":8468,"context_line":"                image.flatten()"},{"line_number":8469,"context_line":"                LOG.debug(\u0027Image %s flattened successfully for unshelving \u0027"},{"line_number":8470,"context_line":"                          \u0027instance %s\u0027, image.path, instance.uuid)"},{"line_number":8471,"context_line":"            except NotImplementedError:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9fb8cfa7_4cd64ff4","line":8468,"in_reply_to":"9fb8cfa7_c99c715f","updated":"2019-06-18 15:13:39.000000000","message":"I don\u0027t believe rbd has the same ability to rebase a volume onto an existing snapshot. I agree that for unshelve we\u0027d rather rebase qcow2 disks but I still think there\u0027s a use in having a flatten method in that class in the long term.","commit_id":"cb19db1dcf52e3abecdffac27e30f38b2a63ceba"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":8481,"context_line":"            # unshelve. This is a no-op for all but the rbd imagebackend."},{"line_number":8482,"context_line":"            try:"},{"line_number":8483,"context_line":"                image.flatten()"},{"line_number":8484,"context_line":"                LOG.debug(\u0027Image %s flattened successfully while unshelving \u0027"},{"line_number":8485,"context_line":"                          \u0027instance.\u0027, image.path, instance\u003dinstance)"},{"line_number":8486,"context_line":"            except NotImplementedError:"},{"line_number":8487,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_056ae07f","line":8484,"updated":"2019-06-26 21:32:54.000000000","message":"I went to go check the ceph job logs for this:\n\nhttp://logs.openstack.org/86/457886/25/check/devstack-plugin-ceph-tempest/7f0f35b/controller/logs/screen-n-cpu.txt.gz\n\nbut it turns out shelve is disabled in the ceph job:\n\nhttp://logs.openstack.org/86/457886/25/check/devstack-plugin-ceph-tempest/7f0f35b/controller/logs/tempest_log.txt.gz#_2019-06-25_23_40_51_975\n\nI\u0027m not sure why, but it likely has to do with rbd snapshots being flaky in CI or maybe related to this bug? Anyway, I\u0027d feel a lot more comfortable with this change if we actually had a run of the ceph job against this change to show that shelve offload / unshelve works with this change.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d99cb322de33a32b2143838ce2be252caefb6803","unresolved":false,"context_lines":[{"line_number":8482,"context_line":"            try:"},{"line_number":8483,"context_line":"                image.flatten()"},{"line_number":8484,"context_line":"                LOG.debug(\u0027Image %s flattened successfully while unshelving \u0027"},{"line_number":8485,"context_line":"                          \u0027instance.\u0027, image.path, instance\u003dinstance)"},{"line_number":8486,"context_line":"            except NotImplementedError:"},{"line_number":8487,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"},{"line_number":8488,"context_line":"                # our inability to call flatten here, however given this isn\u0027t"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_05bd21d7","line":8485,"updated":"2019-06-25 12:10:32.000000000","message":"Nice tidy-up.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":8484,"context_line":"                LOG.debug(\u0027Image %s flattened successfully while unshelving \u0027"},{"line_number":8485,"context_line":"                          \u0027instance.\u0027, image.path, instance\u003dinstance)"},{"line_number":8486,"context_line":"            except NotImplementedError:"},{"line_number":8487,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"},{"line_number":8488,"context_line":"                # our inability to call flatten here, however given this isn\u0027t"},{"line_number":8489,"context_line":"                # implemented for most of the backends it may do more harm than"},{"line_number":8490,"context_line":"                # good, concerning operators etc so for now just pass."}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_45c6989c","line":8487,"updated":"2019-06-26 21:32:54.000000000","message":"Well, alternatively you could check the image.SUPPORTS_CLONE attribute and call flatten() if that\u0027s true, right?","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82436b2f4e9707f715df9249f8afabd207ac079d","unresolved":false,"context_lines":[{"line_number":8483,"context_line":"                image.flatten()"},{"line_number":8484,"context_line":"                LOG.debug(\u0027Image %s flattened successfully while unshelving \u0027"},{"line_number":8485,"context_line":"                          \u0027instance.\u0027, image.path, instance\u003dinstance)"},{"line_number":8486,"context_line":"            except NotImplementedError:"},{"line_number":8487,"context_line":"                # NOTE(lyarwood): There\u0027s an argument to be made for logging"},{"line_number":8488,"context_line":"                # our inability to call flatten here, however given this isn\u0027t"},{"line_number":8489,"context_line":"                # implemented for most of the backends it may do more harm than"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fb8cfa7_45d7664c","line":8486,"updated":"2019-06-27 15:57:47.000000000","message":"We still could have checked image.SUPPORTS_CLONE before calling flatten() and avoid the NotImplementedError but maybe that\u0027s not desirable to munge the two concepts.","commit_id":"d89e7d7857e0ab56c3b088338272c24d0618c07f"}],"nova/virt/libvirt/imagebackend.py":[{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":378,"context_line":""},{"line_number":379,"context_line":"        This should be a no-op on any backend where it is not implemented."},{"line_number":380,"context_line":"        \"\"\""},{"line_number":381,"context_line":"        pass"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":384,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_53f4485b","line":381,"range":{"start_line":381,"start_character":8,"end_line":381,"end_character":12},"updated":"2017-04-26 09:13:26.000000000","message":"In case on non RBD drivers, this function will pass. \n\nAs this function is optional, should not be implemented in very every driver","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"469dbc6ca7a7847f5c902ad346bae54ed97ef08c","unresolved":false,"context_lines":[{"line_number":897,"context_line":"        for location in locations:"},{"line_number":898,"context_line":"            if self.driver.is_cloneable(location, image_meta):"},{"line_number":899,"context_line":"                LOG.debug(\u0027Selected location: %(loc)s\u0027, {\u0027loc\u0027: location})"},{"line_number":900,"context_line":"                return self.driver.clone(location, self.rbd_name)"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":"        reason \u003d _(\u0027No image locations are accessible\u0027)"},{"line_number":903,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_ecaca08d","line":900,"updated":"2017-04-25 21:43:20.000000000","message":"Instead of adding a new flatten() method to the Image interface (which is only relevant to RBD), how about just calling self.driver.flatten() here like so?\n\n res \u003d self.driver.clone(location, self.rbd_name)\n # Ensure the original disk image can be detached\n self.driver.flatten(self.rbd_name)\n return res","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":11503,"name":"Ritesh Paiboina","email":"rsritesh@rediff.com","username":"rsritesh"},"change_message_id":"7150378e73921821c2c56deacf570ba788e8bd16","unresolved":false,"context_lines":[{"line_number":897,"context_line":"        for location in locations:"},{"line_number":898,"context_line":"            if self.driver.is_cloneable(location, image_meta):"},{"line_number":899,"context_line":"                LOG.debug(\u0027Selected location: %(loc)s\u0027, {\u0027loc\u0027: location})"},{"line_number":900,"context_line":"                return self.driver.clone(location, self.rbd_name)"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":"        reason \u003d _(\u0027No image locations are accessible\u0027)"},{"line_number":903,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_b3814c92","line":900,"in_reply_to":"5ff73747_ecaca08d","updated":"2017-04-26 09:13:26.000000000","message":"Thank you for comment :)\n\nYes, I would like to do this way but I have the second thought about this . \n\nThe function def clone is entirely different form the flatten. \nWe know both are different functions and to maintain modularity and separation between the these two layers we need to keep it different. \n\nNext time somebody wants to call def flatten function, it would be easy to call\n\nIf you scroll down litte bit in this file , line number 999 - 1002 \nThere are both are called independently.\n\nPlease let me know your opinion on this , I am ready to change.","commit_id":"c63253fa39b3bc7b32c1d2e61d843bcc48414f6b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"264b8cf3afce2730a182d9875027e9f232d4e52d","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"        try:"},{"line_number":1031,"context_line":"            self.driver.clone(location, image_id, dest_pool\u003dparent_pool)"},{"line_number":1032,"context_line":"            # Flatten the image, which detaches it from the source snapshot"},{"line_number":1033,"context_line":"            self.driver.flatten(image_id, pool\u003dparent_pool)"},{"line_number":1034,"context_line":"        finally:"},{"line_number":1035,"context_line":"            # all done with the source snapshot, clean it up"},{"line_number":1036,"context_line":"            self.cleanup_direct_snapshot(location)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f4b6375_ad1b3371","line":1033,"updated":"2017-10-31 19:22:49.000000000","message":"We already flatten the image after a snapshot for rbd. Why is that not sufficient? If it\u0027s not sufficient, I\u0027d like to see the additional flatten explained in the commit message and in a code comment where it\u0027s used in libvirt/driver.py","commit_id":"1afeb2f38e9f0714678885447a1c6cc87ef1deb4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a16d47cab3a6f318712f22c3039b3f3469f9cb3d","unresolved":false,"context_lines":[{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        This should be a no-op on any backend where it is not implemented."},{"line_number":405,"context_line":"        \"\"\""},{"line_number":406,"context_line":"        pass"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":409,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_15c1d5e4","line":406,"updated":"2018-04-10 16:50:55.000000000","message":"This is a thing you can do with other cow images, like Qcow2. I would expect this to be implemented for that as well, even though I see from the obscure way we call this from the driver that we\u0027d never end up calling flatten() if we\u0027re anything other than rbd.\n\nI kinda wonder if we should call this something different and/or make it super clear that this really only applies to RBD. If I\u0027m just reading the config, it seems like use_cow_images\u003dFalse,libvirt.images_type\u003dqcow2 is a legit combination that would end up with flattened (i.e. fully-allocated) qcow2 images, but it won\u0027t. People will get sparse qcow2 files in that config, as best I can tell.","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f5bb1393c440501943cfe7bdeb07164337478d7a","unresolved":false,"context_lines":[{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        This should be a no-op on any backend where it is not implemented."},{"line_number":405,"context_line":"        \"\"\""},{"line_number":406,"context_line":"        pass"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":409,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"bf659307_98399c40","line":406,"in_reply_to":"bf659307_15c1d5e4","updated":"2018-04-10 17:22:43.000000000","message":"Okay, let me dig into this more. Thanks.","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"0700c50eb202a7769aca08bd190210323f5456fb","unresolved":false,"context_lines":[{"line_number":971,"context_line":""},{"line_number":972,"context_line":"    def _get_parent_pool(self, context, base_image_id, fsid):"},{"line_number":973,"context_line":"        parent_pool \u003d None"},{"line_number":974,"context_line":"        try:"},{"line_number":975,"context_line":"            # The easy way -- the image is an RBD clone, so use the parent"},{"line_number":976,"context_line":"            # images\u0027 storage pool"},{"line_number":977,"context_line":"            parent_pool, _im, _snap \u003d self.driver.parent_info(self.rbd_name)"},{"line_number":978,"context_line":"        except exception.ImageUnacceptable:"},{"line_number":979,"context_line":"            # The hard way -- the image is itself a parent, so ask Glance"},{"line_number":980,"context_line":"            # where it came from"},{"line_number":981,"context_line":"            LOG.debug(\u0027No parent info for %s; asking the Image API where its \u0027"},{"line_number":982,"context_line":"                      \u0027store is\u0027, base_image_id)"},{"line_number":983,"context_line":"            try:"},{"line_number":984,"context_line":"                image_meta \u003d IMAGE_API.get(context, base_image_id,"},{"line_number":985,"context_line":"                                           include_locations\u003dTrue)"},{"line_number":986,"context_line":"            except Exception as e:"},{"line_number":987,"context_line":"                LOG.debug(\u0027Unable to get image %(image_id)s; error: %(error)s\u0027,"},{"line_number":988,"context_line":"                          {\u0027image_id\u0027: base_image_id, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_a26b5bef","line":985,"range":{"start_line":974,"start_character":8,"end_line":985,"end_character":66},"updated":"2018-05-18 10:04:03.000000000","message":"this change will break the following use case that is currently possible: during direct_snapshot of the flattened image there will be no parent_info, so code will try to fetch image list from glance, and if the image was disabled/marked private this will fail and fall back to cold snapshot.\n\nMaybe we could save parent pool name during instance boot somewhere, like system_metadata? Or introduce a separate pool defined in nova for snapshots?","commit_id":"61b27135581967d5b242f1e3d863da19717ad2a5"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"70b7c9ba17a4a263fdadcefda7b68716be3262b4","unresolved":false,"context_lines":[{"line_number":657,"context_line":"                                       imgmodel.FORMAT_QCOW2)"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    def flatten(self):"},{"line_number":660,"context_line":"        reason \u003d _(\"[DEFAULT]use_cow_images configuration option set to false \""},{"line_number":661,"context_line":"                   \"cannot be used with qcow2 images type.\")"},{"line_number":662,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dself.path, reason\u003dreason)"},{"line_number":663,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_a9238a57","line":660,"updated":"2018-06-26 11:17:00.000000000","message":"qemu-img amend cannot change preallocation mode, so we\u0027d have to do the double conversion here if implemented I guess","commit_id":"5941ce7ca31a4dfdeabd95050a96f32b4c0cc59d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e26be0fb152b27bd3614b007bd7e0fb25d09e7d7","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"},{"line_number":431,"context_line":"                                          reason\u003dreason)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def flatten(self):"},{"line_number":434,"context_line":"        \"\"\"Flatten an image."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        This should be a no-op on any backend where it is not implemented."}],"source_content_type":"text/x-python","patch_set":19,"id":"9fb8cfa7_f0742d6a","line":433,"updated":"2019-06-11 17:22:57.000000000","message":"Isn\u0027t it a little broken to add a method like this and not implement it for other things that support COW? I\u0027m thinking about qcow2, and people thinking \"well, duh, that supports COW so I should be able to use this to flatten it\".\n\nNow, I\u0027m not saying we should flatten qcows on unshelve if we don\u0027t already today, but it probably means we should name this something different and describe the thing it\u0027s doing better.\n\nI wonder if maybe we should call this \"detach_from_base\" or something like that, and maybe define an image method called \"needs_detach_on_unshelve()\"? That way we could implement the latter as False for everything, and maybe detach_from_base() raise in the base class, to catch the case where someone calls detach_from_base(), gets no error, and expects that it worked. Maybe my names aren\u0027t right here, having just read the overview of this problem, but...you see what I mean about this being too generic to be useful...hopefully?","commit_id":"07f29dfc8149030c1df4392db18836b735eb1b60"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6033a4470345d23c0f69a832988726005e1f73f9","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"},{"line_number":431,"context_line":"                                          reason\u003dreason)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def flatten(self):"},{"line_number":434,"context_line":"        \"\"\"Flatten an image."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        This should be a no-op on any backend where it is not implemented."}],"source_content_type":"text/x-python","patch_set":19,"id":"9fb8cfa7_4bf54cec","line":433,"in_reply_to":"9fb8cfa7_f0042d4c","updated":"2019-06-11 18:07:16.000000000","message":"\u003e Yeah, the issue here is that I\u0027m trying to write this as a\n \u003e backportable bugfix so landing functionality like that and all the\n \u003e refactoring it would entail landing in image backend isn\u0027t an\n \u003e option. I agree however that just `pass`ing here likely isn\u0027t the\n \u003e best idea and can respin so we raise NotImplementedError so if any\n \u003e devs do assume they get burnt for now.\n\nSure, like I said, I\u0027m not actually suggesting that we implement it for qcow, I\u0027m using it as an example for why I think the naming and implementation as a single method isn\u0027t a good idea.\n\n \u003e IIRC the shelved snapshot is copied to the host and cloned from so\n \u003e we don\u0027t run into the same issue. We could and probably should\n \u003e flatten that but that\u0027s outside of this change.\n\nThat might be more tidy but not a necessary fix, so definitely agree.\n\n \u003e Yeah, I\u0027m all for defining another static method in these classes\n \u003e to help us determine if this needs to be called. As for the naming,\n \u003e I really don\u0027t have a strong opinion.\n\nI think the should-we-flatten method is an important bit, and making the base implementation of the flatten method raise NotImplementedError is critical. I guess if we do that I\u0027m less concerned about the naming of the actual flatten method, especially if that\u0027s the right name *and* it makes sense to have that implemented on qcow in the future.","commit_id":"07f29dfc8149030c1df4392db18836b735eb1b60"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"968791022faf7b5d70af9170bb84c7ea472d2c7d","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"},{"line_number":431,"context_line":"                                          reason\u003dreason)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def flatten(self):"},{"line_number":434,"context_line":"        \"\"\"Flatten an image."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        This should be a no-op on any backend where it is not implemented."}],"source_content_type":"text/x-python","patch_set":19,"id":"9fb8cfa7_f0042d4c","line":433,"in_reply_to":"9fb8cfa7_f0742d6a","updated":"2019-06-11 17:55:40.000000000","message":"\u003e Isn\u0027t it a little broken to add a method like this and not\n \u003e implement it for other things that support COW? I\u0027m thinking about\n \u003e qcow2, and people thinking \"well, duh, that supports COW so I\n \u003e should be able to use this to flatten it\".\n\nYeah, the issue here is that I\u0027m trying to write this as a backportable bugfix so landing functionality like that and all the refactoring it would entail landing in image backend isn\u0027t an option. I agree however that just `pass`ing here likely isn\u0027t the best idea and can respin so we raise NotImplementedError so if any devs do assume they get burnt for now. \n\n \u003e Now, I\u0027m not saying we should flatten qcows on unshelve if we don\u0027t\n \u003e already today, but it probably means we should name this something\n \u003e different and describe the thing it\u0027s doing better.\n\nIIRC the shelved snapshot is copied to the host and cloned from so we don\u0027t run into the same issue. We could and probably should flatten that but that\u0027s outside of this change.\n\n \u003e I wonder if maybe we should call this \"detach_from_base\" or\n \u003e something like that, and maybe define an image method called\n \u003e \"needs_detach_on_unshelve()\"? That way we could implement the\n \u003e latter as False for everything, and maybe detach_from_base() raise\n \u003e in the base class, to catch the case where someone calls\n \u003e detach_from_base(), gets no error, and expects that it worked.\n \u003e Maybe my names aren\u0027t right here, having just read the overview of\n \u003e this problem, but...you see what I mean about this being too\n \u003e generic to be useful...hopefully?\n\nYeah, I\u0027m all for defining another static method in these classes to help us determine if this needs to be called. As for the naming, I really don\u0027t have a strong opinion.","commit_id":"07f29dfc8149030c1df4392db18836b735eb1b60"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        The implementation of this method is optional and therefore is"},{"line_number":437,"context_line":"        not an abstractmethod."},{"line_number":438,"context_line":"        \"\"\""},{"line_number":439,"context_line":"        raise NotImplementedError(_(\u0027flatten() is not implemented\u0027))"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":442,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_c584c860","line":439,"range":{"start_line":439,"start_character":34,"end_line":439,"end_character":35},"updated":"2019-06-26 21:32:54.000000000","message":"nit: we probably don\u0027t need the translation marker here","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        The implementation of this method is optional and therefore is"},{"line_number":437,"context_line":"        not an abstractmethod."},{"line_number":438,"context_line":"        \"\"\""},{"line_number":439,"context_line":"        raise NotImplementedError(_(\u0027flatten() is not implemented\u0027))"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":442,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_3aaff7e3","line":439,"range":{"start_line":439,"start_character":34,"end_line":439,"end_character":35},"in_reply_to":"9fb8cfa7_c584c860","updated":"2019-06-27 08:53:07.000000000","message":"Done","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        The implementation of this method is optional and therefore is"},{"line_number":437,"context_line":"        not an abstractmethod."},{"line_number":438,"context_line":"        \"\"\""},{"line_number":439,"context_line":"        raise NotImplementedError(_(\u0027flatten() is not implemented\u0027))"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def direct_snapshot(self, context, snapshot_name, image_format, image_id,"},{"line_number":442,"context_line":"                        base_image_id):"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_5a10ab4e","line":439,"range":{"start_line":439,"start_character":34,"end_line":439,"end_character":35},"in_reply_to":"9fb8cfa7_c584c860","updated":"2019-06-27 08:53:07.000000000","message":"Done","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":843,"context_line":"            except IndexError:"},{"line_number":844,"context_line":"                raise exception.InvalidDevicePath(path\u003dpath)"},{"line_number":845,"context_line":"        else:"},{"line_number":846,"context_line":"            self.rbd_name \u003d \u0027%s_%s\u0027 % (instance.uuid, disk_name)"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"        self.pool \u003d CONF.libvirt.images_rbd_pool"},{"line_number":849,"context_line":"        self.rbd_user \u003d CONF.libvirt.rbd_user"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_e5330caa","line":846,"updated":"2019-06-26 21:32:54.000000000","message":"In this case pool won\u0027t be in rbd_name - is that a problem during flatten()?","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":843,"context_line":"            except IndexError:"},{"line_number":844,"context_line":"                raise exception.InvalidDevicePath(path\u003dpath)"},{"line_number":845,"context_line":"        else:"},{"line_number":846,"context_line":"            self.rbd_name \u003d \u0027%s_%s\u0027 % (instance.uuid, disk_name)"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"        self.pool \u003d CONF.libvirt.images_rbd_pool"},{"line_number":849,"context_line":"        self.rbd_user \u003d CONF.libvirt.rbd_user"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_9aa6230f","line":846,"in_reply_to":"9fb8cfa7_e5330caa","updated":"2019-06-27 08:53:07.000000000","message":"See below, I\u0027ll include it anyway as it\u0027s being logged incorrectly at the moment.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":857,"context_line":""},{"line_number":858,"context_line":"        super(Rbd, self).__init__(path, \"block\", \"rbd\", is_block_dev\u003dFalse)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"        self.driver \u003d rbd_utils.RBDDriver("},{"line_number":861,"context_line":"            pool\u003dself.pool,"},{"line_number":862,"context_line":"            ceph_conf\u003dself.ceph_conf,"},{"line_number":863,"context_line":"            rbd_user\u003dself.rbd_user)"},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"        self.discard_mode \u003d CONF.libvirt.hw_disk_discard"},{"line_number":866,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_daa01bf7","line":863,"range":{"start_line":860,"start_character":0,"end_line":863,"end_character":35},"updated":"2019-06-27 08:53:07.000000000","message":"I think this is allowing us to get away without providing a pool when calling flatten() as the connection to the cluster has already defined it here.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"179c8866e3f8e5cebb8f996e75f9abd7305db8ee","unresolved":false,"context_lines":[{"line_number":857,"context_line":""},{"line_number":858,"context_line":"        super(Rbd, self).__init__(path, \"block\", \"rbd\", is_block_dev\u003dFalse)"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"        self.driver \u003d rbd_utils.RBDDriver("},{"line_number":861,"context_line":"            pool\u003dself.pool,"},{"line_number":862,"context_line":"            ceph_conf\u003dself.ceph_conf,"},{"line_number":863,"context_line":"            rbd_user\u003dself.rbd_user)"},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"        self.discard_mode \u003d CONF.libvirt.hw_disk_discard"},{"line_number":866,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_f3be65ac","line":863,"range":{"start_line":860,"start_character":0,"end_line":863,"end_character":35},"in_reply_to":"9fb8cfa7_daa01bf7","updated":"2019-06-27 14:16:19.000000000","message":"Hmm, but flatten() only uses the pool passed in, not self.pool, but maybe I\u0027m missing the point.\n\n(later)\n\nOh I see it\u0027s used here:\n\nhttps://github.com/openstack/nova/blob/7b769ad403751268c60b095f722437cbed692071/nova/virt/libvirt/storage/rbd_utils.py#L135\n\nSneaky.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c191e42ef7e48325083933e6b8e43e2d7e895ba","unresolved":false,"context_lines":[{"line_number":986,"context_line":"        raise exception.ImageUnacceptable(image_id\u003dimage_id_or_uri,"},{"line_number":987,"context_line":"                                          reason\u003dreason)"},{"line_number":988,"context_line":""},{"line_number":989,"context_line":"    def flatten(self):"},{"line_number":990,"context_line":"        self.driver.flatten(self.rbd_name)"},{"line_number":991,"context_line":""},{"line_number":992,"context_line":"    def get_model(self, connection):"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_65dabc78","line":989,"updated":"2019-06-26 21:32:54.000000000","message":"nit: a docstring could be useful here, i.e. driver.flatten() takes an optional pool kwarg. I don\u0027t really know anything about ceph/rbd but why does the pool not matter here? Just for my own awareness. Or is the pool already in rbd_name - your unit test seems to suggest it would be, but the code in __init__ says it doesn\u0027t necessarily have to be.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"}],"nova/virt/libvirt/storage/rbd_utils.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                                  conffile\u003dself.ceph_conf)"},{"line_number":133,"context_line":"        try:"},{"line_number":134,"context_line":"            client.connect()"},{"line_number":135,"context_line":"            pool_to_open \u003d pool or self.pool"},{"line_number":136,"context_line":"            # NOTE(luogangyi): open_ioctx \u003e\u003d 10.1.0 could handle unicode"},{"line_number":137,"context_line":"            # arguments perfectly as part of Python 3 support."},{"line_number":138,"context_line":"            # Therefore, when we turn to Python 3, it\u0027s safe to remove"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_ba60c7a6","line":135,"range":{"start_line":135,"start_character":0,"end_line":135,"end_character":44},"updated":"2019-06-27 08:53:07.000000000","message":"Ultimately this is switching back to the pool given when creating the RBDDriver object within the Rbd imagebackend.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"3a2f726cf57a52bc5b7279e3e942329252b9f59c","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        :volume: Name of RBD object"},{"line_number":282,"context_line":"        :pool: Name of pool"},{"line_number":283,"context_line":"        \"\"\""},{"line_number":284,"context_line":"        LOG.debug(\u0027flattening %(pool)s/%(vol)s\u0027, dict(pool\u003dpool, vol\u003dvolume))"},{"line_number":285,"context_line":"        with RBDVolumeProxy(self, str(volume), pool\u003dpool) as vol:"},{"line_number":286,"context_line":"            vol.flatten()"},{"line_number":287,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_7a56cfd0","line":284,"range":{"start_line":284,"start_character":8,"end_line":284,"end_character":77},"updated":"2019-06-27 08:53:07.000000000","message":"http://logs.openstack.org/27/662327/3/check/devstack-plugin-ceph-tempest-py3/d015954/controller/logs/screen-n-cpu.txt.gz#_Jun_26_21_28_39_825624\n\nThis is currently logging None/$rbd_volume_id so we should really just pass the pool to at least make this clear.","commit_id":"213dba2290867fe6af4b08b94407926f87fa618f"}]}
