Skip to content

Commit 6d6517a

Browse files
authored
Increase default filesystem overhead to 6% (#3812)
* Increase default filesystem overhead to 6% The previous default of 5.5% was originally chosen to account for filesystem overhead. Due to inaccuracies in our overhead inflation calculations, the actual effective overhead was closer to 5.8%. Now that the calculation functions have been fixed, we're increasing the default to 6% to ensure sufficient inflation for typical filesystem overhead and avoid under-provisioning. Signed-off-by: Alvaro Romero <[email protected]> * Update default overhead in functional tests Signed-off-by: Alvaro Romero <[email protected]> * Update docs with correct default overhead value Signed-off-by: Alvaro Romero <[email protected]> --------- Signed-off-by: Alvaro Romero <[email protected]>
1 parent d64a975 commit 6d6517a

File tree

13 files changed

+40
-45
lines changed

13 files changed

+40
-45
lines changed

api/openapi-spec/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,7 @@
39553955
}
39563956
},
39573957
"filesystemOverhead": {
3958-
"description": "FilesystemOverhead describes the space reserved for overhead when using Filesystem volumes. A value is between 0 and 1, if not defined it is 0.055 (5.5% overhead)",
3958+
"description": "FilesystemOverhead describes the space reserved for overhead when using Filesystem volumes. A value is between 0 and 1, if not defined it is 0.06 (6% overhead)",
39593959
"$ref": "#/definitions/v1beta1.FilesystemOverhead"
39603960
},
39613961
"imagePullSecrets": {

doc/cdi-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CDI configuration in specified by administrators in the `spec.config` of the `CD
1919
| tlsSecurityProfile | nil | Used by operators to apply cluster-wide TLS security settings to operands. |
2020

2121
filesystemOverhead configuration:
22-
- `global` - default value is `"0.055"` - The amount to reserve for a Filesystem volume unless a per-storageClass value is chosen.
22+
- `global` - default value is `"0.06"` - The amount to reserve for a Filesystem volume unless a per-storageClass value is chosen.
2323
- `storageClass` - default value is `nil` - A value of `local: "0.6"` is understood to mean that the overhead for the local storageClass is 60%.
2424

2525
### Example

pkg/apis/core/v1beta1/openapi_generated.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const (
213213
// FilesystemOverheadVar provides a constant to capture our env variable "FILESYSTEM_OVERHEAD"
214214
FilesystemOverheadVar = "FILESYSTEM_OVERHEAD"
215215
// DefaultGlobalOverhead is the amount of space reserved on Filesystem volumes by default
216-
DefaultGlobalOverhead = "0.055"
216+
DefaultGlobalOverhead = "0.06"
217217

218218
// ConfigName is the name of default CDI Config
219219
ConfigName = "config"

pkg/controller/import-controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ var _ = Describe("Create Importer Pod", func() {
853853
imageSize: "1G",
854854
certConfigMap: "",
855855
diskID: "",
856-
filesystemOverhead: "0.055",
856+
filesystemOverhead: "0.06",
857857
insecureTLS: false,
858858
}
859859
podArgs := &importerPodArgs{
@@ -1012,7 +1012,7 @@ var _ = Describe("Import test env", func() {
10121012
doneFile: "",
10131013
backingFile: "",
10141014
thumbprint: "",
1015-
filesystemOverhead: "0.055",
1015+
filesystemOverhead: "0.06",
10161016
insecureTLS: false,
10171017
currentCheckpoint: "",
10181018
previousCheckpoint: "",

pkg/importer/data-processor_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var _ = Describe("Data Processor", func() {
153153
infoResponse: ProcessingPhaseTransferScratch,
154154
transferResponse: ProcessingPhaseComplete,
155155
}
156-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
156+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
157157
err := dp.ProcessData()
158158
Expect(err).ToNot(HaveOccurred())
159159
Expect(2).To(Equal(len(mdp.calledPhases)))
@@ -167,7 +167,7 @@ var _ = Describe("Data Processor", func() {
167167
infoResponse: ProcessingPhaseTransferDataDir,
168168
transferResponse: ProcessingPhaseComplete,
169169
}
170-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
170+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
171171
err := dp.ProcessData()
172172
Expect(err).ToNot(HaveOccurred())
173173
Expect(2).To(Equal(len(mdp.calledPhases)))
@@ -181,7 +181,7 @@ var _ = Describe("Data Processor", func() {
181181
infoResponse: ProcessingPhaseTransferScratch,
182182
transferResponse: ProcessingPhaseError,
183183
}
184-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
184+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
185185
err := dp.ProcessData()
186186
Expect(err).To(HaveOccurred())
187187
Expect(2).To(Equal(len(mdp.calledPhases)))
@@ -195,7 +195,7 @@ var _ = Describe("Data Processor", func() {
195195
transferResponse: ProcessingPhaseError,
196196
needsScratch: true,
197197
}
198-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
198+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
199199
err := dp.ProcessData()
200200
Expect(err).To(HaveOccurred())
201201
Expect(ErrRequiresScratchSpace).To(Equal(err))
@@ -209,7 +209,7 @@ var _ = Describe("Data Processor", func() {
209209
infoResponse: ProcessingPhaseTransferDataFile,
210210
transferResponse: ProcessingPhaseComplete,
211211
}
212-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
212+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
213213
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, errors.New("Scratch space required, and none found ")}, nil, nil, nil)
214214
replaceQEMUOperations(qemuOperations, func() {
215215
err := dp.ProcessData()
@@ -225,7 +225,7 @@ var _ = Describe("Data Processor", func() {
225225
infoResponse: ProcessingPhaseTransferDataFile,
226226
transferResponse: ProcessingPhaseError,
227227
}
228-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
228+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
229229
qemuOperations := NewQEMUAllErrors()
230230
replaceQEMUOperations(qemuOperations, func() {
231231
err := dp.ProcessData()
@@ -240,7 +240,7 @@ var _ = Describe("Data Processor", func() {
240240
mdp := &MockDataProvider{
241241
infoResponse: ProcessingPhase("invalidphase"),
242242
}
243-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
243+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
244244
err := dp.ProcessData()
245245
Expect(err).To(HaveOccurred())
246246
Expect(1).To(Equal(len(mdp.calledPhases)))
@@ -259,7 +259,7 @@ var _ = Describe("Data Processor", func() {
259259
transferResponse: ProcessingPhaseConvert,
260260
url: url,
261261
}
262-
dp := NewDataProcessor(mdp, "", "dataDir", tmpDir, "1G", 0.055, false, "")
262+
dp := NewDataProcessor(mdp, "", "dataDir", tmpDir, "1G", 0.06, false, "")
263263
dp.availableSpace = int64(1536000)
264264
usableSpace := dp.getUsableSpace()
265265

@@ -282,7 +282,7 @@ var _ = Describe("Data Processor", func() {
282282
},
283283
fooResponse: ProcessingPhaseComplete,
284284
}
285-
dp := NewDataProcessor(mcdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
285+
dp := NewDataProcessor(mcdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
286286
dp.RegisterPhaseExecutor(ProcessingPhaseFoo, func() (ProcessingPhase, error) {
287287
return mcdp.Foo()
288288
})
@@ -304,7 +304,7 @@ var _ = Describe("Data Processor", func() {
304304
},
305305
fooResponse: ProcessingPhaseInfo,
306306
}
307-
dp := NewDataProcessor(mcdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
307+
dp := NewDataProcessor(mcdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
308308
dp.RegisterPhaseExecutor(ProcessingPhaseFoo, func() (ProcessingPhase, error) {
309309
return mcdp.Foo()
310310
})
@@ -316,7 +316,7 @@ var _ = Describe("Data Processor", func() {
316316
mdp := &MockDataProvider{
317317
infoResponse: "unknown",
318318
}
319-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
319+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
320320
err := dp.ProcessData()
321321
Expect(err).To(HaveOccurred())
322322
})
@@ -329,7 +329,7 @@ var _ = Describe("Convert", func() {
329329
mdp := &MockDataProvider{
330330
url: url,
331331
}
332-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
332+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
333333
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, errors.New("Scratch space required, and none found ")}, nil, nil, nil)
334334
replaceQEMUOperations(qemuOperations, func() {
335335
nextPhase, err := dp.convert(mdp.GetURL())
@@ -344,7 +344,7 @@ var _ = Describe("Convert", func() {
344344
mdp := &MockDataProvider{
345345
url: url,
346346
}
347-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
347+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
348348
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, errors.New("Scratch space required, and none found ")}, errors.New("Validation failure"), nil, nil)
349349
replaceQEMUOperations(qemuOperations, func() {
350350
nextPhase, err := dp.convert(mdp.GetURL())
@@ -359,7 +359,7 @@ var _ = Describe("Convert", func() {
359359
mdp := &MockDataProvider{
360360
url: url,
361361
}
362-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
362+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
363363
qemuOperations := NewFakeQEMUOperations(errors.New("Conversion failure"), nil, fakeInfoOpRetVal{&fakeZeroImageInfo, errors.New("Scratch space required, and none found ")}, nil, nil, nil)
364364
replaceQEMUOperations(qemuOperations, func() {
365365
nextPhase, err := dp.convert(mdp.GetURL())
@@ -378,7 +378,7 @@ var _ = Describe("Resize", func() {
378378
mdp := &MockDataProvider{
379379
url: url,
380380
}
381-
dp := NewDataProcessor(mdp, tempDir, "dataDir", "scratchDataDir", "", 0.055, false, "")
381+
dp := NewDataProcessor(mdp, tempDir, "dataDir", "scratchDataDir", "", 0.06, false, "")
382382
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, nil}, nil, nil, nil)
383383
replaceQEMUOperations(qemuOperations, func() {
384384
nextPhase, err := dp.resize()
@@ -400,7 +400,7 @@ var _ = Describe("Resize", func() {
400400
mdp := &MockDataProvider{
401401
url: url,
402402
}
403-
dp := NewDataProcessor(mdp, tempDir, "dataDir", "scratchDataDir", "1G", 0.055, false, "")
403+
dp := NewDataProcessor(mdp, tempDir, "dataDir", "scratchDataDir", "1G", 0.06, false, "")
404404
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, nil}, nil, nil, nil)
405405
replaceQEMUOperations(qemuOperations, func() {
406406
nextPhase, err := dp.resize()
@@ -418,7 +418,7 @@ var _ = Describe("Resize", func() {
418418
mdp := &MockDataProvider{
419419
url: url,
420420
}
421-
dp := NewDataProcessor(mdp, tmpDir, tmpDir, "scratchDataDir", "1G", 0.055, false, "")
421+
dp := NewDataProcessor(mdp, tmpDir, tmpDir, "scratchDataDir", "1G", 0.06, false, "")
422422
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, nil}, nil, nil, nil)
423423
replaceQEMUOperations(qemuOperations, func() {
424424
nextPhase, err := dp.resize()
@@ -435,7 +435,7 @@ var _ = Describe("Resize", func() {
435435
mdp := &MockDataProvider{
436436
url: url,
437437
}
438-
dp := NewDataProcessor(mdp, "dest", tmpDir, "scratchDataDir", "1G", 0.055, false, "")
438+
dp := NewDataProcessor(mdp, "dest", tmpDir, "scratchDataDir", "1G", 0.06, false, "")
439439
qemuOperations := NewQEMUAllErrors()
440440
replaceQEMUOperations(qemuOperations, func() {
441441
nextPhase, err := dp.resize()
@@ -449,7 +449,7 @@ var _ = Describe("Resize", func() {
449449
return int64(100000), nil
450450
}, func() {
451451
mdp := &MockDataProvider{}
452-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.055, false, "")
452+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.06, false, "")
453453
Expect(int64(100000)).To(Equal(dp.calculateTargetSize()))
454454
})
455455
})
@@ -459,7 +459,7 @@ var _ = Describe("Resize", func() {
459459
return int64(-1), errors.New("error")
460460
}, func() {
461461
mdp := &MockDataProvider{}
462-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.055, false, "")
462+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.06, false, "")
463463
// We just log the error if one happens.
464464
Expect(int64(-1)).To(Equal(dp.calculateTargetSize()))
465465

@@ -490,7 +490,7 @@ var _ = Describe("ResizeImage", func() {
490490
var _ = Describe("DataProcessorResume", func() {
491491
It("Should fail with an error if the data provider cannot resume", func() {
492492
mdp := &MockDataProvider{}
493-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.055, false, "")
493+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "", 0.06, false, "")
494494
err := dp.ProcessDataResume()
495495
Expect(err).To(HaveOccurred())
496496
})
@@ -499,7 +499,7 @@ var _ = Describe("DataProcessorResume", func() {
499499
amdp := &MockAsyncDataProvider{
500500
ResumePhase: ProcessingPhaseComplete,
501501
}
502-
dp := NewDataProcessor(amdp, "dest", "dataDir", "scratchDataDir", "", 0.055, false, "")
502+
dp := NewDataProcessor(amdp, "dest", "dataDir", "scratchDataDir", "", 0.06, false, "")
503503
err := dp.ProcessDataResume()
504504
Expect(err).ToNot(HaveOccurred())
505505
})
@@ -520,7 +520,7 @@ var _ = Describe("MergeDelta", func() {
520520
url: url,
521521
}
522522

523-
dp := NewDataProcessor(mdp, expectedBackingFile, "dataDir", "scratchDataDir", "", 0.055, false, "")
523+
dp := NewDataProcessor(mdp, expectedBackingFile, "dataDir", "scratchDataDir", "", 0.06, false, "")
524524
err := errors.New("this operation should not be called")
525525
info := &image.ImgInfo{
526526
Format: "",
@@ -560,7 +560,7 @@ var _ = Describe("ValidatePreScratch", func() {
560560
infoResponse: ProcessingPhaseValidatePreScratch,
561561
url: url,
562562
}
563-
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.055, false, "")
563+
dp := NewDataProcessor(mdp, "dest", "dataDir", "scratchDataDir", "1G", 0.06, false, "")
564564
qemuOperations := NewFakeQEMUOperations(nil, nil, fakeInfoOpRetVal{&fakeZeroImageInfo, nil}, image.ErrLargerPVCRequired, nil, nil)
565565
replaceQEMUOperations(qemuOperations, func() {
566566
err = dp.ProcessData()

pkg/operator/resources/crds_generated.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/uploadserver/uploadserver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func newServer() *uploadServerApp {
5151
BindAddress: "127.0.0.1",
5252
BindPort: 0,
5353
Destination: "disk.img",
54-
FilesystemOverhead: 0.055,
54+
FilesystemOverhead: 0.06,
5555
CryptoConfig: *cryptowatch.DefaultCryptoConfig(),
5656
}
5757
server := NewUploadServer(config)
@@ -87,7 +87,7 @@ func newTLSServer(clientCertName, expectedName string) (*uploadServerApp, *tripl
8787
ServerCertFile: filepath.Join(dir, "tls.crt"),
8888
ClientCertFile: filepath.Join(dir, "client.crt"),
8989
ClientName: expectedName,
90-
FilesystemOverhead: 0.055,
90+
FilesystemOverhead: 0.06,
9191
CryptoConfig: *cryptowatch.DefaultCryptoConfig(),
9292
}
9393

@@ -187,11 +187,11 @@ func (amd *AsyncMockDataSource) GetResumePhase() importer.ProcessingPhase {
187187
}
188188

189189
func saveAsyncProcessorSuccess(stream io.ReadCloser, dest, imageSize string, filesystemOverhead float64, preallocation bool, contentType string) (*importer.DataProcessor, error) {
190-
return importer.NewDataProcessor(&AsyncMockDataSource{}, "", "", "", "", 0.055, false, ""), nil
190+
return importer.NewDataProcessor(&AsyncMockDataSource{}, "", "", "", "", 0.06, false, ""), nil
191191
}
192192

193193
func saveAsyncProcessorFailure(stream io.ReadCloser, dest, imageSize string, filesystemOverhead float64, preallocation bool, contentType string) (*importer.DataProcessor, error) {
194-
return importer.NewDataProcessor(&AsyncMockDataSource{}, "", "", "", "", 0.055, false, ""), fmt.Errorf("Error using datastream")
194+
return importer.NewDataProcessor(&AsyncMockDataSource{}, "", "", "", "", 0.06, false, ""), fmt.Errorf("Error using datastream")
195195
}
196196

197197
func withAsyncProcessorSuccess(f func()) {

pkg/util/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ var _ = Describe("Space calculation", func() {
155155
Mi = int64(1024 * 1024)
156156
Gi = 1024 * Mi
157157
noOverhead = float64(0)
158-
defaultOverhead = float64(0.055)
158+
defaultOverhead = float64(0.06)
159159
largeOverhead = float64(0.75)
160160
)
161161
DescribeTable("getusablespace should return properly aligned sizes,", func(virtualSize int64, overhead float64) {

staging/src/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ type CDIConfigSpec struct {
10271027
PodResourceRequirements *corev1.ResourceRequirements `json:"podResourceRequirements,omitempty"`
10281028
// FeatureGates are a list of specific enabled feature gates
10291029
FeatureGates []string `json:"featureGates,omitempty"`
1030-
// FilesystemOverhead describes the space reserved for overhead when using Filesystem volumes. A value is between 0 and 1, if not defined it is 0.055 (5.5% overhead)
1030+
// FilesystemOverhead describes the space reserved for overhead when using Filesystem volumes. A value is between 0 and 1, if not defined it is 0.06 (6% overhead)
10311031
FilesystemOverhead *FilesystemOverhead `json:"filesystemOverhead,omitempty"`
10321032
// Preallocation controls whether storage for DataVolumes should be allocated in advance.
10331033
Preallocation *bool `json:"preallocation,omitempty"`

0 commit comments

Comments
 (0)