I’ve encountered this error a couple of times now:

Environment message: Type=Error; Message=TF259096: Team Foundation Server has stopped the following operation because of an internal error: Deploy environment. Additional information: Sequence contains no matching element.

Try the operation again. If the problem persists, contact your system administrator.

I’d added a new Hyper-V host to SCVMM 2008 R2 and was trying to deploy a lab to the new host. It failed with that error. There’s a good thread in the Microsoft forums that gives the clue as to what’s really going wrong. It turns out that TFS Lab Management doesn’t support clustered Hyper-V hosts. Sometimes “doesn’t support” means “well it might work, but don’t call us if you have problems”. In this case it means “No, it doesn’t work”.

If you run the “Visual Studio Lab Management Health Check” report from the TFS 2010 Best Practise Analyzer (part of the TFS Power Tools), you’ll also get this error highlighted as “Host is part of a host cluseter” (sic).

Removing the clustered host from the TFS configuration isn’t enough. It also needs to be removed from SCVMM too. Having done that, you should be able to deploy again.

Hopefully, this limitation will be removed with TFS v.Next.