For delta.vmdks I used a script to extract some useful details from the header.
Does anybody has something similar for sesparse.vmdks ?
===========================================================================
#!/bin/sh
# Display some basic details for a VMware ESXi - Delta.vmdk
echo
echo '### SNAPSHOT INFO '
echo 'file snapinfo: ' "$1"
hexdump -n 4 -v -e '"magic : " 4/4 "%s" "\n"' "$1" | grep -v /vmfs
hexdump -s 12 -n 4 -v -e '"size basedisk : " "%4u" "\n"' "$1" | grep -v /vmfs
hexdump -s 28 -n 4 -v -e '"min size delta : " "%4u" "\n"' "$1" | grep -v /vmfs
echo '-------------------------------------------------------------------'
echo
=========================================================================
A script like that is required to figure out to which basedisk a sesparse.vmdk belongs after the user renamed files.
Thank you
Ulli
I created 2 disks real quick, one with 10GB and another with 100GB provisioned size.
If you want another size, let me know.
10 GB
100 GB
André
I didn't so much with sesparse files so far, and there's not much documentation available.
However, maybe the following will help you.
https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg04459.html
I did create a small script based on that information, to display the metadata of a 40GB sample sesparse file.
André
Hi Andre
the decimal value for capacity may be what I need
it uses 2 x the value for numbers of sectors in the descriptorsize.
Do you have another sesparse.vmdk available to check the assumption ?
Ulli
I created 2 disks real quick, one with 10GB and another with 100GB provisioned size.
If you want another size, let me know.
10 GB
100 GB
André
Thanks a lot
looks like a small change will do the job.
Instead of
hexdump -s 12 -n 4 -v -e '"size basedisk : " "%4u" "\n"' "$1" | grep -v /vmfs
I will try with
hexdump -s 16 -n 4 -v -e '"size basedisk : " "%4u" "\n"' "$1" | grep -v /vmfs
I will keep you updated - need to create some sesparse testfiles now ...
Ulli
Perfect service Andre 🙂
Mission accomplished:
Sample output
-------------------------------------------------------------------
moon@debserv:~/Downloads$ ./sesparse-info.sh SeSparse-Test-10GB-000001-sesparse.vmdk
### SESPARSE SNAPSHOT INFO
file : SeSparse-Test-10GB-000001-sesparse.vmdk
size basedisk : 20971520
-------------------------------------------------------------------
moon@debserv:~/Downloads$ ./sesparse-info.sh SeSparse-Test-100GB-000001-sesparse.vmdk
### SESPARSE SNAPSHOT INFO
file : SeSparse-Test-100GB-000001-sesparse.vmdk
size basedisk : 209715200
-------------------------------------------------------------------
script:
#!/bin/sh
# Display some basic details for a VMware ESXi - Sesparse.vmdk
echo
echo '### SESPARSE SNAPSHOT INFO '
echo 'file : ' "$1"
# hexdump -n 4 -v -e '"magic : " 4/4 "%s" "\n"' "$1" | grep -v /vmfs
hexdump -s 16 -n 4 -v -e '"size basedisk : " "%4u" "\n"' "$1" | grep -v /vmfs
# hexdump -s 28 -n 4 -v -e '"min size delta : " "%4u" "\n"' "$1" | grep -v /vmfs
echo '-------------------------------------------------------------------'
echo
echo
You are reading only 4 bytes instead of 8. The size is a 64 bit value.
André
Oops - you are right.
Got to do some google about how to format the hexdump ...
Ulli
Bingo - that looks good
sample output:
Note the red lines ...
root@debserv:/home/moon/esxi-rw/testvm# ./vmfs-file-info.sh testvm-flat.vmdk
### VMFS6 FILE INFO
file : testvm-flat.vmdk
magic : 109063eb
basedisk capacity: 13332344569296109307
bootflag : aa55
-------------------------------------------------------------------
root@debserv:/home/moon/esxi-rw/testvm# ./vmfs-file-info.sh testvm-000001-sesparse.vmdk
### VMFS6 FILE INFO
file : testvm-000001-sesparse.vmdk
magic : cafebabe
basedisk capacity: 33554432
bootflag : 0000
-------------------------------------------------------------------
root@debserv:/home/moon/esxi-rw/testvm# ./vmfs-file-info.sh testvm_1-000001-sesparse.vmdk
### VMFS6 FILE INFO
file : testvm_1-000001-sesparse.vmdk
magic : cafebabe
basedisk capacity: 34359738368
bootflag : 0000
-------------------------------------------------------------------
testvm-000001-sesparse.vmdk is a sesparse snapshot for a 16GB vmdk ### - magic is cafebabe
testvm_1-000001-sesparse.vmdk is a sesparse snapshot for a 16TB vmdk ### - magic is cafebabe
testvm-flat.vmdk is a formatted 16GB flat vmdk ### - bootflag aa55 is present
Todo: add routine for delta.vmdks
Ulli