Changes between Version 3 and Version 4 of virtual-machines

Show
Ignore:
Timestamp:
02/03/12 17:03:41 (7 years ago)
Author:
pruth (IP: 152.54.9.28)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • virtual-machines

    v3 v4  
    7676 
    7777{{{ 
    78 $ dd if=/dev/zero of=my_sparse_image.img bs=1 count=1 seek=2G 
    79 }}} 
    80  
    81 Mount both your sparse image and non-sparse image: 
    82  
    83 {{{ 
    84 $ mkdir mnt-src 
    85 $ mount -o loop my_image.img mnt-src 
    86 $ mkdir mnt-dst 
    87 $ mount -o loop my_sparse_image.img mnt-dst 
    88 }}} 
    89  
    90 Copy all the files from the non-sparse image to the sparse image (use 'cp -a' to preserve permissions and ownership): 
    91  
    92 {{{ 
    93 $ cp -a mnt-src/* mnt-dst/. 
    94 }}} 
    95  
    96 Unmount both images: 
    97  
    98 {{{ 
    99 $ umount mnt-src 
    100 $ umount mnt-dst 
     78$  cp --sparse=always my_image.img  my_sparse_image.img 
    10179}}} 
    10280 
     
    11290 
    11391{{{ 
    114 $ mv my_sparse_image.img filesystem 
     92$ cp --sparse=always my_image.img filesystem 
    11593$ tar -S -zcvf  my_sparse_image.img.tgz filesystem 
     94}}} 
     95 
     96== Create a metadata file ==  
     97 
     98This section assumes you have a working image, kernel, and ramdisk.   
     99 
     100Get the SHA-1 hash of the image, kernel, and ramdisk: 
     101 
     102{{{ 
     103$ sha1sum my_sparse_image.img.tgz 
     1046731f64297c725276758406927b803086e946cbf  /home/pruth/my_sparse_image.img.tgz 
     105$ sha1sum my_kernel 
     106fe919c7cb7478d0e36a923dfc65895d8c90db426  /home/pruth/my_kernel 
     107$ sha1sum my_ramdisk 
     1085835285746eca5373c53231522851e52d62e2332  /home/pruth/my_ramdisk 
    116109}}} 
    117110 
    118111 
    119112 
     113Put the files on a web server and create the metadata file: 
     114 
     115{{{ 
     116<images> 
     117        <image> 
     118                <type>ZFILESYSTEM</type> 
     119                <signature>6731f64297c725276758406927b803086e946cbf</signature> 
     120                <url>http://url_to_compressed_filesystem_image/my_sparse_image.img.tgz</url> 
     121        </image> 
     122        <image> 
     123                <type>KERNEL</type> 
     124                <signature>fe919c7cb7478d0e36a923dfc65895d8c90db426</signature> 
     125                <url>http://url_kernel_image/my_kernel</url> 
     126        </image> 
     127        <image> 
     128                <type>RAMDISK</type> 
     129                <signature>5835285746eca5373c53231522851e52d62e2332</signature> 
     130                <url>http://url_ramdisk_image/my_ramdisk</url> 
     131        </image> 
     132</images> 
     133}}} 
     134 
     135Get the SHA-1 hash of the metadata file: 
     136 
     137{{{ 
     138$ sha1sum my_metadata_file 
     1391956f27f43ac1d02aa9947aca690ff2b329e6730  /home/pruth/my_metadata_file 
     140}}} 
     141 
     142Put the metadata file on a web server.  Use the url and hash for the metadata file in a tool like Flukes to create a virtual machine on ORCA.  
    120143 
    121144