Feb 102016
 

Looking for a way to make a 128GB SSD be enough for several (at least 7) VMs naturally leads to thin provisioned disks. I did not know that LVM can do this and this seems to be the most efficient as well as fastest was to provision disks for VMs.

A nice summary is here and I follow this closely. Here the steps for a plain Debian 8.3 build:

apt-get install thin-provisioning-tools
lvcreate -L 50G --thinpool tp_vm giga-vg
lvcreate -V 8G --thin -n t_router giga-vg/tp_vm

That’s it. Now giga-vg/t_router is a thin provisioned 8GB volume. To see how full the thin volume pool is:

root@giga:~# lvs 
  LV       VG      Attr       LSize  Pool  Origin Data%  Meta%  Move Log Cpy%Sync Convert 
  root     giga-vg -wi-ao---- 22.00g                                                      
  swap_1   giga-vg -wi-ao----  7.83g                                                      
  t_router giga-vg Vwi-a-tz--  8.00g tp_vm        0.00                                    
  tp_vm    giga-vg twi-aotz-- 50.00g              0.00   0.45