)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6a280b4ae2c8e7024bd9b0e2452f458da1bd7fa1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"creation of volumes where min_gb \u003e volume_size, however, min_gb is a"},{"line_number":11,"context_line":"field that\u0027s provided by the user and may not be filled in."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In the case that it is not provided, the API will not fail at acceping"},{"line_number":14,"context_line":"that request but it will fail later inside the compute manager without"},{"line_number":15,"context_line":"a proper error message."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf51134e_e802d86e","line":13,"range":{"start_line":13,"start_character":62,"end_line":13,"end_character":70},"updated":"2020-06-22 11:06:45.000000000","message":"nit: accepting","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"}],"nova/compute/api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6a280b4ae2c8e7024bd9b0e2452f458da1bd7fa1","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_c81b947e","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"updated":"2020-06-22 11:06:45.000000000","message":"This is correct but it might not be enough. The size of the image in glance is the physical file size of the glance image. However that image might have a virtual_size that is a lot bigger (and a partition in the image that refers to the disk space of the virtual size)","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"29db8e1317e0085ceffbf2f248166a5182dcf479","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_182dcafd","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"9f560f44_088621dc","updated":"2020-08-04 09:34:28.000000000","message":"I didn\u0027t see a microversion documented as a requirement for getting virtual_size out of g-api.\n\nYeah I\u0027m not sure what the failure path is here, c-vol will eventually fail with the following virtual_size check but I think that\u0027s async and so the volume would just be in an ERROR state when we try to launch on the compute:\n\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/flows/manager/create_volume.py#L980-L984\n\nhttps://github.com/openstack/cinder/blob/master/cinder/image/image_utils.py#L806-L817\n\nFailing here would be much much nicer and something I had on my TODO list tbh. Well, I was going to add this check in _validate_bdm but as the comment above suggests we can refactor these checks into that method later after this.","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6fd72e5ba6bd78fb7372d5824b99544355e6f1a8","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_3b7368b3","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"9f560f44_182dcafd","updated":"2020-08-04 10:17:15.000000000","message":"oh i see its not optional based on if you asked with a specific microversion its optional based on if you set a virtual size on the commandline when you uploaded the image\n\nthis feels like something that should get auto populateded by glance as part of there import workflow. perhaps it should be a feature request for a new import plugin that would do that.\nkind of like the image convert plugin but in this case just one that populates the virtual_size\n\nif there is no microversion then what you as is trivial to add\n\n     # in bytes.\n     image_virtual_size \u003d int(image.get(\u0027virtual_size\u0027) or 0) * units.Gi\n\n      if image_virtual_size \u003e dest_size:\n          raise exception.VolumeSmallerThanMinDisk(\n              volume_size\u003ddest_size, image_min_disk\u003dimage_virtual_size)","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f540505a1a3565ca6d77ed0c4271973a13c1bc45","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_7bca004e","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"9f560f44_3b7368b3","updated":"2020-08-04 10:49:34.000000000","message":"virtual_size should already be in bytes so we shouldn\u0027t need to convert it from GiBs here.\n\n  image_virtual_size \u003d int(image.get(\u0027virtual_size\u0027, 0))","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"9b4ce910f48163c2818b30a044d48777cbd56654","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_9bfb9477","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"9f560f44_7bca004e","updated":"2020-08-04 10:54:28.000000000","message":"ops sorry forgot that can be None:\n\n  image_virtual_size \u003d int(image.get(\u0027virtual_size\u0027) or 0))\n\nAnyway you get the point.","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1ad1d2568353ccdd581fd8fe8997f54cd189aff4","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_088621dc","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"9f560f44_88c4f160","updated":"2020-08-04 00:23:53.000000000","message":"if it can be then yes by all means.\nwe were not checking it before so it does not make the current change incorrect\nthat is just another level of validation we can do\nbut the more we can do here the less likely we are to have a late fail on the comptue node so it makes sense to add it if we have the required glance microverion aviable","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"c1f450c661ba7169b036f50f6c3ac6c97de4b776","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_88c4f160","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"bf51134e_03ae0d97","updated":"2020-08-03 23:45:40.000000000","message":"The virtual_size can be reported by g-api so IMHO it does need to be checked here when available.","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"07b8ca27a6a1739e77bfc206d46c4c5e8177cbc6","unresolved":false,"context_lines":[{"line_number":678,"context_line":"            if dest_size is not None:"},{"line_number":679,"context_line":"                dest_size *\u003d units.Gi"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"                if image_size \u003e dest_size:"},{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_03ae0d97","line":681,"range":{"start_line":681,"start_character":19,"end_line":681,"end_character":42},"in_reply_to":"bf51134e_c81b947e","updated":"2020-06-22 11:31:02.000000000","message":"yes but that is already checked on the compute node.\nwitout downloading the image which we dont want to do in the api we cant check the virtual size so we know if the pysical size is larger then the requested volume it defintly cant fit.\nthe next check also valids if the min_disk in the image is  smaller then the image which is again another way that operators could inform us fo the requirements.\n\nif both pass then we leave it to the compute node which has the image to validate the virtual size.\n\nso even if this is not a complete test of validity i think its an improvement over what we have today and is likely the most resonable thing we can test give we do not want to donwload the actual image to verify its virtual size.","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"db4c4be60730961cebb0ef33fd63aee2450db9a7","unresolved":false,"context_lines":[{"line_number":682,"context_line":"                    raise exception.VolumeSmallerThanImage("},{"line_number":683,"context_line":"                        volume_size\u003ddest_size, image_size\u003dimage_size)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"                if image_min_disk \u003e dest_size:"},{"line_number":686,"context_line":"                    raise exception.VolumeSmallerThanMinDisk("},{"line_number":687,"context_line":"                        volume_size\u003ddest_size, image_min_disk\u003dimage_min_disk)"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"        # Target disk is a local disk whose size is taken from the flavor"},{"line_number":690,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6ea8a276","line":687,"range":{"start_line":685,"start_character":14,"end_line":687,"end_character":77},"updated":"2020-06-19 21:17:45.000000000","message":"so this is our existing check and the new check is testing if the actual size of the image is larger then the volume.\n\nits posisble that the the dest size is still not enough for the applicaiton within the image to work properly but i think checking we can at least unpack the image which is what the new check is testing is an improvement.","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"}],"nova/exception.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"db4c4be60730961cebb0ef33fd63aee2450db9a7","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"                \"minimum size is %(image_min_disk)i bytes.\")"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":""},{"line_number":1170,"context_line":"class VolumeSmallerThanImage(FlavorDiskTooSmall):"},{"line_number":1171,"context_line":"    msg_fmt \u003d _(\"Volume is too small for requested image. Volume size is \""},{"line_number":1172,"context_line":"                \"%(volume_size)i bytes, image is %(image_size)i bytes.\")"},{"line_number":1173,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6ed6e2f3","line":1170,"range":{"start_line":1170,"start_character":29,"end_line":1170,"end_character":47},"updated":"2020-06-19 21:17:45.000000000","message":"since this inherits form FlavorDiskTooSmall\n\nit will be handeled by \n\nhttps://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/servers.py#L57-L90\n\nwhich is used in create \nhttps://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/servers.py#L763-L764\n\nresize\nhttps://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/servers.py#L979-L980\n\nand rebuild\nhttps://github.com/openstack/nova/blob/6f6b63ee5f7ae180d5f81e61f04332f7aa14f9be/nova/api/openstack/compute/servers.py#L1134-L1135","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"76892643a86ad108f8e6f2953fe47f97427e5e02","unresolved":false,"context_lines":[{"line_number":13317,"context_line":"        # A bdm object volume smaller than the image\u0027s size should not be"},{"line_number":13318,"context_line":"        # allowed"},{"line_number":13319,"context_line":"        image_uuid \u003d uuids.fake"},{"line_number":13320,"context_line":"        image \u003d dict(id\u003dimage_uuid, status\u003d\u0027active\u0027,"},{"line_number":13321,"context_line":"                     size\u003d(self.instance_type.root_gb + 10) * units.Gi,"},{"line_number":13322,"context_line":"                     min_disk\u003dself.instance_type.root_gb + 1)"},{"line_number":13323,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_66497e5e","line":13320,"range":{"start_line":13320,"start_character":16,"end_line":13320,"end_character":21},"updated":"2020-06-26 17:10:25.000000000","message":"nit: eeew\n\nit\u0027s done elsewhere here though so I can\u0027t complain","commit_id":"18f274c449e84a29de2461b3ec1144b53f8f7e41"}]}
