Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/apis/forklift/v1beta1/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ func (r *Plan) IsSourceProviderOCP() bool {

func (r *Plan) IsSourceProviderVSphere() bool { return r.Provider.Source.Type() == VSphere }

func (r *Plan) ShouldRunPreflightInspection() bool {
isWarm := r.Spec.Type == MigrationWarm || r.Spec.Warm
return r.IsSourceProviderVSphere() &&
isWarm &&
!r.Spec.SkipGuestConversion &&
r.Spec.RunPreflightInspection
}

// PVCNameTemplateData contains fields used in naming templates.
type PVCNameTemplateData struct {
VmName string `json:"vmName"`
Expand Down
16 changes: 10 additions & 6 deletions pkg/controller/plan/migrator/base/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,16 @@ func (r *BaseMigrator) Step(status *plan.VMStatus) (step string) {
step = DiskAllocation
case api.PhaseCopyDisks, api.PhaseCopyingPaused, api.PhaseRemovePreviousSnapshot, api.PhaseWaitForPreviousSnapshotRemoval,
api.PhaseCreateSnapshot, api.PhaseWaitForSnapshot, api.PhaseStoreSnapshotDeltas, api.PhaseAddCheckpoint,
api.PhaseConvertOpenstackSnapshot, api.PhaseWaitForDataVolumesStatus, api.PhaseCreateDataVolumes:
api.PhaseConvertOpenstackSnapshot, api.PhaseWaitForDataVolumesStatus:
step = DiskTransfer
case api.PhaseCreateDataVolumes:
// This phase should be present in DiskTransfer step only when executing Preflight Inspection to avoid UI pipeline artifacts.
// If not executing Preflight Inspection, keep the Initialize step.
if r.Context.Plan.ShouldRunPreflightInspection() {
step = DiskTransfer
} else {
step = Initialize
}
case api.PhaseRemovePenultimateSnapshot, api.PhaseWaitForPenultimateSnapshotRemoval, api.PhaseCreateFinalSnapshot,
api.PhaseWaitForFinalSnapshot, api.PhaseAddFinalCheckpoint, api.PhaseFinalize, api.PhaseRemoveFinalSnapshot,
api.PhaseWaitForFinalSnapshotRemoval, api.PhaseWaitForFinalDataVolumesStatus:
Expand Down Expand Up @@ -398,11 +406,7 @@ func (r *BasePredicate) Evaluate(flag libitr.Flag) (allowed bool, err error) {
case VSphere:
allowed = r.context.Plan.IsSourceProviderVSphere()
case RunInspection:
allowed = r.context.Plan.Spec.RunPreflightInspection &&
r.context.Source.Provider.RequiresConversion() &&
!r.context.Plan.Spec.SkipGuestConversion &&
r.context.Plan.IsSourceProviderVSphere()

allowed = r.context.Plan.ShouldRunPreflightInspection()
}

return
Expand Down
Loading