From: Nish Aravamudan <nish.aravamudan@canonical.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid
Date: Thu, 04 Aug 2016 15:21:19 -0000 [thread overview]
Message-ID: <20160804152119.GA29928@pitfall> (raw)
In-Reply-To: 20160804104947.16543.58249.malone@chaenomeles.canonical.com
On 04.08.2016 [10:49:47 -0000], Robie Basak wrote:
> Uploaded to Xenial, thanks. Am I right in thinking that the new option
> force_size is required to be used with the patch to fix the problem?
> It's probably worth mentioning this in the Test Case in the bug
> description; otherwise it will appear to testers that the fix doesn't
> work.
Agreed, updated.
** Description changed:
[Impact]
- * Starting with a raw disk image, using "qemu-img convert" to convert
+ * Starting with a raw disk image, using "qemu-img convert" to convert
from raw to VHD results in the output VHD file's virtual size being
aligned to the nearest 516096 bytes (16 heads x 63 sectors per head x
512 bytes per sector), instead of preserving the input file's size as
the output VHD's virtual disk size.
- * Microsoft Azure requires that disk images (VHDs) submitted for upload
+ * Microsoft Azure requires that disk images (VHDs) submitted for upload
have virtual sizes aligned to a megabyte boundary. (Ex. 4096MB, 4097MB,
4098MB, etc. are OK, 4096.5MB is rejected with an error.) This is
reflected in Microsoft's documentation: https://azure.microsoft.com/en-
us/documentation/articles/virtual-machines-linux-create-upload-vhd-
generic/
- * The fix for this bug is a backport from upstream.
+ * The fix for this bug is a backport from upstream.
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=fb9245c2610932d33ce14
[Test Case]
- * This is reproducible with the following set of commands (including
+ * This is reproducible with the following set of commands (including
the Azure command line tools from https://github.com/Azure/azure-xplat-
cli). For the following example, I used qemu version 2.2.1:
$ dd if=/dev/zero of=source-disk.img bs=1M count=4096
$ stat source-disk.img
File: ‘source-disk.img’
Size: 4294967296 Blocks: 798656 IO Block: 4096 regular file
Device: fc01h/64513d Inode: 13247963 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ smkent) Gid: ( 1000/ smkent)
Access: 2015-08-18 09:48:02.613988480 -0700
Modify: 2015-08-18 09:48:02.825985646 -0700
Change: 2015-08-18 09:48:02.825985646 -0700
Birth: -
$ qemu-img convert -f raw -o subformat=fixed -O vpc source-disk.img
dest-disk.vhd
$ stat dest-disk.vhd
File: ‘dest-disk.vhd’
Size: 4296499712 Blocks: 535216 IO Block: 4096 regular file
Device: fc01h/64513d Inode: 13247964 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ smkent) Gid: ( 1000/ smkent)
Access: 2015-08-18 09:50:22.252077624 -0700
Modify: 2015-08-18 09:49:24.424868868 -0700
Change: 2015-08-18 09:49:24.424868868 -0700
Birth: -
$ azure vm image create testimage1 dest-disk.vhd -o linux -l "West US"
info: Executing command vm image create
+ Retrieving storage accounts
info: VHD size : 4097 MB
info: Uploading 4195800.5 KB
Requested:100.0% Completed:100.0% Running: 0 Time: 1m 0s Speed: 6744 KB/s
info: https://[redacted].blob.core.windows.net/vm-images/dest-disk.vhd was uploaded successfully
error: The VHD https://[redacted].blob.core.windows.net/vm-images/dest-disk.vhd has an unsupported virtual size of 4296499200 bytes. The size must be a whole number (in MBs).
info: Error information has been recorded to /home/smkent/.azure/azure.err
error: vm image create command failed
- * A fixed qemu-img will not result in an error during azure image
- creation.
+ * A fixed qemu-img will not result in an error during azure image
+ creation. It will require passing -o force_size, which will leverage the
+ backported functionality.
[Regression Potential]
- * The upstream fix introduces a qemu-img option (-o force_size) which
+ * The upstream fix introduces a qemu-img option (-o force_size) which
is unset by default. The regression potential is very low, as a result.
...
I also ran the above commands using qemu 2.4.0, which resulted in the
same error as the conversion behavior is the same.
However, qemu 2.1.1 and earlier (including qemu 2.0.0 installed by
Ubuntu 14.04) does not pad the virtual disk size during conversion.
Using qemu-img convert from qemu versions <=2.1.1 results in a VHD that
is exactly the size of the raw input file plus 512 bytes (for the VHD
footer). Those qemu versions do not attempt to realign the disk. As a
result, Azure accepts VHD files created using those versions of qemu-img
convert for upload.
Is there a reason why newer qemu realigns the converted VHD file? It
would be useful if an option were added to disable this feature, as
current versions of qemu cannot be used to create VHD files for Azure
using Microsoft's official instructions.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1490611
Title:
Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to
the result file, which Microsoft Azure rejects as invalid
Status in QEMU:
Fix Released
Status in qemu package in Ubuntu:
Fix Released
Status in qemu source package in Xenial:
In Progress
Bug description:
[Impact]
* Starting with a raw disk image, using "qemu-img convert" to convert
from raw to VHD results in the output VHD file's virtual size being
aligned to the nearest 516096 bytes (16 heads x 63 sectors per head x
512 bytes per sector), instead of preserving the input file's size as
the output VHD's virtual disk size.
* Microsoft Azure requires that disk images (VHDs) submitted for
upload have virtual sizes aligned to a megabyte boundary. (Ex. 4096MB,
4097MB, 4098MB, etc. are OK, 4096.5MB is rejected with an error.) This
is reflected in Microsoft's documentation: https://azure.microsoft.com
/en-us/documentation/articles/virtual-machines-linux-create-upload-
vhd-generic/
* The fix for this bug is a backport from upstream.
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=fb9245c2610932d33ce14
[Test Case]
* This is reproducible with the following set of commands (including
the Azure command line tools from https://github.com/Azure/azure-
xplat-cli). For the following example, I used qemu version 2.2.1:
$ dd if=/dev/zero of=source-disk.img bs=1M count=4096
$ stat source-disk.img
File: ‘source-disk.img’
Size: 4294967296 Blocks: 798656 IO Block: 4096 regular file
Device: fc01h/64513d Inode: 13247963 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ smkent) Gid: ( 1000/ smkent)
Access: 2015-08-18 09:48:02.613988480 -0700
Modify: 2015-08-18 09:48:02.825985646 -0700
Change: 2015-08-18 09:48:02.825985646 -0700
Birth: -
$ qemu-img convert -f raw -o subformat=fixed -O vpc source-disk.img
dest-disk.vhd
$ stat dest-disk.vhd
File: ‘dest-disk.vhd’
Size: 4296499712 Blocks: 535216 IO Block: 4096 regular file
Device: fc01h/64513d Inode: 13247964 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ smkent) Gid: ( 1000/ smkent)
Access: 2015-08-18 09:50:22.252077624 -0700
Modify: 2015-08-18 09:49:24.424868868 -0700
Change: 2015-08-18 09:49:24.424868868 -0700
Birth: -
$ azure vm image create testimage1 dest-disk.vhd -o linux -l "West US"
info: Executing command vm image create
+ Retrieving storage accounts
info: VHD size : 4097 MB
info: Uploading 4195800.5 KB
Requested:100.0% Completed:100.0% Running: 0 Time: 1m 0s Speed: 6744 KB/s
info: https://[redacted].blob.core.windows.net/vm-images/dest-disk.vhd was uploaded successfully
error: The VHD https://[redacted].blob.core.windows.net/vm-images/dest-disk.vhd has an unsupported virtual size of 4296499200 bytes. The size must be a whole number (in MBs).
info: Error information has been recorded to /home/smkent/.azure/azure.err
error: vm image create command failed
* A fixed qemu-img will not result in an error during azure image
creation. It will require passing -o force_size, which will leverage
the backported functionality.
[Regression Potential]
* The upstream fix introduces a qemu-img option (-o force_size) which
is unset by default. The regression potential is very low, as a
result.
...
I also ran the above commands using qemu 2.4.0, which resulted in the
same error as the conversion behavior is the same.
However, qemu 2.1.1 and earlier (including qemu 2.0.0 installed by
Ubuntu 14.04) does not pad the virtual disk size during conversion.
Using qemu-img convert from qemu versions <=2.1.1 results in a VHD
that is exactly the size of the raw input file plus 512 bytes (for the
VHD footer). Those qemu versions do not attempt to realign the disk.
As a result, Azure accepts VHD files created using those versions of
qemu-img convert for upload.
Is there a reason why newer qemu realigns the converted VHD file? It
would be useful if an option were added to disable this feature, as
current versions of qemu cannot be used to create VHD files for Azure
using Microsoft's official instructions.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1490611/+subscriptions
next prev parent reply other threads:[~2016-08-04 15:31 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 15:29 [Qemu-devel] [Bug 1490611] [NEW] Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid Stephen Kent
2016-01-13 6:41 ` [Qemu-devel] [Bug 1490611] " Jan
2016-01-13 19:26 ` Stephen Kent
2016-01-14 7:24 ` willmo
2016-02-16 0:14 ` Cole Mickens
2016-02-16 0:30 ` Cole Mickens
2016-02-16 9:21 ` Kevin Wolf
2016-02-16 18:24 ` Stephen A. Zarkos
2016-02-16 19:30 ` Jeff Cody
2016-02-18 21:57 ` Cole Mickens
2016-02-24 3:31 ` Jeff Cody
2016-02-24 18:07 ` Cole Mickens
2016-02-24 18:22 ` Jeff Cody
2016-02-24 18:33 ` Cole Mickens
2016-03-10 10:00 ` Jan
2016-06-22 11:03 ` T. Huth
2016-06-28 15:52 ` Serge Hallyn
2016-06-28 15:57 ` Launchpad Bug Tracker
2016-06-28 15:57 ` Serge Hallyn
2016-07-14 18:03 ` Nish Aravamudan
2016-07-14 18:25 ` Nish Aravamudan
2016-07-14 18:32 ` Nish Aravamudan
2016-07-14 18:33 ` [Qemu-devel] [Bug 1490611] Nish Aravamudan
2016-07-15 22:20 ` [Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid Nish Aravamudan
2016-08-02 20:17 ` Nish Aravamudan
2016-08-04 4:33 ` Mathew Hodson
2016-08-04 10:49 ` Robie Basak
2016-08-04 15:21 ` Nish Aravamudan [this message]
2016-08-04 21:15 ` Robie Basak
2016-08-04 21:21 ` [Qemu-devel] [Bug 1490611] Nish Aravamudan
2016-08-05 9:02 ` [Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid Robie Basak
2016-08-11 22:27 ` Brian Murray
2016-08-17 13:12 ` Chris J Arges
2016-08-17 17:20 ` Nish Aravamudan
2016-08-19 22:42 ` Nish Aravamudan
2016-08-19 22:44 ` [Qemu-devel] [Bug 1490611] Nish Aravamudan
2017-02-13 21:08 ` [Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid Alexandre
2017-02-17 22:29 ` Nish Aravamudan
2017-02-20 7:19 ` ChristianEhrhardt
2017-02-20 16:39 ` ChristianEhrhardt
2017-02-22 15:41 ` ChristianEhrhardt
2017-02-23 13:22 ` ChristianEhrhardt
2017-02-23 13:26 ` ChristianEhrhardt
2017-03-06 15:51 ` ChristianEhrhardt
2017-03-23 20:34 ` Brian Murray
2017-03-24 7:30 ` ChristianEhrhardt
2017-03-31 5:01 ` Steve Langasek
2017-03-31 5:02 ` Launchpad Bug Tracker
2017-03-31 5:03 ` [Qemu-devel] [Bug 1490611] Update Released Steve Langasek
2018-09-01 5:57 ` [Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid Andy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160804152119.GA29928@pitfall \
--to=nish.aravamudan@canonical.com \
--cc=1490611@bugs.launchpad.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).