diff --git a/pkg/spdk/engine.go b/pkg/spdk/engine.go index f52b5ca9..3b281508 100644 --- a/pkg/spdk/engine.go +++ b/pkg/spdk/engine.go @@ -106,7 +106,7 @@ func NewEngine(engineName, volumeName, frontend string, specSize uint64, engineU } func isNewEngine(e *Engine) bool { - return e.IP == "" + return e.IP == "" && e.TargetIP == "" && e.StandbyTargetPort == 0 } func (e *Engine) checkInitiatorAndTargetCreationRequirements(podIP, initiatorIP, targetIP string) (bool, bool, error) { @@ -214,7 +214,9 @@ func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[str } if isNewEngine(e) { - e.IP = initiatorIP + if initiatorCreationRequired { + e.IP = initiatorIP + } e.TargetIP = targetIP }