disk image create creates image size of atleast 1G

Bug #1366909 reported by jsb
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
Medium
yogananth subramanian

Bug Description

disk image create creates a qcow2 image with virtual size of atleast 1G. If DISK-IMAGE-SIZE is used in decimals,then, truncate command errors out as invalid number. This forces the image to be atleast 1G in size. Could this made in Mega bytes so that image less than 1 G can be created.
Thanks

Revision history for this message
Thang Pham (thang-pham) wrote :

Could you be more specific with how you ran into this error? Which commands did you run? How do you recreate this bug?

Just guessing what you did, I tried to use a decimal in my image-size, and got the expected error:

$ nova boot --flavor x1.tiny --block-device source=image,id=2913cff0-a7aa-463a-af95-60dd9cf5e401,dest=volume,size=3.5,shutdown=remove,bootindex=0 --key-name stack test1ERROR (BadRequest): Block Device Mapping is Invalid: Invalid volume_size. (HTTP 400) (Request-ID: req-6b92b300-336e-4cfd-ac80-a7ebf22df063)

Changed in nova:
status: New → Incomplete
Revision history for this message
jsb (jay-s-b) wrote :

This happens at the time of creation of user image. I tried creating a simple operating system by setting DIB_IMAGE_SIZE to 0.8 .
diskimage-builder/bin/disk-image-create command fails at
truncate: invalid number `0.8G'
umount2: Invalid argument
umount: /tmp/image.skD9govK: not mounted
umount2: Invalid argument

Works fine if DIB_IMAGE_SIZE is not a decimal number.

Thanks

Revision history for this message
Thang Pham (thang-pham) wrote :

Ok, diskimage-builder is not a nova component. It is it's own project.

affects: nova → diskimage-builder
Changed in diskimage-builder:
status: Incomplete → New
Changed in diskimage-builder:
status: New → Triaged
importance: Undecided → Medium
Changed in diskimage-builder:
assignee: nobody → yogananth subramanian (anantyog-o)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/190026

Changed in diskimage-builder:
status: Triaged → In Progress
Changed in diskimage-builder:
assignee: yogananth subramanian (anantyog-o) → Ben Nemec (bnemec)
Ben Nemec (bnemec)
Changed in diskimage-builder:
assignee: Ben Nemec (bnemec) → yogananth subramanian (anantyog-o)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.openstack.org/190026
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=f84b910f152220294a723836a71586974efadede
Submitter: Jenkins
Branch: master

commit f84b910f152220294a723836a71586974efadede
Author: yogananth subramanian <email address hidden>
Date: Wed Jun 10 10:55:13 2015 +0530

    Enable decimal value for $DIB_IMAGE_SIZE.

    Patch adds support for using decimal values for $DIB_IMAGE_SIZE.
    This allows for creating images that are <1G in size.

    Change-Id: I945644a8e77fecfb0b83efa282dc00bb29514e0b
    Closes-Bug: #1366909

Changed in diskimage-builder:
status: In Progress → Fix Committed
Changed in diskimage-builder:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.