List<SecondaryDiskStateful> oldDisks = oldDefinition.getSecondaryDisks().getStatefulDisks();
List<SecondaryDiskStateful> newDisks = newDefinition.getSecondaryDisks().getStatefulDisks();
for (SecondaryDiskStateful newDisk : newDisks)
{
SecondaryDiskStateful oldDisk = isPersistentDiskContained(newDisk, oldDisks);
if (oldDisk == null)
{
disks.add(new ReconfigureStatefulDisk(newDisk, DiskOp.ATTACH));
}
else if (!detectMovesbySequence && isChangedBusOrUnitNumber(oldDisk, newDisk)
|| detectMovesbySequence && oldDisk.getSequence() != newDisk.getSequence())
{
disks.add(new ReconfigureStatefulDisk(newDisk, DiskOp.MOVE_UNIT_NUMBER));
}
}
for (SecondaryDiskStateful oldDisk : oldDisks)
{
SecondaryDiskStateful newDisk = isPersistentDiskContained(oldDisk, newDisks);
if (newDisk == null)
{
disks.add(new ReconfigureStatefulDisk(oldDisk, DiskOp.DETACH));
}
}