Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Calculate allocated capacity and size on Get() across snaps of a volu…
Browse files Browse the repository at this point in the history
…me (#723)
  • Loading branch information
govint authored and Mark Sterin committed Nov 10, 2016
1 parent 3ed7f77 commit 6f6e5b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esx_service/utils/kvESX.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
# Results in a buffered, locked, filter-less open,
# all vmdks are opened with these flags
VMDK_OPEN_DEFAULT = 524312
VMDK_OPEN_NOIO = 524289
VMDK_OPEN_DISKCHAIN_NOIO = 524291
VMDK_MAX_SNAPS = 32

# Default kv side car alignment
KV_ALIGN = 4096
Expand Down Expand Up @@ -318,14 +319,14 @@ def get_info(volpath):
"""
Return disk stats for the volume
"""
dhandle = vol_open_path(volpath, VMDK_OPEN_NOIO)
dhandle = vol_open_path(volpath, VMDK_OPEN_DISKCHAIN_NOIO)

if not disk_is_valid(dhandle):
logging.warning("Failed to open disk - %x", volpath)
return None

sinfo = disk_info()
res = lib.DiskLib_GetSize(dhandle, 0, 1, byref(sinfo))
res = lib.DiskLib_GetSize(dhandle, 0, VMDK_MAX_SNAPS, byref(sinfo))

lib.DiskLib_Close(dhandle)
if res != 0:
Expand Down

0 comments on commit 6f6e5b8

Please # to comment.