Skip to content

Commit

Permalink
Go to completed phase after apply delta on warm import
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
awels authored and kubevirt-bot committed Oct 24, 2024
1 parent 2909564 commit 3e50b87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/importer/vddk-datasource_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion pkg/importer/vddk-datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3e50b87

Please sign in to comment.