tools: Fixing mailserver validation

This solves mail server validation -
In case MAIL_SERVER does not exist, a proper
error will be reported indicating MAIL_SERVER should
exist.
In case MAIL_SERVER exists, but empty or
with a non resolvable content, a proper error
indicating the MAIL_SERVER should contian resolvable
address will be reported.

Change-Id: Id78bec65bfa883e5fc7ec369a8b4beba6610b4d0
Bug-Url: https://bugzilla.redhat.com/921405
Signed-off-by: Yair Zaslavsky <yzaslavs@redhat.com>
userportal: fix SD selection on clone VM from template

Fixing storage domain selection when creating a VM
from template using clone allocation.

DisksAllocationModel -> getImageToDestinationDomainMap()
should be passed to AddVmFromTemplateParameters
(for getting user's selected values).

Change-Id: Ic1d372d30b3bcf110fa2f63847f6dfa32f8e6b62
Bug-Url: https://bugzilla.redhat.com/928399
Signed-off-by: Daniel Erez <derez@redhat.com>
engine: Compare and set instead of updateVdsDynamic in VM scenarios

The following patch should solve a following problems:
1. Deadlock between RunVmCommandBase.decreasePendingVms and VdsUpdateRuntimeInfo.AfterRefreshTreatment
   line with code: ResourceManager.getInstance().getEventListener().processOnVmPoweringUp(...);
2. Replace get for vds dynamic , update some values, and after that update in db by single db update.
   The old way creates a dirty state fot host status field, fix will reduce a noise in host life cycle
   scenarios
3. Performance improved: less db access, less locks acquired, no deadlocks

What is not solved (problems which were before and should be solved in next patches)
1. Race between VdsManager.OnTimer() and RunVmCommandBase.decreasePendingVms()
2. RunVmDelayer.evaluated can be based on not updated data
3. Interaction of loop over
   ResourceManager.getInstance().getEventListener().processOnVmPoweringUp(...)
   inside VdsUpdateRuntimeInfo.AfterRefreshTreatment with RunVmCommands - it is a war for locks, or
   "code of death" for all system during RunVm scenarious

Change-Id: I363afc5c3411b0c13e6d6c9ed5b16004738b6ca7
Signed-off-by: Michael Kublin <mkublin@redhat.com>
engine: Fixing perfomance issue between VdsRunTimeInfo and RunVmCommandBase

After introducing atomic update, no need for special lock inside of
RunVmCommandBase.decreasePendingVms()
In order to keep functionality for delay: SynchronousQueue will be used.
The thread will stuck until time out or some other thread will add some object to queue

Change-Id: Ia6c6e26c79dc6c06c9621e1938ecd034e9ce7ec7
Signed-off-by: Michael Kublin <mkublin@redhat.com>
engine: Support 3.1 network topologies by AttachNetwork

The patch provides support for 3.1 network topologies by
the AttachNetworkCommand, also exposed via the api by:
api/hosts/{host:id}/nics/{nic:id}/attach

The supported network topologies over a nic are:
1. Attach a VM network (with/without vlan)
2. Attach a non-VM network (with/without vlan)
3. Attach a non-VM network to a nic which a vlan is already attached to.
4. Attach a vlan to a nic which a non-VM network is already attached to.

The unsupported network topologies are:
1. Attaching any network to a nic which a non-vlan VM network is already attached to.
2. Attach a non-vlan VM network to a nic which any network is already attached to.
3. Attach a non-VM network to a nic which a non-VM network is already attached to.
4. Attach any network to a nic if unmanaged network is already attached to.

Change-Id: I9e1abe84e2877171be5af41c9bb3ab590fed3653
Signed-off-by: Moti Asayag <masayag@redhat.com>
webadmin, core: enable edit Posix storage domains

Enable editing path of Posix storage domains via  UI.
Domains can be edited when in maintenance, the edited properties
are path, vfstype and mount options.

Change-Id: I8904ffab80e9d6e6bfdee4b8375872d1ff64b4d4
Signed-off-by: Alissa Bonas <abonas@redhat.com>
engine: Host with no display network should not be selected to run VMs

If ConfigValue.OnlyRequiredNetworksMandatoryForVdsSelection is false,
or if the cluster's display network is not attached to the host, the host
shouldn't be selected/eligible to run VMs in that cluster.

Change-Id: Ie90e2821f2299be85b1d4c9a6f064a4053f93e73
Bug-Url: https://bugzilla.redhat.com/949434
Signed-off-by: Alona Kaplan <alkaplan@redhat.com>
tools: Fix notifier to safely handle MAIL_SERVER

Change-Id: Ica12831cbb0b1ccae3d1f93c5d67e3ef9e5ae024
signed-off-by: Yair Zaslavsky <yzaslavs@redhat.com>
engine: Enable gluster hook on cluster

Added Bll command to enable a given gluster hook
on all available up servers in the gluster cluster. This command
will be invoked from the hook management UI.

Once the BLL command is invoked,
- VDS command is called to enable hook on each of the server.
- Hook's status is changed to enabled in DB.
- If there are errors enabling the hook on any of the servers in
the cluster, the conflict status of hook is updated in DB to
indicate that there is a status conflict.

Added an abstract class GlusterHookStatusChangeCommand that
EnableGlusterHookCommand extends from. This class uses
ThreadPoolUtil to invoke the VDS commands simultaneously.

Change-Id: Icc6f9c77393ebed2803ec2a1b295a09f61642c31
Signed-off-by: Selvasundaram <sesubram@redhat.com>
Signed-off-by: Sahina Bose <sabose@redhat.com>
webadmin: Enable Gluster hooks

Enable action added for Gluster Hooks sub tab in cluster.

Change-Id: If4b3af2c0669278e1fc776420e1ed8bf70ddbe5f
Signed-off-by: Kanagaraj M <kmayilsa@redhat.com>
core: Run tests without data source location retry

Since commit fd6835 the application retries the location of the data
source, this means that some tests will take a long time to run because
the data source is never deployed in the testing environment. To prevent
that this change adds configuration parameters to run those tests with
an alternative configuration that disables the retry.

Change-Id: I8583da699ae46ce571bb96aa79809031d8d54990
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
frontend: ClassCastException in VmSnapshotListModel fix

The change in AsyncDataProvider.GetCustomPropertiesList in ada6bac1 caused
ClassCastException. This patch fixes handling result of this method in
VmSnapshotListModel.

Change-Id: Ie23f1994d218742133a7d963173e416d8e94cfcc
Signed-off-by: Frantisek Kobzik <fkobzik@redhat.com>
userportal: fix SD selection on clone VM from template

Fixing storage domain selection when creating a VM
from template using clone allocation.

DisksAllocationModel -> getImageToDestinationDomainMap()
should be passed to AddVmFromTemplateParameters
(for getting user's selected values).

Change-Id: I67e6c4af0ffed01f37bf3c5798654a250e45a018
Bug-Url: https://bugzilla.redhat.com/928410
Signed-off-by: Daniel Erez <derez@redhat.com>
core: Add activeNic attribute to VDS class

Added activeNic attribute to VDS class which represents the last
NIC used to communicate with the host.

Change-Id: I95b14d4f8315f85d15b12dde1b67524f5ffe9ae3
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Update host activeNic on GetCapabilities

The patch saves the value of activeNic provided by VDSM property
lastClientIface and returns the vds element which contains it as
a return value of the activate command.

Change-Id: I04e6452078a56e1aba0b57464ffde529285fb34d
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Allow skipping management network validation

The management network validation is skipped when refresh capabilities
is being executed as part of the host activation flow. In this flow
there is a change the host wasn't configured to have the management
network, therefore management network is removed from the network
validation and it be performed as part of the setup network sequence
in which the management network will be created on the host.

Change-Id: Idf4bf4affcd901b23e2d4d55ba85763928180fcd
Signed-off-by: Moti Asayag <masayag@redhat.com>
packaging: do not fail if /var/tmp/ovirt-engine missing

Change-Id: If189b0380911f857b5b412436b966801bb4827a2
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>
core: validate vfstype is not empty for Posix conn

Add validation when adding a new Posix storage connection that
vfsType is not empty.

Change-Id: I38bf5820ed6c6220bd2c9b9d6be1fa6dd31934ea
Signed-off-by: Alissa Bonas <abonas@redhat.com>
packaging: proxy: rename proxy httpd conf.d file

In rhel the mod_proxy_ajp module is loaded in its own conf.d file named
proxy_ajp.conf.

Our proxy configuration should be loaded after this configuration file
to make sure the proxy is loaded and the proxy_ajp_module symbol is
available.

Change-Id: Ic37b672d262985b38ea253c165ae2234d70963d2
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
webadmin: Gateway is not defined after bonding the RHEVM interface.

When detaching the network its parameters (boot protocol, address, subnet
and gateway- for managenemt network) are saved for the next attach.

The bug was that in case of managemnet network the gateway parameter was
always determined from the nicEntity.
But if the management network is over vlan it should be taken from the
vlanNic.

Change-Id: I7deff4305d04a6cfc943bb38cb795373ea7ff6e4
Bug-Url: https://bugzilla.redhat.com/923443
Signed-off-by: Alona Kaplan <alkaplan@redhat.com>