From 26b378dac9e842ebc1624bae6201d1b8c1252700 Mon Sep 17 00:00:00 2001 From: Alexander Wels Date: Tue, 22 Oct 2024 13:47:13 -0500 Subject: [PATCH] Go to completed phase after apply delta on warm import Instead of going to resize phase, go directly to completed phase for apply the delta snapshot. Resizing has already happened when importing the initial snapshot. This will cause validation of the size to not happen every single delta. Since the resize steps validates the available space on the target. This was causing issues on filesystem volumes where the space was being used and the available space is less than the virtual size of the disk. We don't care about the available space at this point since we already verified there was enough space on the initial snapshot import. Signed-off-by: Alexander Wels --- pkg/importer/vddk-datasource_amd64.go | 5 +++++ pkg/importer/vddk-datasource_test.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/importer/vddk-datasource_amd64.go b/pkg/importer/vddk-datasource_amd64.go index d90f9d386d..ca119c9131 100644 --- a/pkg/importer/vddk-datasource_amd64.go +++ b/pkg/importer/vddk-datasource_amd64.go @@ -1075,5 +1075,10 @@ func (vs *VDDKDataSource) TransferFile(fileName string) (ProcessingPhase, error) } } + if vs.PreviousSnapshot != "" { + // Don't resize when applying snapshot deltas as the resize has already happened + // when the first snapshot was imported. + return ProcessingPhaseComplete, nil + } return ProcessingPhaseResize, nil } diff --git a/pkg/importer/vddk-datasource_test.go b/pkg/importer/vddk-datasource_test.go index e154d5ea9b..3423a5431a 100644 --- a/pkg/importer/vddk-datasource_test.go +++ b/pkg/importer/vddk-datasource_test.go @@ -223,7 +223,7 @@ var _ = Describe("VDDK data source", func() { phase, err = snap2.TransferFile(".") Expect(err).ToNot(HaveOccurred()) - Expect(phase).To(Equal(ProcessingPhaseResize)) + Expect(phase).To(Equal(ProcessingPhaseComplete)) deltaSum := md5.Sum(mockSinkBuffer) Expect(changedSourceSum).To(Equal(deltaSum))