)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"15efd6277bfceeaef93276afa7b91a3129dbb2f4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Deny volume swapping with non-bootable volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Presently, nova allows you to swap a volume used for booting an"},{"line_number":10,"context_line":"instance with a non-bootable volume. Since you are not allowed"},{"line_number":11,"context_line":"to use non-bootable volume for booting an instance so the same"},{"line_number":12,"context_line":"rule should be applied when you are trying to swap a bootable"},{"line_number":13,"context_line":"volume with a non-bootable volume."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7f287b81_9258c3fa","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":36},"updated":"2017-09-01 16:40:28.000000000","message":"If this is a bug we\u0027re going to fix, it\u0027s not just in Nova. The swap volume API was added to Nova for an operation started in Cinder, namely volume retype or migration. Cinder calls the swap_volume API (that\u0027s why it\u0027s admin-only by default). So if Nova is going to prevent this, Cinder should be doing it also if the volume being retyped/migrated is attached to an instance (it\u0027s status is \u0027in-use\u0027) and it\u0027s going from a bootable to a non-bootable volume.\n\nBut ^ really depends on if it\u0027s a volume used as the root volume (boot_index\u003d0) right? Isn\u0027t it possible to simply attach a bootable volume to an existing server created from an image with ephemeral storage as the root disk?","commit_id":"95fcf458917181f810f123bc2b35bcfd5cbb027c"}],"nova/compute/api.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"eb29a9a93933f610c62561502443d52cf1056212","unresolved":false,"context_lines":[{"line_number":3613,"context_line":"        if int(new_volume[\u0027size\u0027]) \u003c int(old_volume[\u0027size\u0027]):"},{"line_number":3614,"context_line":"            msg \u003d _(\"New volume must be the same size or larger.\")"},{"line_number":3615,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3616,"context_line":"        if not new_volume[\u0027bootable\u0027]:"},{"line_number":3617,"context_line":"            msg \u003d _(\"New volume must be a bootable volume.\")"},{"line_number":3618,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3619,"context_line":"        self.volume_api.check_detach(context, old_volume)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_35ed0326","line":3616,"range":{"start_line":3616,"start_character":0,"end_line":3616,"end_character":38},"updated":"2016-12-08 07:01:33.000000000","message":"If the old volume is not a root disk, this condition is not correct.\nFor example, boot a server from image (root disk is an ephemeral disk) and attach a cinder volume after it.","commit_id":"d4d2faa687a7d106569a75eb8455bc035359bc06"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3df7010fed2b308b48bf724b35d391b96e003280","unresolved":false,"context_lines":[{"line_number":3624,"context_line":"        if int(new_volume[\u0027size\u0027]) \u003c int(old_volume[\u0027size\u0027]):"},{"line_number":3625,"context_line":"            msg \u003d _(\"New volume must be the same size or larger.\")"},{"line_number":3626,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3627,"context_line":"        if compute_utils.is_volume_backed_instance("},{"line_number":3628,"context_line":"            context, instance) and not new_volume[\u0027bootable\u0027]:"},{"line_number":3629,"context_line":"            msg \u003d _(\"New volume must be a bootable volume.\")"},{"line_number":3630,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3631,"context_line":"        self.volume_api.check_detach(context, old_volume)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_ea3f3c85","line":3628,"range":{"start_line":3627,"start_character":11,"end_line":3628,"end_character":61},"updated":"2017-02-16 12:31:00.000000000","message":"The condition whether the old volume is a root device volume or not should be added.\nIf the old volume is a root device volume, the new volume should be a bootable volume.\nIf the old volume is not a root device volume (For example, a second attached volume to volume backed instance), the new volume does not have to be a bootable volume.","commit_id":"60d5412233ef0b3b10bdd5e537034ce40709a428"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"80297694ff502fb740da29c30a64f97d0fde7e2e","unresolved":false,"context_lines":[{"line_number":2514,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":2515,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":2516,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"},{"line_number":2517,"context_line":"        self.assertEqual(volumes[old_volume_id][\u0027status\u0027], \u0027in-use\u0027)"},{"line_number":2518,"context_line":"        self.assertEqual(volumes[new_volume_id][\u0027status\u0027], \u0027available\u0027)"},{"line_number":2519,"context_line":""},{"line_number":2520,"context_line":"        # Should succeed if instance is volume backed and new volume is"},{"line_number":2521,"context_line":"        # bootable"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a1ced50_dce1882b","line":2518,"range":{"start_line":2517,"start_character":0,"end_line":2518,"end_character":71},"updated":"2017-03-23 08:19:07.000000000","message":"nit: assertEqual(expected, actual)\n\nex.\nself.assertEqual(\u0027in-use\u0027, volumes[old_volume_id][\u0027status\u0027])","commit_id":"56f9c950e7c230c8e5c6090becb86ac2beb450a8"}]}
