You don't say which hypervisor you're using so I'll assume VirtualBox.
You should take the template image out of VDI before making changes to it so when it's imported again VDI can be told of the correct size etc.
You can use VBoxManage to resize the disk size such as:
VBoxManage modifyhd --resize 8096 yourmachine.vdi (to make it 8GB in size)
Once that's done you need to boot it up and tell the guest OS to resize their filesystem to use the new space.
Worth having a look at FatBloke's blog here for more info - https://blogs.oracle.com/fatbloke/entry/growing_your_virtualbox_virtual_disk
Hope this helps.