[DR] Deal with metadata VDIs when they are introduced by storage.
[DR] Deal with metadata VDIs when they are introduced by storage.

After storage introduces metadata VDI records, it will repopulate the
value of metadata_of_pool if valid. After this happens, XAPI will now try
to restart database replication if the VDI was created by the local
pool, otherwise it will cache the pool UUID and database generation
count from the VDI.

Signed-off-by: John Else <37b74501daa612e48fea94f9846ed4ddeb6a8f07@citrix.com>

agimofcarmen/xen-api,koushikcgit/xen-api,robertbreker/xen-api,cheng--zhang/xen-api,koushikcgit/xen-api,djs55/xen-api,guard163/xen-api,euanh/xen-api,anoobs/xen-api,anoobs/xen-api,cheng-z/xen-api,vasilenkomike/xen-api,thomassa/xen-api,cheng-z/xen-api,jjd27/xen-api,euanh/xen-api,djs55/xen-api,ravippandey/xen-api,srowe/xen-api,robertbreker/xen-api,cheng--zhang/xen-api,guard163/xen-api,vasilenkomike/xen-api,koushikcgit/xen-api,srowe/xen-api,srowe/xen-api,euanh/xen-api,jjd27/xen-api,vasilenkomike/xen-api,cheng--zhang/xen-api,robertbreker/xen-api,koushikcgit/xen-api,thomassa/xen-api,salvocambria/xen-api,djs55/xen-api,guard163/xen-api,huizh/xen-api,simonjbeaumont/xen-api,ravippandey/xen-api,euanh/xen-api,Frezzle/xen-api,srowe/xen-api,salvocambria/xen-api,jjd27/xen-api,robertbreker/xen-api,Frezzle/xen-api,rafalmiel/xen-api,rafalmiel/xen-api,djs55/xen-api,guard163/xen-api,ravippandey/xen-api,vasilenkomike/xen-api,robertbreker/xen-api,jjd27/xen-api,simonjbeaumont/xen-api,anoobs/xen-api,vasilenkomike/xen-api,Frezzle/xen-api,thomassa/xen-api,ravippandey/xen-api,thomassa/xen-api,huizh/xen-api,simonjbeaumont/xen-api,cheng--zhang/xen-api,salvocambria/xen-api,vasilenkomike/xen-api,anoobs/xen-api,Frezzle/xen-api,cheng--zhang/xen-api,anoobs/xen-api,jjd27/xen-api,thomassa/xen-api,salvocambria/xen-api,cheng--zhang/xen-api,ravippandey/xen-api,simonjbeaumont/xen-api,robertbreker/xen-api,salvocambria/xen-api,cheng-z/xen-api,djs55/xen-api,anoobs/xen-api,cheng-z/xen-api,agimofcarmen/xen-api,djs55/xen-api,thomassa/xen-api,huizh/xen-api,euanh/xen-api,rafalmiel/xen-api,Frezzle/xen-api,agimofcarmen/xen-api,rafalmiel/xen-api,huizh/xen-api,koushikcgit/xen-api,rafalmiel/xen-api,jjd27/xen-api,koushikcgit/xen-api,guard163/xen-api,huizh/xen-api,cheng--zhang/xen-api,simonjbeaumont/xen-api,rafalmiel/xen-api,agimofcarmen/xen-api,srowe/xen-api,cheng-z/xen-api,cheng-z/xen-api,guard163/xen-api,euanh/xen-api,agimofcarmen/xen-api,simonjbeaumont/xen-api,agimofcarmen/xen-api,salvocambria/xen-api,huizh/xen-api,ravippandey/xen-api,cheng-z/xen-api