core: Warning when deleting an instance type which is attached to a VM

Backend part - adds a query to get all the VMs which are based on an
instance type.

Change-Id: I5ed11ee1b543bda00f41b00c5726a907eaf498de
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>