1

I migrated my vmware vcenter(26GB) over NFS on to /dev/sdb(50GB).

[root@centos7~]# df  -hT /dev/sdb
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sdb       ext4   50G   26G   21G  56% /50GB

when i go inside /50GB and run du -h

[root@centos7 50GB]# du -h
26G     ./vapp
36K     ./.vSphere-HA/FDM-143873ec-3447-417e-abe8-81a9ca63e389-72-e47999a-192.168.0.150
40K     ./.vSphere-HA
16K     ./lost+found
26G    

. as it's says 26 GB is used by /vapp but when i go inside and run du -h

[root@centos7 vapp]# ls -lSh
total 26G
-rw-------. 1 root root 100G Jan  2 10:16 vapp_11-flat.vmdk
-rw-------. 1 root root  50G Jan  2 10:16 vapp_12-flat.vmdk
-rw-------. 1 root root  25G Jan  2 10:15 vapp_2-flat.vmdk
-rw-------. 1 root root  25G Jan  2 10:15 vapp_3-flat.vmdk
-rw-------. 1 root root  15G Jan  2 10:15 vapp_6-flat.vmdk
-rw-------. 1 root root  12G Jan  2 10:12 vapp-flat.vmdk
-rw-------. 1 root root  11G Jan  2 10:36 vapp-Snapshot1.vmsn
-rw-------. 1 root root  10G Jan  2 10:15 vapp_10-flat.vmdk
-rw-------. 1 root root  10G Jan  2 10:15 vapp_4-flat.vmdk
-rw-------. 1 root root  10G Jan  2 10:15 vapp_5-flat.vmdk
-rw-------. 1 root root  10G Jan  2 10:15 vapp_7-flat.vmdk
-rw-------. 1 root root  10G Jan  2 10:15 vapp_9-flat.vmdk
-rw-------. 1 root root 5.7G Jan  2 11:19 vapp-000001-delta.vmdk
-rw-------. 1 root root 4.6G Jan  2 11:19 vapp_2-000001-delta.vmdk
-rw-------. 1 root root 1.7G Jan  2 10:15 vapp_1-flat.vmdk
-rw-------. 1 root root 1.3G Jan  2 11:19 vapp_11-000001-delta.vmdk
-rw-------. 1 root root 1.0G Jan  2 10:15 vapp_8-flat.vmdk
-rw-------. 1 root root 385M Jan  2 11:19 vapp_4-000001-delta.vmdk
-rw-------. 1 root root 289M Jan  2 11:19 vapp_5-000001-delta.vmdk
-rw-------. 1 root root 209M Jan  2 11:19 vapp_7-000001-delta.vmdk
-rw-------. 1 root root 145M Jan  2 11:19 vapp_12-000001-delta.vmdk
-rw-------. 1 root root  81M Jan  2 11:19 vapp_6-000001-delta.vmdk
-rw-------. 1 root root  17M Jan  2 11:19 vapp_3-000001-delta.vmdk
-rw-------. 1 root root  17M Jan  2 11:19 vapp_10-000001-delta.vmdk
-rw-------. 1 root root  17M Jan  2 11:19 vapp_9-000001-delta.vmdk
-rw-------. 1 root root  17M Jan  2 11:19 vapp_8-000001-delta.vmdk
-r--------. 1 root root 6.4M Jan  2 11:22 vmx-zdump.000
-rw-------. 1 root root 2.3M Jan  2 11:22 vmmcores.gz
-rw-------. 1 root root 480K Jan  2 10:36 vmware-10.log
-rw-------. 1 root root 468K Jan  2 10:36 vmware-7.log
-rw-------. 1 root root 457K Jan  2 10:36 vmware-9.log
-rw-------. 1 root root 449K Jan  2 10:36 vmware-8.log
-rw-------. 1 root root 447K Jan  2 10:36 vmware-6.log
-rw-r--r--. 1 root root 241K Jan  2 11:19 vmware.log
-rw-r--r--. 1 root root 193K Jan  2 11:22 vmware-11.log
-rw-------. 1 root root 8.5K Jan  2 11:19 vapp.nvram
-rw-------. 1 root root 8.0K Jan  2 10:36 vapp_1-000001-delta.vmdk
-rwxr-xr-x. 1 root root 5.4K Jan  2 11:19 vapp.vmx
-rw-r--r--. 1 root root 2.4K Jan  2 11:03 vapp-0a960b98.hlog
-rw-------. 1 root root 1.3K Jan  2 10:16 vapp.vmsd
-rw-------. 1 root root  552 Jan  2 10:16 vapp_11.vmdk
-rw-------. 1 root root  551 Jan  2 10:16 vapp_12.vmdk
-rw-------. 1 root root  550 Jan  2 10:15 vapp_10.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_2.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_3.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_4.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_5.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_6.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_7.vmdk
-rw-------. 1 root root  549 Jan  2 10:15 vapp_9.vmdk
-rw-------. 1 root root  547 Jan  2 10:15 vapp_1.vmdk
-rw-------. 1 root root  547 Jan  2 10:15 vapp_8.vmdk
-rw-------. 1 root root  547 Jan  2 10:12 vapp.vmdk
-rw-------. 1 root root  296 Jan  2 11:15 vapp_11-000001.vmdk
-rw-------. 1 root root  296 Jan  2 11:15 vapp_12-000001.vmdk
-rw-------. 1 root root  295 Jan  2 11:15 vapp_10-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:03 vapp_2-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:15 vapp_3-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:15 vapp_4-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:15 vapp_5-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:15 vapp_6-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:16 vapp_7-000001.vmdk
-rw-------. 1 root root  293 Jan  2 11:15 vapp_9-000001.vmdk
-rw-------. 1 root root  292 Jan  2 10:36 vapp_1-000001.vmdk
-rw-------. 1 root root  292 Jan  2 11:15 vapp_8-000001.vmdk
-rw-------. 1 root root  289 Jan  2 11:14 vapp-000001.vmdk

