engine : Modify Async_tasks table to use CommandEntity

Drop columns from async_tasks table that hold the
information about the command. AsyncTasks class
has been modified to use CommandEntity to store
the command information. When async_task is persisted,
updated/deleted the corresponding CommandEntity is also
persisted, updated/deleted

Change-Id: Ied038b514f1285b4d46deff022beafd9dcfe5c29
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Collapse all Async Command Callbacks

Collapse methods in Poller and EndActionCallBack into
AsyncCommandCallBack interface.

Change-Id: I4a81f54a2a6eb989948956a73ec0e0919b8422c4
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Introduce CommandEntityCleanupManager

Introduce CommandEntityCleanupManager that
cleans old commands in command_entities table
based on a new option CommandEntityAgingThreshold

Change-Id: Ic9a5ea74513e7e56f21b2861b899e6d8868affe8
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Introduction of CommandExecutor and CommandCallBack

Introduces CommandExecutor that execute the given action with
the parameters using an ExecuterService in a seperate
thread. The results of the command execution is passed back
to the CommandCallBack interface.

Change-Id: I70922b5b836971eca76dee26ba67b7023d546fe6
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Add quartz to handle AsycCommands

Adding a call back method checkUpdateCmdStatus
to CommandCallBack which is responsible for
updating the status of the command.

The call back method is periodically called
on commands that have not succeeded using
the quartz framework

Persisting call back and loading them on server
restart will be introduced in latter patches

Change-Id: I66b1e5945884aec412ba412e39266129004d7218
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Persist VdcReturnValue in CommandEntity

Add return_value and return_value class to
command_entities table

Change-Id: I35f4601fe8aceae6d98a76334c55db77097205b5
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
engine : Add Json Mixin to ignore VdcFault setError method

VdcFault has two setError message which cause
a Json exception when serializing and deserializing.
Add a Mixin to ignore one of the setError methods

Change-Id: I579716659ab2dc7fee19b0fcfd0b7c74199e7220
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
packaging: setup: refactor db credentials plugins

Move the questions for db credentials to a common place.

Before this change, db creds were always asked about. Move that to
engine so that they are asked if engine is setup.

Other components that need engine db creds should ask for them
with getCredentials.

Let components owners query for db connections credentials before
users of these components, so that users can use them if already
queried.

Use private engine db credentials consts

Change-Id: Id889c9c3ab1dcc6a873a6f5f2f60bff957e616ea
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
packaging: setup: Making engine configuration optional at engine-setup

Making engine configuration optional asking
to the user if he/she want to configure it during
engine-setup.
Skipping all the engine specific plugin if the user
doesn't want to configure the engine.

Change-Id: I7a7fbc9d2abc141bed49eff20549289cba4a4a61
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
packaging: setup: engine-cleanup split

Let the user decide to remove all the product
components or just some of that at cleanup.

Related-To: https://bugzilla.redhat.com/1060529
Change-Id: I26017770262e313ad38ddfa96baeaea144c86e5f
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
packaging: setup: WebSocketProxy on a separate host

The aim of this feature is to enhance the engine setup being able
to install and configure the WebSocketProxy on a second machine,
where engine does not run, as proposed at:
http://www.ovirt.org/Features/WebSocketProxy_on_a_separate_host

Change-Id: Ifceddd5aa44a77f67a3b6b30c6678d9a3b485f9c
Bug-Url: https://bugzilla.redhat.com/1080992
Bug-Url: https://bugzilla.redhat.com/985945
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
engine,webadmin: Permit refresh capabilities on non-operational host

Change-Id: I50a0d30a718383cf91efaf25a294e1488067057d
Bug-Url: https://bugzilla.redhat.com/1101182
Signed-off-by: Alona Kaplan <alkaplan@redhat.com>
webadmin: adding ListModelRadioGroupEditor

An editor that displays ListModel as a group of radio buttons.

Change-Id: I7a2754a1157b1be725871a57a4618404ad4b3223
Signed-off-by: Alona Kaplan <alkaplan@redhat.com>
engine : Add callback enabled commands to CommandExecutor callback map

Add ability to add ordinary commands to command executor's
call back map. The commands need to have callback enabled

Fixed execution of Command with AsyncTasks using CommandExecutor
framework.

Change-Id: I9765a947d3772fbc47a1adaa91cd54da9ba202bb
Bug-Url: https://bugzilla.redhat.com/1083769
Signed-off-by: Ravi Nori <rnori@redhat.com>
core, db: add vm_jobs table, DAO, and BE

Add vm_jobs table and DAO for supporting Live Merge.

Change-Id: I07734d4c4026062db7a505c1212553abf0b203ac
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Adam Litke <alitke@redhat.com>
Signed-off-by: Greg Padgett <gpadgett@redhat.com>
Signed-off-by: Allon Mureinik <amureini@redhat.com>
vdsbroker: read vmJobs update from getVmStats call

For Live Merge, the vmStats return value may optionally contain a list
of vmJob entries.  These jobs indicate new-style async tasks that run on
the VDS.  As long as the job is returned in the stats, it is not
finished.  Once the job is no longer reported, the caller should query
the expected end state to determine if the task was successful.

Change-Id: I6d0ab4372fe98f8d61f4f393e2823d278f33621f
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Greg Padgett <gpadgett@redhat.com>
vdsbroker: update vmJobs when updating vm statistics

Update vmJob data in the database when updating vmStats.  The jobs
records are created by the initiator of the job (i.e. a command), and
then may be updated and/or removed by VdsUpdateRunTimeInfo.  The job
should be run before the job placeholder is inserted into the database
in order to limit the possibility of a query being made after the
insertion but before job execution, which would result in the job being
prematurely removed from the database.

Change-Id: If1a300d440a0a93381afe047eb294106a38088ec
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Greg Padgett <gpadgett@redhat.com>
vdsbroker: introduce MergeVDSCommand

This command calls a new VDSM verb, merge, which will merge VM snapshots
while a VM is running.

Change-Id: I320d1ac7de50f4a24236c6d26af75a3483b8bc5e
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Greg Padgett <gpadgett@redhat.com>
core, db: add config values for Live Merge feature

Add configuration values for Live Merge, specifying the compatibility
versions for this feature.

Change-Id: I663690c7a11505aa5be2fbab14f49532e4bd3e12
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Greg Padgett <gpadgett@redhat.com>
core: introduce RemoveSnapshotSingleDiskLive BLL command

RemoveSnapshotCommand now has the capability to run
RemoveSnapshotSingleDiskLiveCommand for merging snapshots while a VM
is running.  This new command uses the CommandExecutor framework, and
runs 3 child commands: Merge, MergeStatus, and DestroyImage.

MergeCommand starts a merge job on the host running the VM.  VDSM will
report the job to us in vmStats until it completes, at which time
MergeCommand is considered finished.

MergeStatusCommand will then run to determine whether the merge was
successful, along with discovering the merge direction chosen by vdsm.
This is done by querying the VM's current volume chain.

DestroyImageCommand then removes all the now-orphaned images left
behind by the merge operation.

After the children have all finished successfully, endVmCommand on
RemoveSnapshotSingleDiskLiveCommand updates the database records to
reflect the new post-merge volume chain.

Change-Id: Ic47eb91a0ea1fe150e3b2152e2c9d5f1f2eb3678
Bug-Url: https://bugzilla.redhat.com/1058160
Signed-off-by: Greg Padgett <gpadgett@redhat.com>