From 3e50b87b6c29dc84f175699a0d88aa49be7003d2 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 b05f068389..d518144b6d 100644 --- a/pkg/importer/vddk-datasource_amd64.go +++ b/pkg/importer/vddk-datasource_amd64.go @@ -1081,5 +1081,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 960e23c774..4a16c5a0e5 100644 --- a/pkg/importer/vddk-datasource_test.go +++ b/pkg/importer/vddk-datasource_test.go @@ -221,7 +221,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))