[CA-203752] New VM from Snapshot doesn't use default host
[CA-203752] New VM from Snapshot doesn't use default host

The reported bug was that the new VM would crash because when clicking through the wizard the pool master is selected by default, not the slave the VM snapshot is on. We already select a default host when a new VM is created from a selected host using HostAncestor, but this property is null for a template (which isn't in the server/VM tree). The fix is that if the selection is a template (which it is when we use new VM from Snapshot) then we instead use its host (using Home()) as the default host. Now the correct host is selected in the VM wizard and the VM creation succeeds.

Signed-off-by: Callum McIntyre <a537161e31cdf7778595df53c402d4fe84d3cdae@citrix.com>

geosharath/xenadmin,letsboogey/xenadmin,geosharath/xenadmin,ushamandya/xenadmin,minli1/xenadmin,huizh/xenadmin,letsboogey/xenadmin,GaborApatiNagy/xenadmin,letsboogey/xenadmin,GaborApatiNagy/xenadmin,geosharath/xenadmin,minli1/xenadmin,letsboogey/xenadmin,ushamandya/xenadmin,jijiang/xenadmin,minli1/xenadmin,ushamandya/xenadmin,Frezzle/xenadmin,stephen-turner/xenadmin,stephen-turner/xenadmin,Frezzle/xenadmin,minli1/xenadmin,GaborApatiNagy/xenadmin,huizh/xenadmin,stephen-turner/xenadmin,xenserver/xenadmin,ushamandya/xenadmin,kc284/xenadmin,kc284/xenadmin,minli1/xenadmin,jijiang/xenadmin,MihaelaStoica/xenadmin,geosharath/xenadmin,Frezzle/xenadmin,GaborApatiNagy/xenadmin,ushamandya/xenadmin,stephen-turner/xenadmin,kc284/xenadmin,stephen-turner/xenadmin,geosharath/xenadmin,kc284/xenadmin,xenserver/xenadmin,xenserver/xenadmin,jijiang/xenadmin,jijiang/xenadmin,stephen-turner/xenadmin,MihaelaStoica/xenadmin,huizh/xenadmin,huizh/xenadmin,huizh/xenadmin,letsboogey/xenadmin,MihaelaStoica/xenadmin,Frezzle/xenadmin,jijiang/xenadmin,MihaelaStoica/xenadmin,kc284/xenadmin,minli1/xenadmin,huizh/xenadmin,GaborApatiNagy/xenadmin,letsboogey/xenadmin,geosharath/xenadmin,Frezzle/xenadmin,MihaelaStoica/xenadmin,MihaelaStoica/xenadmin,jijiang/xenadmin,GaborApatiNagy/xenadmin,Frezzle/xenadmin,ushamandya/xenadmin