fix: convert volume size to Gib before volume creation

This commit is contained in:
Marin Salinas 2019-02-25 12:02:51 -06:00 committed by Megan Marsh
parent b246bf7329
commit f1e5dafc71
1 changed files with 5 additions and 2 deletions

View File

@ -79,7 +79,7 @@ func (s *StepCreateVolume) Run(ctx context.Context, state multistep.StateBag) mu
var rootDevice *oapi.BlockDeviceMappingImage
for _, device := range image.BlockDeviceMappings {
if device.DeviceName == image.RootDeviceName {
*rootDevice = device
rootDevice = &device
break
}
}
@ -143,9 +143,12 @@ func (s *StepCreateVolume) buildCreateVolumeInput(suregionName string, rootDevic
if rootDevice == nil {
return nil, fmt.Errorf("Couldn't find root device!")
}
//FIX: Temporary fix
gibSize := rootDevice.Bsu.VolumeSize / (1024 * 1024 * 1024)
createVolumeInput := &oapi.CreateVolumeRequest{
SubregionName: suregionName,
Size: rootDevice.Bsu.VolumeSize,
Size: gibSize,
SnapshotId: rootDevice.Bsu.SnapshotId,
VolumeType: rootDevice.Bsu.VolumeType,
Iops: rootDevice.Bsu.Iops,