github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/provider/common/disk.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package common
     5  
     6  const (
     7  	// MinRootDiskSizeGiB is the minimum size for the root disk of an
     8  	// instance, in Gigabytes. This value accommodates the anticipated
     9  	// size of the initial image, any updates, and future application
    10  	// data.
    11  	MinRootDiskSizeGiB uint64 = 8
    12  )
    13  
    14  // MiBToGiB converts the provided megabytes (base-2) into the nearest
    15  // gigabytes (base-2), rounding up. This is useful for providers that
    16  // deal in gigabytes (while juju deals in megabytes).
    17  func MiBToGiB(m uint64) uint64 {
    18  	return (m + 1023) / 1024
    19  }