Unfortunately, I don't think there is a good answer to this unless you had 
created a snapshot of the clone before you made any modifications.  The problem 
is that 'rbd diff' will always include the parent image diffs (as you've 
discovered) unless a snapshot is specified.

The forthcoming infernalis release includes a new "rbd disk-usage <image-spec>" 
command which will accomplish what you desire.  It rounds up per-object usage 
to the full object size for speed, which is probably a closer representation of 
actual OSD disk usage anyway.  If you are feeling experimental, you could 
install the infernalis-based rbd tools from the Ceph gitbuilder [1] into a 
sandbox environment and use the tool against your pre-infernalis cluster.

[1] http://ceph.com/gitbuilder.cgi

-- 

Jason Dillaman 


----- Original Message -----
> From: "Corin Langosch" <[email protected]>
> To: [email protected]
> Sent: Friday, October 9, 2015 4:42:50 AM
> Subject: [ceph-users] how to get cow usage of a clone
> 
> Hi,
> 
> to get the real usage of an image I can run:
> 
> rbd diff image1 | awk '{ SUM += $2 } END { print SUM/1024/1024 " MB" }'
> 
> To get the cow usage of a snapshot:
> 
> rbd diff image1 --from-snap snap1 | awk '{ SUM += $2 } END { print
> SUM/1024/1024 " MB" }'
> 
> But I wonder how I can get the cow usage of a clone? I tried passing an
> absolute snapshot name "image1@snap1" but that
> doesn't work.
> 
> rbd diff clone1 --from-snap image1@snap1 | awk '{ SUM += $2 } END { print
> SUM/1024/1024 " MB" }'
> rbd: diff error: (2) No such file or directory
> 
> Thanks for any help.
> 
> Corin
> _______________________________________________
> ceph-users mailing list
> [email protected]
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
> 
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to