[one-users] Any way to force a recalculate of image size and quota use?

Graeme Gillies graeme.r.gillies at gmail.com
Sun Dec 4 19:08:36 PST 2011


Hi,

I recently upgraded our opennebula environment to 3.0 and as part of
that move I switched from sqlite to mysql database, forcing me to
basically start again and re-import all our images, vms, templates,
networks etc.

I did most the work as the oneadmin user, for example, importing all
users images, then used

oneimage chown $imageid $username users

to give the images back to the original owner.

This has all seemed to go fine, however, during the import I noticed a
couple of the bigger images have had their size reported incorrectly
in opennebula

  ID USER     GROUP    NAME            SIZE TYPE          REGTIME PUB
PER STAT  RVMS
  14 <hidden> users    <hidden>-storage   14.6G   DB   12/04 09:55:48
No Yes used     1

IMAGE 14 INFORMATION
ID             : 14
NAME           : <hidden>-storage
USER           : <hiden>
GROUP          : users
TYPE           : DATABLOCK
REGISTER TIME  : 12/04 09:55:48
PUBLIC         : No
PERSISTENT     : Yes
SOURCE         : /var/lib/one/images/1e5164009f66cb87de73b6f4c29c9317
SIZE           : 14903
STATE          : used
RUNNING_VMS    : 1

but the size of that disk is much larger

ls -lah /var/lib/one/images/1e5164009f66cb87de73b6f4c29c9317

-rw-rw---- 1 oneadmin oneadmin 49G Dec  4 20:26
/var/lib/one/images/1e5164009f66cb87de73b6f4c29c9317

Is there anyway (either through the tools, or someone just writing a
ruby script using the opennebula libraries) to make opennebula go
through each image in the database and confirm the size is correct to
what is on disk? To solve these discrepancies.

Also, I enabled the quota module for my installation, and restarted
oned. When I do onequota show $userid It gives me

 uid          cpu       memory      num_vms      storage
   6          0/3       0/4096          0/3      0/20480

Even though the user does indeed have vms running (and disk images
used). Can a similar thing be done as above, and force oneauth to
recalculate the quota usage for everyone?

Regards,

Graeme



More information about the Users mailing list