Bug #867

Image size is not accurate for empty files

Added by Carlos Martín almost 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:10/05/2011
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - Auth
Target version:Release 3.2 - S0
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.0

Description

If a file created with 'dd' is registered as an Image, its size is not entirely calculated. This could be related to the 'du' command.

To reproduce:

$ dd if=/dev/zero of=test.img bs=1024 count=0 seek=102400
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000101136 s, 0.0 kB/s

$ ls -lh test.img 
-rw-r--r-- 1 cmartin dialout 100M 2011-10-05 09:19 test.img

$ du -m test.img 
50    test.img

$ oneimage list
  ID USER     GROUP    NAME            SIZE TYPE          REGTIME PUB PER STAT  RVMS
   0 oneadmin oneadmin test              0M   OS   10/05 09:22:35  No  No  rdy     0

Associated revisions

Revision dfa237b2
Added by Jaime Melis over 9 years ago

Bug #867: Image size is not accurate for empty files.

Revision ee76f711
Added by Ruben S. Montero over 9 years ago

bug #867: Minor change to du function

Revision 60081cc3
Added by Jaime Melis over 9 years ago

Bug #867: Image size is not accurate for empty files.
(cherry picked from commit dfa237b2eeb9099478a9345819f0937e14d4a538)

Revision a43fce97
Added by Ruben S. Montero over 9 years ago

bug #867: Minor change to du function
(cherry picked from commit ee76f711fdc35daef8c488ea863d9d6c9de36a1e)

Revision d690e728
Added by Ruben S. Montero over 9 years ago

bug #867: Postpone qcow2 management to integrate it with quota system

Revision 8b6db335
Added by Ruben S. Montero over 9 years ago

bug #867: Postpone qcow2 management to integrate it with quota system
(cherry picked from commit d690e728d0d36f0dcaa67f805b4b65e79c134920)

History

#1 Updated by Ruben S. Montero almost 10 years ago

  • Target version set to Release 3.2 - S0

#2 Updated by Ruben S. Montero almost 10 years ago

  • Assignee set to Jaime Melis

#3 Updated by Jaime Melis over 9 years ago

  • Status changed from New to Assigned

Use 'stat' instead of 'du'. If 'qemu-img' is available it uses that command which is more accurate for other filetypes such as qcow.

#4 Updated by Ruben S. Montero over 9 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Also available in: Atom PDF