"Whoever it was/is" is the subject of "must be very angry". But, "whoever" is the object of it was/it is and therefore should be "whomever". Both sentences should start with "whomever".
Here is an example of using "whoever" in a very similar sentence:
Whoever vandalized the classroom must be very angry.