Defrost the calamari tubes if frozen, wash, and pat dry. Cut into thin rings, about 5 mm/ ¼ inch wide. Set aside. Finely chop the onion, the garlic cloves, and the rosemary.
Saute onions: Heat the olive oil in a heavy-bottomed skillet and cook the onions on medium-low heat for about 5 minutes or until softened.
Simmer: Add the garlic, calamari rings, chopped tomatoes, red wine vinegar, sugar, and rosemary. Add some salt and pepper to taste, bring to a boil, and simmer, covered, for about 20 minutes.
Add the peas and continue simmering, uncovered, for another 10 minutes. Chop the parsley and add most of it to the pan after you turn off the heat. Adjust the taste with salt and pepper.
In the meantime, cook the spaghetti.
Serve the calamari in tomato sauce over spaghetti and sprinkled with the rest of the parsley.