diff --git a/post-processor/vagrant/libvirt.go b/post-processor/vagrant/libvirt.go index bb19b2d176c..087afc3451a 100644 --- a/post-processor/vagrant/libvirt.go +++ b/post-processor/vagrant/libvirt.go @@ -5,6 +5,7 @@ import ( "github.com/mitchellh/packer/packer" "path/filepath" "strings" + "math" ) type LibVirtProvider struct{} @@ -22,7 +23,8 @@ func (p *LibVirtProvider) Process(ui packer.Ui, artifact packer.Artifact, dir st } format := artifact.State("diskType").(string) - size := artifact.State("diskSize").(uint) / 1024 // In MB, want GB + // Round size up to nearest GB + size := math.Ceil(float64(artifact.State("diskSize").(uint)) / float64(1024)) domainType := artifact.State("domainType").(string) // Convert domain type to libvirt driver