While diagnosing VM restart/shutdown hangs, I found a funny (and wrong) behavior of XenServer hosts. Looks like when guest have MD raid created on block device itself, XenServer host itself starts to utilize MD raid from the VDI when VDI's LVM volume is activated or rescanned.
Probably autoscan for MD RAID devices is not ignoring VDI/VHD LVM volumes on host.
For what this causes:
it causes host being unable to i.e. stop or reboot VM affected because MD layer blocks LVM volume from being deactivated.
Also, starting an guest MD volume on host and trying to synchronize it from host can cause data corruption, because it will most probably destroy VHD structure.
How to repeat:
Create a Linux VM. Create MD RAID device on it with --metadata=0.90 option (don't know if it's required to trigger the bug, but we did it that way) over block devices (i.e. xvda and xvdb). Try to restart VM. Check /proc/mdstat on host to see host found the MD and is holding it.