Difference between revisions of "Repackaging of the VM"

From TASTE
Jump to: navigation, search
(Repackaging of the VM)
(Repackaging of the VM)
Line 20: Line 20:
 
#:This will compress all the free space (which was conveniently erased in step 4) thus creating a minimal .vmdk file
 
#:This will compress all the free space (which was conveniently erased in step 4) thus creating a minimal .vmdk file
  
ALTERNATIVE: If Virtualbox is used, the vmdk file has first to be converted to vdi:
+
'''ALTERNATIVE''': If Virtualbox is used, the vmdk file has first to be converted to vdi:
 +
 
 
<code>vboxmanage clonehd --format vdi centos-7-1-1.x86_64.vmdk newdisk.vdi</code>
 
<code>vboxmanage clonehd --format vdi centos-7-1-1.x86_64.vmdk newdisk.vdi</code>
  
 
Then only it can be compacted:
 
Then only it can be compacted:
 +
 
<code>vboxmanage modifyhd newdisk.vdi --compact</code>
 
<code>vboxmanage modifyhd newdisk.vdi --compact</code>
  

Revision as of 15:07, 19 April 2022

Repackaging of the VM

Since the VM contains all the necessary tools used by TASTE (custom compilers, graphical editors, etc) it is a quite large mini-distribution by itself. It makes sense therefore when distributing it, to strive to create as minimal tarballs as possible.

The steps below are the ones we follow when releasing a new VM:

  1. A successful Update-TASTE.sh is executed.
  2. A successful regression check is executed.
  3. All the binary folders generated during the compilation of the TASTE tools and the regression suite are removed to save space.
  4. For the same reason, sudo apt-get clean
  5. To prepare for optimal .vmdk creation, the free space of the VM's "drive" is then erased:
    sudo dd if=/dev/zero of=/clearMe bs=1M
    sync
    sudo rm /clearMe
    This makes sure that all the free space in the VM is filled with zeros
  6. sudo poweroff
  7. In the folder where the VM's "drive" is stored (i.e. the .vmdk file), the vmware-vdiskmanager tool is used:
    vmware-vdiskmanager -r HardDrive.vmdk -t 0 new.vmdk
    mv new.vmdk HardDrive.vmdk
    This will compress all the free space (which was conveniently erased in step 4) thus creating a minimal .vmdk file

ALTERNATIVE: If Virtualbox is used, the vmdk file has first to be converted to vdi:

vboxmanage clonehd --format vdi centos-7-1-1.x86_64.vmdk newdisk.vdi

Then only it can be compacted:

vboxmanage modifyhd newdisk.vdi --compact

  1. Finally, an rsync-able tarball is then generated:
    tar cpf - TASTE-VM/ | gzip --rsyncable > TASTE-VM.tar.gz

By nature of the --rsyncable option, this gzipped tarball can be optimally transferred to the remote server(s) hosting the VM (via rsync), since only the parts of the VM that actually changed will be transferred. This is usually less than 5% of the full size of the VM tarball.