)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"278fcad4523a9c93fdcb7b2baf88908ad3ded0a2","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Usually the source volume would be the same size or smaller"},{"line_number":10,"context_line":"than the destination volume and they must share the same"},{"line_number":11,"context_line":"volume-type. Currently creating an encrypted volume from a"},{"line_number":12,"context_line":"snapshot of an encrypted volume truncates the data in the"},{"line_number":13,"context_line":"new volume."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"In order to fix this the RBD workflow would be something"},{"line_number":16,"context_line":"like this:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"e8444c3c_76a837d5","line":13,"range":{"start_line":11,"start_character":13,"end_line":13,"end_character":11},"updated":"2021-07-29 14:10:56.000000000","message":"should mention this is when the destination volume is same size as the source volume","commit_id":"3bf6961e54469c2233121c3587c66d76c9a47ee3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"278fcad4523a9c93fdcb7b2baf88908ad3ded0a2","unresolved":true,"context_lines":[{"line_number":12,"context_line":"snapshot of an encrypted volume truncates the data in the"},{"line_number":13,"context_line":"new volume."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"In order to fix this the RBD workflow would be something"},{"line_number":16,"context_line":"like this:"},{"line_number":17,"context_line":"A source luks volume would be 1026M, we write some data"},{"line_number":18,"context_line":"and create a snap from it. We like to create a new luks"},{"line_number":19,"context_line":"volume from a snapshot so the create_volume_from_snapshot()"},{"line_number":20,"context_line":"method performs a RBD clone first and then a resize if needed."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In addition the _clone() method creates a clone"},{"line_number":23,"context_line":"(copy-on-write child) of the parent snapshot. Object size"},{"line_number":24,"context_line":"will be identical to that of the parent image unless specified"},{"line_number":25,"context_line":"(we don\u0027t in cinder) so size will be the same as the parent"},{"line_number":26,"context_line":"snapshot."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"If the desired size of the destination luks volume is 1G the"},{"line_number":29,"context_line":"create_volume_from_snapshot() won\u0027t perform any resize and"},{"line_number":30,"context_line":"will be 1026M as the parent. This solves bug #1922408 because"},{"line_number":31,"context_line":"we don\u0027t force it to resize and because of that we don\u0027t"},{"line_number":32,"context_line":"truncate the data anymore."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"The second case scenario is when we would like to increase"},{"line_number":35,"context_line":"the size of the destination volume. As far as I can tell this"},{"line_number":36,"context_line":"won\u0027t face the encryption header problem but we still need to"},{"line_number":37,"context_line":"calculate the difference size to provide the size that the"},{"line_number":38,"context_line":"user is expecting."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"That\u0027s why the fix proposed calculate the new_size based on:"},{"line_number":41,"context_line":"size difference \u003d desired size - size of source volume"},{"line_number":42,"context_line":"new size \u003d current size + size difference"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"Closes-Bug: #1922408"},{"line_number":45,"context_line":"Co-Authored-By: Sofia Enriquez \u003clsofia.enriquez@gmail.com\u003e"},{"line_number":46,"context_line":"Change-Id: I220b5e3b01d115262a8b1dd45758f0531aea0edf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9608b73b_2b3a575c","line":43,"range":{"start_line":15,"start_character":0,"end_line":43,"end_character":0},"updated":"2021-07-29 14:10:56.000000000","message":"I think this could have been summarized without giving too much internal details but it provides the reasoning for the code so i won\u0027t nit pick.","commit_id":"3bf6961e54469c2233121c3587c66d76c9a47ee3"}],"cinder/tests/unit/volume/drivers/test_rbd.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bbbfc2aa004d9cbb5ac6edbb8d56f0446e32c535","unresolved":true,"context_lines":[{"line_number":1872,"context_line":"    @common_mocks"},{"line_number":1873,"context_line":"    @mock.patch.object(driver.RBDDriver, \u0027_clone\u0027,"},{"line_number":1874,"context_line":"                       return_value\u003dmock.sentinel.volume_update)"},{"line_number":1875,"context_line":"    def test_create_encrypted_vol_from_snap(self, mock_clone):"},{"line_number":1876,"context_line":"        self.cfg.rbd_flatten_volume_from_snapshot \u003d False"},{"line_number":1877,"context_line":"        self.snapshot_b.volume.size \u003d 11"},{"line_number":1878,"context_line":"        with mock.patch.object(self.driver, \u0027_resize\u0027) as mock_resize:"}],"source_content_type":"text/x-python","patch_set":12,"id":"e82d2118_d0be8c44","line":1875,"updated":"2021-05-20 15:21:21.000000000","message":"nit: maybe mention in a comment that the new volume is larger than the snapshot (12GB vs 11GB)","commit_id":"dde5a8fa46f97aeba942e3b5cae5232f9799aa24"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bbbfc2aa004d9cbb5ac6edbb8d56f0446e32c535","unresolved":true,"context_lines":[{"line_number":1875,"context_line":"    def test_create_encrypted_vol_from_snap(self, mock_clone):"},{"line_number":1876,"context_line":"        self.cfg.rbd_flatten_volume_from_snapshot \u003d False"},{"line_number":1877,"context_line":"        self.snapshot_b.volume.size \u003d 11"},{"line_number":1878,"context_line":"        with mock.patch.object(self.driver, \u0027_resize\u0027) as mock_resize:"},{"line_number":1879,"context_line":"            with mock.patch.object(self.driver,"},{"line_number":1880,"context_line":"                                   \u0027_calculate_new_size\u0027) as mock_new_size:"},{"line_number":1881,"context_line":"                res \u003d self.driver.create_volume_from_snapshot(self.volume_c,"},{"line_number":1882,"context_line":"                                                              self.snapshot_b)"},{"line_number":1883,"context_line":"                self.assertEqual(mock.sentinel.volume_update, res)"}],"source_content_type":"text/x-python","patch_set":12,"id":"4a71ed89_8b0cbaf1","line":1880,"range":{"start_line":1878,"start_character":0,"end_line":1880,"end_character":75},"updated":"2021-05-20 15:21:21.000000000","message":"nit: It\u0027s more readable if we don\u0027t don\u0027t use nested context managers, since we can do with mock.patch() as A, mock.path() as B.\n\nWe can also do it without using context managers:\n\n  mock_resize \u003d self.mock_object(self.driver, \u0027_resize\u0027)","commit_id":"dde5a8fa46f97aeba942e3b5cae5232f9799aa24"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bbbfc2aa004d9cbb5ac6edbb8d56f0446e32c535","unresolved":true,"context_lines":[{"line_number":1881,"context_line":"                res \u003d self.driver.create_volume_from_snapshot(self.volume_c,"},{"line_number":1882,"context_line":"                                                              self.snapshot_b)"},{"line_number":1883,"context_line":"                self.assertEqual(mock.sentinel.volume_update, res)"},{"line_number":1884,"context_line":"                mock_resize.assert_called_once()"},{"line_number":1885,"context_line":"                mock_new_size.assert_called_once()"},{"line_number":1886,"context_line":""},{"line_number":1887,"context_line":"    @common_mocks"},{"line_number":1888,"context_line":"    @mock.patch.object(driver.RBDDriver, \u0027_clone\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"6b0c57ac_8ec4e7cd","line":1885,"range":{"start_line":1884,"start_character":0,"end_line":1885,"end_character":50},"updated":"2021-05-20 15:21:21.000000000","message":"-1: We should check that we are calling the methods with the right parameters using assert_called_once_with method instead.","commit_id":"dde5a8fa46f97aeba942e3b5cae5232f9799aa24"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bbbfc2aa004d9cbb5ac6edbb8d56f0446e32c535","unresolved":true,"context_lines":[{"line_number":1896,"context_line":"                res \u003d self.driver.create_volume_from_snapshot(self.volume_b,"},{"line_number":1897,"context_line":"                                                              self.snapshot_b)"},{"line_number":1898,"context_line":"                self.assertEqual(mock.sentinel.volume_update, res)"},{"line_number":1899,"context_line":"                mock_resize.assert_called_once()"},{"line_number":1900,"context_line":"                mock_new_size.assert_not_called()"},{"line_number":1901,"context_line":""},{"line_number":1902,"context_line":"    @common_mocks"}],"source_content_type":"text/x-python","patch_set":12,"id":"3c3b9072_669e7810","line":1899,"range":{"start_line":1899,"start_character":0,"end_line":1899,"end_character":48},"updated":"2021-05-20 15:21:21.000000000","message":"-1: use assert_called_once_with instead","commit_id":"dde5a8fa46f97aeba942e3b5cae5232f9799aa24"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"278fcad4523a9c93fdcb7b2baf88908ad3ded0a2","unresolved":true,"context_lines":[{"line_number":1876,"context_line":"        \"\"\"Test create encrypted volume from encrypted snapshot."},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"        When creating an encrypted volume from encrypted snapshot"},{"line_number":1879,"context_line":"        the new volume is larger than the snapshot (12GB vs 11GB)."},{"line_number":1880,"context_line":"        \"\"\""},{"line_number":1881,"context_line":"        self.cfg.rbd_flatten_volume_from_snapshot \u003d False"},{"line_number":1882,"context_line":"        new_size_bytes \u003d 12288"}],"source_content_type":"text/x-python","patch_set":15,"id":"70f8ea84_2173c496","line":1879,"range":{"start_line":1879,"start_character":12,"end_line":1879,"end_character":66},"updated":"2021-07-29 14:10:56.000000000","message":"It will be useful to have one more test with destination volume size same as source size, to assert resize is not called in that case","commit_id":"3bf6961e54469c2233121c3587c66d76c9a47ee3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"707308e3de50929d133cab6e565cfc80c87e5aa8","unresolved":true,"context_lines":[{"line_number":1876,"context_line":"        \"\"\"Test create encrypted volume from encrypted snapshot."},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"        When creating an encrypted volume from encrypted snapshot"},{"line_number":1879,"context_line":"        the new volume is same size than the snapshot."},{"line_number":1880,"context_line":"        \"\"\""},{"line_number":1881,"context_line":"        self.cfg.rbd_flatten_volume_from_snapshot \u003d False"},{"line_number":1882,"context_line":"        volume_size \u003d self.volume_c.size"}],"source_content_type":"text/x-python","patch_set":16,"id":"49c35122_8f9c6f3c","line":1879,"range":{"start_line":1879,"start_character":36,"end_line":1879,"end_character":40},"updated":"2021-07-29 17:13:32.000000000","message":"nit: as","commit_id":"cf1c5252965e731d77af503529ca42e269c305c6"}],"cinder/volume/drivers/rbd.py":[{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"4b8b2b4abe39d7cf92d63557ea0bf11710c1471b","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def create_volume_from_snapshot(self, volume, snapshot):"},{"line_number":1045,"context_line":"        \"\"\"Creates a volume from a snapshot.\"\"\""},{"line_number":1046,"context_line":"        volume_update \u003d self._clone(volume, self.configuration.rbd_pool,"},{"line_number":1047,"context_line":"                                    snapshot.volume_name, snapshot.name)"},{"line_number":1048,"context_line":"        if self.configuration.rbd_flatten_volume_from_snapshot:"},{"line_number":1049,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"eebd5ff1_5a94fc30","line":1046,"updated":"2021-04-06 16:04:27.000000000","message":"The size returned after rbd self._clone seems to be correct, the problem is that cinder forces to truncate the size of the volume after that. This happens because when using encryption cinder is not considering the size of the encryption header.\n\nWhat we should do is calculate the new size and add it to the target volume instead of truncating it:\n\n```\nsize difference \u003d desired size - size of source volume\nnew size \u003d current size + size difference \n```","commit_id":"96f89306548d9d5e246d58e20aa6f94c358d6541"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7dbe40aefe266887f660e8b877780262f2fcec62","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def create_volume_from_snapshot(self, volume, snapshot):"},{"line_number":1045,"context_line":"        \"\"\"Creates a volume from a snapshot.\"\"\""},{"line_number":1046,"context_line":"        volume_update \u003d self._clone(volume, self.configuration.rbd_pool,"},{"line_number":1047,"context_line":"                                    snapshot.volume_name, snapshot.name)"},{"line_number":1048,"context_line":"        if self.configuration.rbd_flatten_volume_from_snapshot:"},{"line_number":1049,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"21f28668_106b0070","line":1046,"in_reply_to":"eebd5ff1_5a94fc30","updated":"2021-04-07 06:36:37.000000000","message":"good idea, i will try to fix this according to this.","commit_id":"96f89306548d9d5e246d58e20aa6f94c358d6541"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"4b8b2b4abe39d7cf92d63557ea0bf11710c1471b","unresolved":true,"context_lines":[{"line_number":1055,"context_line":"        else:"},{"line_number":1056,"context_line":"            if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1057,"context_line":"                size \u003d int(volume.size) * units.Gi"},{"line_number":1058,"context_line":"                size +\u003d 1 * units.Mi"},{"line_number":1059,"context_line":"                self._resize(volume, size\u003dsize)"},{"line_number":1060,"context_line":""},{"line_number":1061,"context_line":"        self._show_msg_check_clone_v2_api(snapshot.volume_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"a3fd3722_49654dd2","line":1058,"range":{"start_line":1058,"start_character":16,"end_line":1058,"end_character":36},"updated":"2021-04-06 16:04:27.000000000","message":"I think we need more than 1M. In the case of LUKSv1 as far as I tested it needs at least 3M.","commit_id":"96f89306548d9d5e246d58e20aa6f94c358d6541"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7dbe40aefe266887f660e8b877780262f2fcec62","unresolved":true,"context_lines":[{"line_number":1055,"context_line":"        else:"},{"line_number":1056,"context_line":"            if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1057,"context_line":"                size \u003d int(volume.size) * units.Gi"},{"line_number":1058,"context_line":"                size +\u003d 1 * units.Mi"},{"line_number":1059,"context_line":"                self._resize(volume, size\u003dsize)"},{"line_number":1060,"context_line":""},{"line_number":1061,"context_line":"        self._show_msg_check_clone_v2_api(snapshot.volume_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ae52c10_f5b97ec3","line":1058,"range":{"start_line":1058,"start_character":16,"end_line":1058,"end_character":36},"in_reply_to":"a3fd3722_49654dd2","updated":"2021-04-07 06:36:37.000000000","message":"i tested it again in my environment. i needs at least 2M.\n1: created an encryption rbd volume.\n2: rbd export volumes/volume-xxxxxxxxx ./volume-xxxxxx\n3: qemu-img info volume-xxxxxx\n   ...\n   payload_offset: 2068480     (this is 2020K, almost 2M)\n\nHowever, no matter how big the encryption head, We simply get the allocation size of the volume, then use the above method to calculate the size of the extend.","commit_id":"96f89306548d9d5e246d58e20aa6f94c358d6541"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"3c2f640d930a15b14f13e99a2def02c7cd3b7aaf","unresolved":true,"context_lines":[{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff, * units.Gi"},{"line_number":1048,"context_line":"        new_size_bytes \u003d current_size_bytes + size_diff_bytes"},{"line_number":1049,"context_line":"        return new_size_bytes"},{"line_number":1050,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"b455c01b_1f08e405","line":1047,"range":{"start_line":1047,"start_character":35,"end_line":1047,"end_character":36},"updated":"2021-04-09 01:04:35.000000000","message":"There\u0027s an extra comma here","commit_id":"316000cfd4fba1da33fb71401aff7b1aad702eea"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1031f2c5cccb097761aaf407b2370fcbd97448d6","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"},{"line_number":1048,"context_line":"        new_size_bytes \u003d current_size_bytes + size_diff_bytes"},{"line_number":1049,"context_line":"        return new_size_bytes"}],"source_content_type":"text/x-python","patch_set":7,"id":"235288a6_b31ec698","line":1046,"range":{"start_line":1046,"start_character":33,"end_line":1046,"end_character":50},"updated":"2021-05-03 13:17:43.000000000","message":"isn\u0027t this the same as volume.size at L#1058?","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1218bf67ba1c3fdd6fed275ddea7ba2c5a1ca9e7","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"},{"line_number":1048,"context_line":"        new_size_bytes \u003d current_size_bytes + size_diff_bytes"},{"line_number":1049,"context_line":"        return new_size_bytes"}],"source_content_type":"text/x-python","patch_set":7,"id":"a2032d18_75acaf7f","line":1046,"range":{"start_line":1046,"start_character":33,"end_line":1046,"end_character":50},"in_reply_to":"235288a6_b31ec698","updated":"2021-05-03 13:51:08.000000000","message":"I think this provides the size in bytes, again the question is isn\u0027t this same as\nvolume.size *  units.Gi?","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f4f11048f5b0d7218e520cd1fe6353029dd71084","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"},{"line_number":1048,"context_line":"        new_size_bytes \u003d current_size_bytes + size_diff_bytes"},{"line_number":1049,"context_line":"        return new_size_bytes"}],"source_content_type":"text/x-python","patch_set":7,"id":"8a7d55ab_fb4042fb","line":1046,"range":{"start_line":1046,"start_character":33,"end_line":1046,"end_character":50},"in_reply_to":"80d58f19_a2b8063b","updated":"2021-05-05 06:37:47.000000000","message":"I checked this and it came out to be 1025 MB (maybe can vary depending on the encryption parameters) so yes different from what openstack assumes i.e. 1024","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"c15ec92917d33ba59015adec757a39dc292355a1","unresolved":true,"context_lines":[{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"},{"line_number":1048,"context_line":"        new_size_bytes \u003d current_size_bytes + size_diff_bytes"},{"line_number":1049,"context_line":"        return new_size_bytes"}],"source_content_type":"text/x-python","patch_set":7,"id":"80d58f19_a2b8063b","line":1046,"range":{"start_line":1046,"start_character":33,"end_line":1046,"end_character":50},"in_reply_to":"a2032d18_75acaf7f","updated":"2021-05-03 15:03:06.000000000","message":"It isn\u0027t. I guess this should be transparent to Cinder but in case that the volume is encrypted, the vol.volume.size is 1026M instead of 1024. Because of that, volume.size is 1024 and vol.volume.size is 1026.","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f4f11048f5b0d7218e520cd1fe6353029dd71084","unresolved":true,"context_lines":[{"line_number":1055,"context_line":"        if self.configuration.rbd_flatten_volume_from_snapshot:"},{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"}],"source_content_type":"text/x-python","patch_set":7,"id":"7619b6d5_d90273c5","line":1058,"range":{"start_line":1058,"start_character":11,"end_line":1058,"end_character":55},"updated":"2021-05-05 06:37:47.000000000","message":"If we\u0027re creating a 1GB encrypted volume from the snapshot of 1GB encrypted volume, this will be 1 \u003e 1 ? False which will not perform the resize but the issue while mounting still persists\n\nhttps://bugs.launchpad.net/cinder/+bug/1852168","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1031f2c5cccb097761aaf407b2370fcbd97448d6","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"0dfb9464_72f41eb3","line":1059,"range":{"start_line":1059,"start_character":23,"end_line":1059,"end_character":27},"updated":"2021-05-03 13:17:43.000000000","message":"shouldn\u0027t this be volume.size? else we might face problem while resizing if destination volume is not encrypted","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"97546b0b203f0be517e06ba6005db57cf2090f02","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7131dca4_20580a41","line":1059,"range":{"start_line":1059,"start_character":23,"end_line":1059,"end_character":27},"in_reply_to":"0dfb9464_72f41eb3","updated":"2021-05-03 15:51:00.000000000","message":"As far as I see it, the idea of this fix is only force resize when the destination\nvolume size is bigger than the source volumes and calculate the new size based on the difference and not in round numbers.\n\ni.e: In case of encrypted volume, the real size of the volume in the backend is 1026M but Cinder shows 1024. Currently the size after rbd self._clone seems to be correct, the problem is that cinder forces to truncate the size of the volume after that. This happens because when using encryption cinder is not considering the size of the encryption header.\n\nWhat we should do is calculate the new size and add it to the target volume instead of truncating it:\nsize difference \u003d desired size - size of source volume\nnew size \u003d current size + size difference \n\ni.e:\ndesired size \u003d 2048M (volume.size)\nsize of source volume \u003d 1024M (snapshot.volume.size)\nsize difference \u003d 1024M\ncurrent size \u003d 1026M\nnew size \u003d  2050M\n\nThe second scenario is when the volume isn\u0027t encrypted but the used would like to increase the size of the destination volume. Using new_size \u003d None avoids let\u0027s cinder resize without problems.","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f4f11048f5b0d7218e520cd1fe6353029dd71084","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"e0b10a18_e5d5d58e","line":1059,"range":{"start_line":1059,"start_character":23,"end_line":1059,"end_character":27},"in_reply_to":"7131dca4_20580a41","updated":"2021-05-05 06:37:47.000000000","message":"What about the case when source and final volume will be 2 GB?\nWhat will be the value of int(volume.size) and int(snapshot.volume.size), 2GB? Then will we enter this loop?","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1031f2c5cccb097761aaf407b2370fcbd97448d6","unresolved":true,"context_lines":[{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9434395c_220a22e0","line":1062,"range":{"start_line":1062,"start_character":12,"end_line":1062,"end_character":40},"updated":"2021-05-03 13:17:43.000000000","message":"if this is always true then we don\u0027t need this if block and if it isn\u0027t true the new_size value is None and might cause problem on L#1066 while resizing","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f4f11048f5b0d7218e520cd1fe6353029dd71084","unresolved":true,"context_lines":[{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"8c8b2583_38e6fbd0","line":1062,"range":{"start_line":1062,"start_character":12,"end_line":1062,"end_character":40},"in_reply_to":"5b7d85a0_5b69ffff","updated":"2021-05-05 06:37:47.000000000","message":"You\u0027re right, I should\u0027ve seen the implementation before so setting this as None initially won\u0027t cause issue.","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"97546b0b203f0be517e06ba6005db57cf2090f02","unresolved":true,"context_lines":[{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5b7d85a0_5b69ffff","line":1062,"range":{"start_line":1062,"start_character":12,"end_line":1062,"end_character":40},"in_reply_to":"9434395c_220a22e0","updated":"2021-05-03 15:51:00.000000000","message":"As far as I understand, this isn\u0027t always true. In case we\u0027d like to create a bigger non-encrypted destination volume from that snapshot, we wouldn\u0027t calculate the new size. \n\nI\u0027m not sure why this may cause problem? AFAIK if the size is None it will return size \u003d int(volume.size) * units.Gi.[1]\n[1]https://opendev.org/openstack/cinder/src/branch/master/cinder/volume/drivers/rbd.py#L1038","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1031f2c5cccb097761aaf407b2370fcbd97448d6","unresolved":true,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"},{"line_number":1066,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1067,"context_line":""},{"line_number":1068,"context_line":"        self._show_msg_check_clone_v2_api(snapshot.volume_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"d987e79f_9b3038c9","line":1065,"range":{"start_line":1063,"start_character":16,"end_line":1065,"end_character":65},"updated":"2021-05-03 13:17:43.000000000","message":"I\u0027m not able to understand the calculation going on here.\nwe\u0027re taking the difference of original volume and volume created from snapshot and then adding that difference to the destination volume, can\u0027t we just resize it to the original volume size directly?\nself._resize(volume, size\u003dsnapshot.volume.size)","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"97546b0b203f0be517e06ba6005db57cf2090f02","unresolved":true,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"},{"line_number":1066,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1067,"context_line":""},{"line_number":1068,"context_line":"        self._show_msg_check_clone_v2_api(snapshot.volume_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9b97f581_867d9a76","line":1065,"range":{"start_line":1063,"start_character":16,"end_line":1065,"end_character":65},"in_reply_to":"622c5f12_f359222e","updated":"2021-05-03 15:51:00.000000000","message":"This is a good concerns, as far as I see it, if the user want 2G \u003d 2048M encrypted volume to use, cinder should return that. The amount of space of the encryption header isn\u0027t available space to use so cinder needs to add it to 2048M instead of truncate the volume.","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1218bf67ba1c3fdd6fed275ddea7ba2c5a1ca9e7","unresolved":true,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_size_diff(size_diff,"},{"line_number":1065,"context_line":"                                                     volume.name)"},{"line_number":1066,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1067,"context_line":""},{"line_number":1068,"context_line":"        self._show_msg_check_clone_v2_api(snapshot.volume_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"622c5f12_f359222e","line":1065,"range":{"start_line":1063,"start_character":16,"end_line":1065,"end_character":65},"in_reply_to":"d987e79f_9b3038c9","updated":"2021-05-03 13:51:08.000000000","message":"Ignore my previous, comment but i still don\u0027t understand the calculation\ndestination size \u003d destination volume size + difference of destination and original volume?\nthe destination size is already bigger and we\u0027re adding additional difference to it?","commit_id":"64b8a083f3e2579a30e2bb08384296449aa4a99e"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"16c4b35e3618bc983313e8260f23592e076bb445","unresolved":true,"context_lines":[{"line_number":1041,"context_line":"        with RBDVolumeProxy(self, volume.name) as vol:"},{"line_number":1042,"context_line":"            vol.resize(size)"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"}],"source_content_type":"text/x-python","patch_set":8,"id":"e83be337_762025e2","line":1044,"range":{"start_line":1044,"start_character":24,"end_line":1044,"end_character":28},"updated":"2021-05-17 17:25:47.000000000","message":"This is returning an absolute number of bytes and not a diff -- naming this \"diff\" is misleading.","commit_id":"1c2912d79b5fd2f66461e573315dde94bd27dec6"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"0fcbaf3786a4a50f34926b3ce315b48c67b8db6f","unresolved":true,"context_lines":[{"line_number":1041,"context_line":"        with RBDVolumeProxy(self, volume.name) as vol:"},{"line_number":1042,"context_line":"            vol.resize(size)"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"    def _calculate_size_diff(self, size_diff, volume_name):"},{"line_number":1045,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":1046,"context_line":"            current_size_bytes \u003d vol.volume.size()"},{"line_number":1047,"context_line":"        size_diff_bytes \u003d size_diff * units.Gi"}],"source_content_type":"text/x-python","patch_set":8,"id":"ef7a52b9_d5cbee4b","line":1044,"range":{"start_line":1044,"start_character":24,"end_line":1044,"end_character":28},"in_reply_to":"e83be337_762025e2","updated":"2021-05-18 01:03:36.000000000","message":"i have change this function to def _calculate_new_size().","commit_id":"1c2912d79b5fd2f66461e573315dde94bd27dec6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"38191370163cce06b39752da079b793c79c73795","unresolved":true,"context_lines":[{"line_number":1055,"context_line":"        if self.configuration.rbd_flatten_volume_from_snapshot:"},{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"}],"source_content_type":"text/x-python","patch_set":10,"id":"557a963c_a2766dbd","line":1058,"range":{"start_line":1058,"start_character":11,"end_line":1058,"end_character":56},"updated":"2021-05-18 15:08:29.000000000","message":"?: Why are we casting them to ints?  They are already fields.IntegerField\n\n-1: We cannot use snapshot.volume.size, as that will trigger a lazy load of the volume OVO, and the size we will get is the current size of the volume, which may not be the size of the snapshot if the volume has been extended after the snapshot was created.  We must use snapshot.volume_size instead","commit_id":"64d23be67f264d6381bfe1d72a8120e3b5ecea1b"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"f331c37c9029f793522912d51d13ab7ed02f475e","unresolved":true,"context_lines":[{"line_number":1055,"context_line":"        if self.configuration.rbd_flatten_volume_from_snapshot:"},{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        if int(volume.size) \u003e int(snapshot.volume.size):"},{"line_number":1059,"context_line":"            new_size \u003d None"},{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"}],"source_content_type":"text/x-python","patch_set":10,"id":"e8bf1e3d_4cacc999","line":1058,"range":{"start_line":1058,"start_character":11,"end_line":1058,"end_character":56},"in_reply_to":"557a963c_a2766dbd","updated":"2021-05-19 01:45:23.000000000","message":"yes, we should use snapshot.volume_size.","commit_id":"64d23be67f264d6381bfe1d72a8120e3b5ecea1b"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"38191370163cce06b39752da079b793c79c73795","unresolved":true,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_new_size(size_diff, volume.name)"},{"line_number":1065,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1066,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"dd989cf5_c479b00a","line":1063,"range":{"start_line":1063,"start_character":51,"end_line":1063,"end_character":71},"updated":"2021-05-18 15:08:29.000000000","message":"-1: Same issue as L1058 and also, we could store size_diff before L1058 and use it in both places so we don\u0027t have to calculate it twice","commit_id":"64d23be67f264d6381bfe1d72a8120e3b5ecea1b"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"f331c37c9029f793522912d51d13ab7ed02f475e","unresolved":false,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d int(volume.size) - int(snapshot.volume.size)"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_new_size(size_diff, volume.name)"},{"line_number":1065,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1066,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ec37a9a4_342f900d","line":1063,"range":{"start_line":1063,"start_character":51,"end_line":1063,"end_character":71},"in_reply_to":"dd989cf5_c479b00a","updated":"2021-05-19 01:45:23.000000000","message":"1:Done, remove int().\n2:we only calculate size_diff in line 1063, and this value is needed only when volume.size \u003e snapshot.volume_size and volume.encryption_key_id, so i don\u0027t think it need to move before L1058.","commit_id":"64d23be67f264d6381bfe1d72a8120e3b5ecea1b"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"0d5a6687ec84f9848fa805275eea6b7b8f91fc2a","unresolved":true,"context_lines":[{"line_number":1060,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1061,"context_line":"            # size of the encryption header when resizing the volume"},{"line_number":1062,"context_line":"            if volume.encryption_key_id:"},{"line_number":1063,"context_line":"                size_diff \u003d volume.size - snapshot.volume_size"},{"line_number":1064,"context_line":"                new_size \u003d self._calculate_new_size(size_diff, volume.name)"},{"line_number":1065,"context_line":"            self._resize(volume, size\u003dnew_size)"},{"line_number":1066,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"a1492eb2_a644422c","line":1063,"range":{"start_line":1063,"start_character":42,"end_line":1063,"end_character":62},"updated":"2021-05-19 20:22:07.000000000","message":"As Gorka\u0027s commented before I think we could add a new line before L1058 with something like snap_volume_size \u003d snapshot.volume_size. In this way, we don\u0027t have to calculate it twice.","commit_id":"4ebe2fd38be9274ea3577b74b0c4ed6c6ae3c58a"},{"author":{"_account_id":9236,"name":"Jon Bernard","email":"jobernar@redhat.com","username":"jbernard"},"change_message_id":"25c0ab3d7aeb07646e6b25d460b3ea56677d58ba","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        snap_vol_size \u003d snapshot.volume_size"},{"line_number":1059,"context_line":"        if volume.size \u003e snap_vol_size:"},{"line_number":1060,"context_line":"            new_size \u003d None"},{"line_number":1061,"context_line":"            # In case the volume is encrypted we need to consider the"},{"line_number":1062,"context_line":"            # size of the encryption header when resizing the volume"}],"source_content_type":"text/x-python","patch_set":13,"id":"f1fb56a8_edd51bc1","line":1059,"updated":"2021-07-27 19:55:06.000000000","message":"There are a few scenarios that we could be in at runtime, it might be\nuseful to outline the possibilities in a comment if you make an update,\nthe case you\u0027re addressing is tricky and not at all obvious by looking\nat this logic.  Just a thought, code looks great.","commit_id":"c3364909470577112084df4bab6662d066e24edd"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"9fb1a32a14eac41fdc59219d39450c2c9905f24f","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        snap_vol_size \u003d snapshot.volume_size"},{"line_number":1059,"context_line":"        # bug 1922408"},{"line_number":1060,"context_line":"        # In case the destination size is bigger than the snapshot size"},{"line_number":1061,"context_line":"        # we should resize. In particular when the destination volume"},{"line_number":1062,"context_line":"        # is encrypted we should consider the encryption header size."}],"source_content_type":"text/x-python","patch_set":14,"id":"1a92c686_8164602d","line":1059,"range":{"start_line":1059,"start_character":10,"end_line":1059,"end_character":21},"updated":"2021-07-28 18:01:27.000000000","message":"Please don\u0027t list bug numbers in the code -- this is not very useful and mostly ends up being clutter.","commit_id":"7e0f4aacdaa6a91ebece99b1f0328fb3938dbc7d"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"278fcad4523a9c93fdcb7b2baf88908ad3ded0a2","unresolved":true,"context_lines":[{"line_number":1056,"context_line":"            self._flatten(self.configuration.rbd_pool, volume.name)"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        snap_vol_size \u003d snapshot.volume_size"},{"line_number":1059,"context_line":"        # In case the destination size is bigger than the snapshot size"},{"line_number":1060,"context_line":"        # we should resize. In particular when the destination volume"},{"line_number":1061,"context_line":"        # is encrypted we should consider the encryption header size."},{"line_number":1062,"context_line":"        # Because of this, we need to calculate the difference size to"},{"line_number":1063,"context_line":"        # provide the size that the user is expecting."},{"line_number":1064,"context_line":"        # Otherwise if the destination size is equal to the source size"},{"line_number":1065,"context_line":"        # we don\u0027t perform a resize."},{"line_number":1066,"context_line":"        if volume.size \u003e snap_vol_size:"},{"line_number":1067,"context_line":"            new_size \u003d None"},{"line_number":1068,"context_line":"            # In case the volume is encrypted we need to consider the"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f1847b4_0c98e125","line":1065,"range":{"start_line":1059,"start_character":0,"end_line":1065,"end_character":36},"updated":"2021-07-29 14:10:56.000000000","message":"+1\nnit: should mention destination volume size and source volume size since we\u0027re dealing with both volumes and snapshots here","commit_id":"3bf6961e54469c2233121c3587c66d76c9a47ee3"}],"releasenotes/notes/bug-1922408-create-encryption-volume-from-snapshot-skip-resize-bb5d77c5e912b5c1.yaml":[{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"b29ade467801efad9f9492a7fd389b718153df5d","unresolved":true,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    `Bug #1922408 \u003chttps://bugs.launchpad.net/cinder/+bug/1922408\u003e`_:"},{"line_number":5,"context_line":"    Fix rbd driver create encrypted volume from snapshot."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"2df38662_8a57cb91","line":5,"range":{"start_line":5,"start_character":4,"end_line":5,"end_character":7},"updated":"2021-04-19 17:20:21.000000000","message":":-1: we should follow the release notes rules https://review.opendev.org/c/openstack/cinder/+/779501/4/doc/source/contributor/releasenotes.rst\n\nShould be something like:\n\n```\n  ---\n  fixes:\n    - |\n      RBD driver #1922408 \u003chttps://bugs.launchpad.net/cinder/+bug/1922408\u003e`_:\n      Fixed create encrypted volume from snapshot\n\n```","commit_id":"bf75d2523fc1e0b2e8308f7674326fc3501f204e"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bbbfc2aa004d9cbb5ac6edbb8d56f0446e32c535","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    RBD driver `Bug #1922408"},{"line_number":5,"context_line":"    \u003chttps://bugs.launchpad.net/cinder/+bug/1922408\u003e`_:"},{"line_number":6,"context_line":"    Fixed create encrypted volume from snapshot."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"4e9730e3_d18f25ee","line":6,"range":{"start_line":6,"start_character":39,"end_line":6,"end_character":47},"updated":"2021-05-20 15:21:21.000000000","message":"-1: encrypted snapshot","commit_id":"dde5a8fa46f97aeba942e3b5cae5232f9799aa24"}]}
