use 2x volume size

This commit is contained in:
Matthew Hooker 2018-10-17 21:30:22 -07:00
parent 7c577abbcb
commit b222d36669
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
2 changed files with 5 additions and 4 deletions

View File

@ -79,10 +79,10 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
bootable: true,
},
&stepCreatePersistentVolume{
// We multiple the master volume size by 3, because we need to
// copy the original data 3 times: the data itself, the
// tarball, and the chunks
volumeSize: fmt.Sprintf("%d", b.config.PersistentVolumeSize*3),
// We multiple the master volume size by 2, because we need
// room to tarball the disk image. We also need to chunk the
// tar ball, but we can remove the original disk image first.
volumeSize: fmt.Sprintf("%d", b.config.PersistentVolumeSize*2),
volumeName: fmt.Sprintf("builder-storage_%s", runID),
},
&ocommon.StepKeyPair{

View File

@ -57,6 +57,7 @@ func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multi
cd /builder
dd if=/dev/xvdc bs=8M status=progress | cp --sparse=always /dev/stdin diskimage.raw
tar czSf ./diskimage.tar.gz ./diskimage.raw
rm diskimage.raw
%s`, uploadImageCmd)
dest := "/tmp/create-packer-diskimage.sh"