~cloud-green/juju-core/charmstore-sdist

« back to all changes in this revision

Viewing changes to launchpad.net/gwacl/vhd_footer.go

  • Committer: Casey Marshall
  • Date: 2014-03-27 15:59:46 UTC
  • Revision ID: cmars@cmarstech.com-20140327155946-8huorf37g0zwar43
Source distribution of launchpad.net/juju-core created 20140327105939

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Canonical Ltd.  This software is licensed under the
 
2
// GNU Lesser General Public License version 3 (see the file COPYING).
 
3
 
 
4
package gwacl
 
5
 
 
6
// This is a pre-defined, base64-encoded 512-byte footer for a Virtual Hard
 
7
// Disk (VHD) file.  The footer sets the size of the VHD to a fixed 20Mb
 
8
// (20972032 bytes) and is intended to be uploaded as the last page in a blob
 
9
// of that size.
 
10
//
 
11
// The end use of this is to have a quick way of defining a fixed-size VHD
 
12
// that can be attached to a VM instance.  The rest of the file can be
 
13
// sparse-filled as necessary with a filesystem to create a final, valid,
 
14
// mountable disk.
 
15
//
 
16
// In case you were wondering *why* you would want to do this, it's the only
 
17
// way of making additional data available to a new instance at boot time.
 
18
//
 
19
// If you want to generate a new one of these (if you need a new size for
 
20
// example), the easiest way is to use VirtualBox to define a new one, and
 
21
// then do 'tail -c 512 | base64' on that file.
 
22
 
 
23
const VHD_SIZE = 20972032 // This is 20Mib + 512 bytes
 
24
const VHD_FOOTER = `
 
25
Y29uZWN0aXgAAAACAAEAAP//////////GVKuuHZib3gABAACV2kyawAAAAABQAAAAAAAAAFAAAAC
 
26
WgQRAAAAAv//5y4OEjVapHY7QpuodZNf77j6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
27
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
28
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
29
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
30
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
31
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
32
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
33
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=`