Changes between Version 20 and Version 21 of virtual-machines

Show
Ignore:
Timestamp:
01/24/14 15:16:35 (5 years ago)
Author:
ibaldin (IP: 152.54.9.21)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • virtual-machines

    v20 v21  
    3535Note - the above procedure works well for '''increasing''' the size of an image; shrinking an image is slightly more complex,  
    3636in that it requires running the filesystem resize command upon the image '''before''' transitioning it into a smaller file. 
     37 
     38 
     39== Sparse Images == 
     40 
     41The astute reader might point out that tarring an individual file is unnecessary and an odd format for ORCA to accept.  However, when used appropriately, this functionality can reduce the time and space necessary to stage and boot a virtual machine to a small fraction of the original.  The key is to store images as [http://en.wikipedia.org/wiki/Sparse_file sparse files].  Sparse files take up less space when uncompressed and can be take less time to be uncompressed.    
     42 
     43It is not too difficult to create sparse files but it can be tricky to keep the files sparse while handling them.  Many common tool cannot process a sparse file without eliminating the sparse property (i.e. gzip, bzip2).  Other tools can maintain sparsity but do not by default (i.e. cp, tar).   Further, some operating systems and file systems cannot handle sparse files (i.e. nfs).   
     44 
     45== Create a Sparse Image == 
     46 
     47This section assumes that you have a working non-sparse image and want to convert it to a sparse image. 
     48 
     49Create an appropriately sized sparse file (make sure your operating system and file system support sparse files... don't use nfs): 
     50 
     51{{{ 
     52$  cp --sparse=always my_image.img  my_sparse_image.img 
     53}}} 
     54 
     55You now have a sparse image called my_sparse_image.img.  Don't mess it up by using any tools that remove the sparsity. 
     56 
     57Tar the file with -S to preserve sparsity: 
     58 
     59{{{ 
     60$ tar -S -zcvf  my_sparse_image.img.tgz my_sparse_image.img 
     61}}} 
     62 
     63Note: to use the image with ORCA, must rename the image "filesystem" before tarring: 
     64 
     65{{{ 
     66$ cp --sparse=always my_image.img  filesystem 
     67$ tar -S -zcvf  my_sparse_image.img.tgz filesystem 
     68}}} 
    3769 
    3870== !ImageProxy == 
     
    94126In addition, ZFILESYSTEM can handle images that are tarred before they are compressed with the tools above extending the allowed formats to include .tgz, .tbz2, and .txz.    However, images that are tarred and gzipped must conform to the expected naming convention by naming the image file "filesystem".  The tarball can have any name. 
    95127 
    96 == Sparse Images == 
    97  
    98 The astute reader might point out that tarring an individual file is unnecessary and an odd format for ORCA to accept.  However, when used appropriately, this functionality can reduce the time and space necessary to stage and boot a virtual machine to a small fraction of the original.  The key is to store images as [http://en.wikipedia.org/wiki/Sparse_file sparse files].  Sparse files take up less space when uncompressed and can be take less time to be uncompressed.    
    99  
    100 It is not too difficult to create sparse files but it can be tricky to keep the files sparse while handling them.  Many common tool cannot process a sparse file without eliminating the sparse property (i.e. gzip, bzip2).  Other tools can maintain sparsity but do not by default (i.e. cp, tar).   Further, some operating systems and file systems cannot handle sparse files (i.e. nfs).   
    101  
    102 == Create a Sparse Image == 
    103  
    104 This section assumes that you have a working non-sparse image and want to convert it to a sparse image. 
    105  
    106 Create an appropriately sized sparse file (make sure your operating system and file system support sparse files... don't use nfs): 
    107  
    108 {{{ 
    109 $  cp --sparse=always my_image.img  my_sparse_image.img 
    110 }}} 
    111  
    112 You now have a sparse image called my_sparse_image.img.  Don't mess it up by using any tools that remove the sparsity. 
    113  
    114 Tar the file with -S to preserve sparsity: 
    115  
    116 {{{ 
    117 $ tar -S -zcvf  my_sparse_image.img.tgz my_sparse_image.img 
    118 }}} 
    119  
    120 Note: to use the image with ORCA, must rename the image "filesystem" before tarring: 
    121  
    122 {{{ 
    123 $ cp --sparse=always my_image.img  filesystem 
    124 $ tar -S -zcvf  my_sparse_image.img.tgz filesystem 
    125 }}} 
    126128 
    127129== Create a metadata file ==