)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"46da16dc122d0fc752ce0d76aa44ee129910bde2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"total amount of disk_over_committed in order to determine current hypervisor\u0027s"},{"line_number":11,"context_line":"available_disk_least."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In case instance disk file have allocated size greater than virtual"},{"line_number":14,"context_line":"disk size, resulting disk_over_committed is negative."},{"line_number":15,"context_line":"Because a negative value will inaccurately increase available_disk_least,"},{"line_number":16,"context_line":"the change proposes to set it to 0 instead."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Closes-Bug: #1872082"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4c43b2_9dcbf81c","line":16,"range":{"start_line":13,"start_character":0,"end_line":16,"end_character":43},"updated":"2020-04-14 13:39:57.000000000","message":"Can you include an example with a fully allocated qcow2 file?\n\n    $ qemu-img create -f qcow2 -o preallocation\u003dfull,size\u003d1G test.img\n    Formatting \u0027test.img\u0027, fmt\u003dqcow2 size\u003d1073741824 cluster_size\u003d65536 preallocation\u003dfull lazy_refcounts\u003doff refcount_bits\u003d16\n    $ qemu-img info test.img\n    image: test.img\n    file format: qcow2\n    virtual size: 1 GiB (1073741824 bytes)\n    disk size: 1 GiB\n    cluster_size: 65536\n    Format specific information:\n        compat: 1.1\n        lazy refcounts: false\n        refcount bits: 16\n        corrupt: false\n    $ du -h test.img \n    1.1G\ttest.img","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"036a8e3a7a78c74ac83063b40e82633776bc5164","unresolved":false,"context_lines":[{"line_number":10,"context_line":"total amount of disk_over_committed in order to determine current hypervisor\u0027s"},{"line_number":11,"context_line":"available_disk_least."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In case instance disk file have allocated size greater than virtual"},{"line_number":14,"context_line":"disk size, resulting disk_over_committed is negative."},{"line_number":15,"context_line":"Because a negative value will inaccurately increase available_disk_least,"},{"line_number":16,"context_line":"the change proposes to set it to 0 instead."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Closes-Bug: #1872082"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4c43b2_40f9877e","line":16,"range":{"start_line":13,"start_character":0,"end_line":16,"end_character":43},"in_reply_to":"3f4c43b2_605123d9","updated":"2020-04-14 13:58:44.000000000","message":"Yup apologies, missed it in the write up.","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":28332,"name":"Alexandre arents","email":"alexandre.arents@corp.ovh.com","username":"aarents"},"change_message_id":"f87f7b0db2abec2b3cad29301e19ecf2c9700cf2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"total amount of disk_over_committed in order to determine current hypervisor\u0027s"},{"line_number":11,"context_line":"available_disk_least."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In case instance disk file have allocated size greater than virtual"},{"line_number":14,"context_line":"disk size, resulting disk_over_committed is negative."},{"line_number":15,"context_line":"Because a negative value will inaccurately increase available_disk_least,"},{"line_number":16,"context_line":"the change proposes to set it to 0 instead."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Closes-Bug: #1872082"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f4c43b2_605123d9","line":16,"range":{"start_line":13,"start_character":0,"end_line":16,"end_character":43},"in_reply_to":"3f4c43b2_9dcbf81c","updated":"2020-04-14 13:49:10.000000000","message":"can you have a look to related bugs example?","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"46da16dc122d0fc752ce0d76aa44ee129910bde2","unresolved":false,"context_lines":[{"line_number":9691,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"},{"line_number":9692,"context_line":"                virt_size \u003d os.path.getsize(path)"},{"line_number":9693,"context_line":"                backing_file \u003d \"\""},{"line_number":9694,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9695,"context_line":""},{"line_number":9696,"context_line":"            elif disk_type \u003d\u003d \u0027block\u0027 and block_device_info:"},{"line_number":9697,"context_line":"                dk_size \u003d lvm.get_volume_size(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4c43b2_403b47d0","line":9694,"range":{"start_line":9694,"start_character":35,"end_line":9694,"end_character":67},"updated":"2020-04-14 13:39:57.000000000","message":"I\u0027m still not convinced that this is even possible tbh. Can you point to any examples of this?","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"99286352900980b09729401b19622355b9b4332a","unresolved":false,"context_lines":[{"line_number":9691,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"},{"line_number":9692,"context_line":"                virt_size \u003d os.path.getsize(path)"},{"line_number":9693,"context_line":"                backing_file \u003d \"\""},{"line_number":9694,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9695,"context_line":""},{"line_number":9696,"context_line":"            elif disk_type \u003d\u003d \u0027block\u0027 and block_device_info:"},{"line_number":9697,"context_line":"                dk_size \u003d lvm.get_volume_size(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4c43b2_e3324ba7","line":9694,"range":{"start_line":9694,"start_character":35,"end_line":9694,"end_character":67},"in_reply_to":"3f4c43b2_00001f67","updated":"2020-04-15 10:17:24.000000000","message":"Coming back to this, you\u0027ve shown in the bug that this can happen and I\u0027ve also reproduced it locally within my own devstack env below:\n\n$ qemu-img info --output json /opt/stack/data/nova/instances/7b33a03c-08c9-4ce8-8ee4-cd0bcc1228c1/disk\n{\n    \"virtual-size\": 21474836480,\n    \"filename\": \"/opt/stack/data/nova/instances/7b33a03c-08c9-4ce8-8ee4-cd0bcc1228c1/disk\",\n    \"format\": \"raw\",\n    \"actual-size\": 21474852864,\n    \"dirty-flag\": false\n}\n$ echo $(( 21474836480 - 21474852864 ))\n-16384\n\nAFAICT the call to fallocate after qemu-img resize is resulting in this:\n\n$ qemu-img info --output json _base/d7eb08a951b6d86f3c01b741c08a9fae1ae9cf85\n{\n    \"virtual-size\": 4294967296,\n    \"filename\": \"_base/d7eb08a951b6d86f3c01b741c08a9fae1ae9cf85\",\n    \"format\": \"raw\",\n    \"actual-size\": 1991196672,\n    \"dirty-flag\": false\n}\n$ cp -r _base/d7eb08a951b6d86f3c01b741c08a9fae1ae9cf85 disk_test\n$ qemu-img resize disk_test 20G\nWARNING: Image format was not specified for \u0027disk_test\u0027 and probing guessed raw.\n         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n         Specify the \u0027raw\u0027 format explicitly to remove the restrictions.\nImage resized.\n$ qemu-img info --output json disk_test \n{\n    \"virtual-size\": 21474836480,\n    \"filename\": \"disk_test\",\n    \"format\": \"raw\",\n    \"actual-size\": 3141537792,\n    \"dirty-flag\": false\n}\n$ fallocate -n -l20G disk_test \n$ qemu-img info --output json disk_test \n{\n    \"virtual-size\": 21474836480,\n    \"filename\": \"disk_test\",\n    \"format\": \"raw\",\n    \"actual-size\": 21474848768,\n    \"dirty-flag\": false\n}\n$ echo $(( 21474836480 - 21474848768 ))\n-12288\n\nWhile using qemu-img resize --preallocation\u003dfalloc under allocates for some reason:\n\n$ cp -r _base/d7eb08a951b6d86f3c01b741c08a9fae1ae9cf85 disk_test\n$ qemu-img resize --preallocation\u003dfalloc -f raw disk_test 20G\nImage resized.\n$ qemu-img info --output json disk_test \n{\n    \"virtual-size\": 21474836480,\n    \"filename\": \"disk_test\",\n    \"format\": \"raw\",\n    \"actual-size\": 20321419264,\n    \"dirty-flag\": false\n}\n$ echo $(( 21474836480 - 20321419264 ))\n1153417216","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":28332,"name":"Alexandre arents","email":"alexandre.arents@corp.ovh.com","username":"aarents"},"change_message_id":"f87f7b0db2abec2b3cad29301e19ecf2c9700cf2","unresolved":false,"context_lines":[{"line_number":9691,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"},{"line_number":9692,"context_line":"                virt_size \u003d os.path.getsize(path)"},{"line_number":9693,"context_line":"                backing_file \u003d \"\""},{"line_number":9694,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9695,"context_line":""},{"line_number":9696,"context_line":"            elif disk_type \u003d\u003d \u0027block\u0027 and block_device_info:"},{"line_number":9697,"context_line":"                dk_size \u003d lvm.get_volume_size(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4c43b2_c00477c9","line":9694,"range":{"start_line":9694,"start_character":35,"end_line":9694,"end_character":67},"in_reply_to":"3f4c43b2_403b47d0","updated":"2020-04-14 13:49:10.000000000","message":"see in related bugs.","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"036a8e3a7a78c74ac83063b40e82633776bc5164","unresolved":false,"context_lines":[{"line_number":9691,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"},{"line_number":9692,"context_line":"                virt_size \u003d os.path.getsize(path)"},{"line_number":9693,"context_line":"                backing_file \u003d \"\""},{"line_number":9694,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9695,"context_line":""},{"line_number":9696,"context_line":"            elif disk_type \u003d\u003d \u0027block\u0027 and block_device_info:"},{"line_number":9697,"context_line":"                dk_size \u003d lvm.get_volume_size(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4c43b2_00001f67","line":9694,"range":{"start_line":9694,"start_character":35,"end_line":9694,"end_character":67},"in_reply_to":"3f4c43b2_c00477c9","updated":"2020-04-14 13:58:44.000000000","message":"Thanks sorry missed it in the write up.","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":28332,"name":"Alexandre arents","email":"alexandre.arents@corp.ovh.com","username":"aarents"},"change_message_id":"aae2f35e75a34ca558f7b7c6f1475fd91851a530","unresolved":false,"context_lines":[{"line_number":9691,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"},{"line_number":9692,"context_line":"                virt_size \u003d os.path.getsize(path)"},{"line_number":9693,"context_line":"                backing_file \u003d \"\""},{"line_number":9694,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9695,"context_line":""},{"line_number":9696,"context_line":"            elif disk_type \u003d\u003d \u0027block\u0027 and block_device_info:"},{"line_number":9697,"context_line":"                dk_size \u003d lvm.get_volume_size(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_e7dfdad3","line":9694,"range":{"start_line":9694,"start_character":35,"end_line":9694,"end_character":67},"in_reply_to":"3f4c43b2_e3324ba7","updated":"2020-06-18 12:50:20.000000000","message":"I get the Lee point that for raw disk it should normaly not be negative, the issue is more on the way we fallocate or fallocate itself.\n\nMain issue is on qcow2, so I repush to only matter on qcow2 and no more RAW disk.","commit_id":"a51864d3a897ef2796d00226be0e9aaa142928c2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d9445196664e7504024b2d65cea77b826f611f4b","unresolved":false,"context_lines":[{"line_number":9861,"context_line":"                dk_size \u003d qemu_img_info.disk_size"},{"line_number":9862,"context_line":"                virt_size \u003d qemu_img_info.virtual_size"},{"line_number":9863,"context_line":"                backing_file \u003d libvirt_utils.get_disk_backing_file(path)"},{"line_number":9864,"context_line":"                over_commit_size \u003d max(0, int(virt_size) - dk_size)"},{"line_number":9865,"context_line":""},{"line_number":9866,"context_line":"            elif disk_type \u003d\u003d \u0027file\u0027:"},{"line_number":9867,"context_line":"                dk_size \u003d os.stat(path).st_blocks * 512"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_07e5aea8","line":9864,"range":{"start_line":9864,"start_character":15,"end_line":9864,"end_character":67},"updated":"2020-06-18 12:50:28.000000000","message":"clamping the value should be ok.\n\nthe extra disk space used when you have to pad a file for block allignemnt or other reason cannot be reused by other files so we should not consider any over allocation to be \"undercommit\" and subtract it when  calluating the overall over commit of a host for scheduling.","commit_id":"61084702f447d8d48f0aef161a9517d9504cd578"}]}
