mirror of https://github.com/k3s-io/k3s
Fix rounding-up of Vsphere volume size
parent
0889c3e4e9
commit
c2fc91adc7
|
@ -94,11 +94,12 @@ func (util *VsphereDiskUtil) CreateVolume(v *vsphereVolumeProvisioner, selectedZ
|
|||
}
|
||||
|
||||
capacity := v.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
|
||||
// vSphere works with kilobytes, convert to KiB with rounding up
|
||||
volSizeKiB, err := volumehelpers.RoundUpToKiBInt(capacity)
|
||||
// vSphere works with KiB, but its minimum allocation unit is 1 MiB
|
||||
volSizeMiB, err := volumehelpers.RoundUpToMiBInt(capacity)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
volSizeKiB := volSizeMiB * 1024
|
||||
name := volumeutil.GenerateVolumeName(v.options.ClusterName, v.options.PVName, 255)
|
||||
volumeOptions := &vclib.VolumeOptions{
|
||||
CapacityKB: volSizeKiB,
|
||||
|
|
Loading…
Reference in New Issue