I tired to tar gzip the directory /50GB/vapp but still it is using lots of space. I tired scp -r vapp 192.168.0.140:/home but still it's taking lots of time.

Questions:

How come 50GB /dev/sdb can store more than 250GB?

How can i get rid off these fake storage?

  • Some of the VMDK files are obviously sparse. It's unclear what space you want to get rid of as it's unused. – Kusalananda Jan 2 at 19:22
  • @Kusalananda Not only sparse... – Rui F Ribeiro Jan 2 at 19:52
1

As @Kusanalanda says some of those files are sparse.

Also the vapps, as deployed from a single vmdk, are actually a hard link to a single file, hence the -delta.vmdk files with the differences.

The best strategy is usually cloning the VM; as for backuping up the files, either you use exclusion lists (file,directories) as some of those vmdk files are transient in nature. e.g. they will be destroyed as soon as the vapp is terminated.

The alternative might be using specialized backup software that understands vmware inner works, if any.

  • Looks like the hard links are broken though. All the files have a link count of 1. – Kusalananda Jan 2 at 20:02
  • @Kusalananda Indeed. However with the limited data we have..Might be other optimization. VmWare does use the same space twice for deployed apps. – Rui F Ribeiro Jan 2 at 20:04
  • I dont have a vmware to check it out today though....Might check it out with the vmware guys next week just to satisfy my curiosity. – Rui F Ribeiro Jan 2 at 20:08
  • (does not use the same space twice....lost the mouse. Even Romeo beat me to an answer because of that) – Rui F Ribeiro Jan 2 at 20:11
0

The reason is vmware dynamically allocate virtual disks. The software create files on special way so they use small disk space but ls show bigger size.

In this moment you can't "correct" this discrepancy. If you want in the future to avoid it you can create virtual disks with fixed size (but you will be able to create much less virtual disks). You can also check which of those virtual disks are in use and remove the rest if you know you do not need them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.