core: adding DAO support for unregistered VMs/Templates.

* Add new BE OvfEntityData
* Adding new table unregistered_ovf_of_entities
* Add stored procedures support
* Adding UnregisteredOVFDataDAO and implementation

This patch is part of the feature ImportStorageDomain
(see http://www.ovirt.org/Features/ImportStorageDomain)

Change-Id: I385fac757f46131ae0c0048b6cf39b78f037e852
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Support detach Storage Domain containing entities.

Adding support for detaching a Data Storage Domain which contains disks, VMs
or Templates.
We should not allow detach of Storage Domain if it contains VM from
pools or VM in preview.
When detaching a Storage Domain, disk snapshots/shareable disks will not be saved
since they are not contained in the OVF.

This patch is part of the feature ImportStorageDomain
(see http://www.ovirt.org/Features/ImportStorageDomain)

Change-Id: I971fe6acd4a2667a09487c5e1108cf7c759587f1
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Detach storage domain when remove Storage Pool.

Allowing to detach domain with entities when removing Storage Pool.
The entities (VM/Template/Disks) should be removed from the setup and
only the VMs/Templates' OVF, should be part of the unregistered table.

Change-Id: I120c6b001a197e65528edb73375b379f76d24cd5
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Add snapshot to the OVF generation

Adding also snapshots when building the VM OVF.
We are already incrementing the generation in the end command when
deleting/creating a new snapshot

Change-Id: I8ba05c2e362fb9b22d6b4fb5a14698ad99d7bd1e
Bug-Url: https://bugzilla.redhat.com/1069780
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Use import command to register a VM

Adding logic to register an unregistered VM to a cluster.

Change-Id: I5ee64651eb614feb6ac9d7fde88a4ee6348aff06
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Adding import of unregistered VM template

Adding an unregistered Template using the import command.
The following patch adds the ability to import the Template by adding
new method in OvfHelper and through
ImportVmTemplateFromConfigurationCommand

Change-Id: I4fc184e687cbeebf4aa732c901f98222d5b11097
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Add vdc queries for getting unregistered entities.

A new query which will return if a VM is unregitered or not.
It should be used mainly for REST, since the Import API will be used
also for unregistered VMs,
and there is no indication if the VM is unregistered or simply a VM to
be imported from an Export domain.

Change-Id: I83a937dcc8cd86d7f88f643bb7ba0f03d27a8ee6
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
REST: Add calls for queries to get unregistered entities.

Add support for REST to call queries for unregistered entities.

Change-Id: I7adacfabe640fba6b0ae1a77d27cbe03c28edd37
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
REST: Add support for REST to get all the unregistered entities

Adding support to get unregistered entities for storage domain in REST.
The user will have to use the entity API following a semicolon and
an unregistered string (as so : /storageDomain/xxx/vms;unregistered)
Register VM/Tempalte means importing the VM/Tempalte from the data
domain, by
inserting the configuration of the VM/Template and disks into the DB
without the copy process.

Change-Id: Ia4a020c4c653b0fafed16c1d29924223f9b2879f
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Add log instead of comment in OvfDataUpdater.

Adding log when currentDbGeneration is null

Change-Id: I94dd7e1f597771054ab2344179acf7cef6ab05d2
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core: Initialze images for unregistered VM/Template

initialize the images with the relevant storagePoolId which now, the
Storage Domain is attached to.
Also initialize the images in the parameters and in the Template so the
Import process would add them to the DB.

Change-Id: Icb9c68c2b28cceb1800ed21ecb9d9d24a4a05cac
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>