hooks: Add OpenStack Network vNIC hook

This hook is used to enable OS-network agent to connect a vNIC as it
wants, instead of trying to connect to the bridge that is sent by engine
(which doesn't exist, as the vNIC should be managed by the agent).

Upon migration, the updated XML is being sent, so no further hook
besides this one is required.

Change-Id: I744b83d9c6027bd817e5d4171a77a005611b9818
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/11108
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
hooks: Support OVS in OpenStack Network vNIC hook

The hook will now support connecting a vNIC both to a standard linux
bridge, and an OVS bridge.

The hook should work in tandem with the corresponding OpenStack Network
plugin: Linux Bridge or OVS plugin.

Change-Id: Ieded0281b8c5b89ad9380881a93d408e09624f38
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15410
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
hooks: Support OpenStack Network in hot plug NIC

Adding hook support for hot plugging a vNIC to the VM.
The hook should behave exactly as the before_device_create hook, so
reusing the same hook code for hot plugging.

Change-Id: I8cae1c46c6165819bc2412183a32f6b335af1811
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15988
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
hooks: README for OpenStack Network vNIC hook

Added a readme file outlining the general behaviour of the hook.

Change-Id: I70586d2189baa6ec7c7fe2e4289aa72326fbdac2
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16002
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Cleanup networking functional tests dummy conf

Due to the fact that the dummies used for the functional tests are
treated just like nics, ifcfg files for them remain after the
functional tests are completed. This patch adds a module teardown
action that restores the networking configuration file status
previous to running the tests.

Patch Set 2:
- Moved the teardown to module level for symmetry.

Change-Id: I7ad2c1b17f6faf5ba12841a385c7eba72fa51d0b
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16329
Reviewed-by: Giuseppe Vallarelli <gvallare@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
hooks: Fix openstacknet hook

The hook should be built with default VDSM build since we want to supply
it to users.

Additionally, the consts file should be packaged with it's "binaries" in
the RPM.

Change-Id: I6e9f1c6a6ffbc4fc0008fe2d897dac0d44a8c300
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16556
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
/me is tired of pep8 flavors

Change-Id: I1c51176a1064837fd6a306f348b9959f82471ee1
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16559
Fix pep8 issue with net functional tests cleanup

The previous patch lacked a blank line and due to jenkins
giving false positives I missed the problem.

Change-Id: I6f64d06f2827278cb91ddb3f87904ce5593c45c2
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16561
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm-tool: speedup loading seboolsetup.py

On RHEL6 "import seobject" takes a very long time. This patch moves the
seobject import statement in seboolsetup.py from module top level to
function level. This small modification reduces the total startup time
of VDSM, since VDSM moves most of the management utilities into
vdsm-tool.

Change-Id: I7f961e2661159f671b17f3ab4fb3d5a7cbc3d6b9
Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/16560
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Simplify configWriter to use netmodels

configwriter add methods were using tons of parameters. It would be
simpler if they were to use netmodels info.

Patch Set 2: clean up the netmodels configurator interaction.

Patch Set 4: Changed bond and bridge properties to use isinstance.

Change-Id: Id9e00f6a8ce21a2e0bf24ad2cd13af6fe3d3f356
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16324
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Giuseppe Vallarelli <gvallare@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
netconf: Add a base configurator class

This patch add a base configurator class to make the code not related
to specific configurator implementation shared by configurator ifcfg
and iproute2.

It renames ifcfg's member configWriter to configApplier, a more generic
name and also applicable to iproute2.

Change-Id: I6a1291409bf96cd54971791aebe9a9e74af325bf
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/16178
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>
Qos feature: Adds bandwidth definition at configuration level.

Network definition when configuring libvirt network is enriched with
the optional bandwidth parameters for traffic shaping. Patch includes
a refactoring of the xml generation and some tests.

Change-Id: If0c3b4b9a6fd5eb53579fb2e157b5325caa88d04
Signed-off-by: Giuseppe Vallarelli <gvallare@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15724
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsmd.init: do not use previous libvirt logrotate

In the past VDSM have been creating /var/log/libvirtd.log to track libvirt
calls and also add rule for such file into /etc/logrotate.d/libvirtd.
However, now VDSM uses /var/log/libvirt/libvirtd.log (commit fe01963f)
and should replace any previous conf on /etc/logrotate.d/libvirtd
with VDSM suggestions.

Change-Id: Iaa9707d892bb03a029300f62ae1ed204cea52486
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16528
Reviewed-by: Sandro Bonazzola <sbonazzo@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
vdsm-tool usage: Adding path variable to init script

Change-Id: Ia5c07ee9bdc99a5b6d491e2ca2be99d3cf04c73f
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16549
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Add balloon_min to VM.getVmBalloonInfo

The balloon_min key will take its value from memGuaranteedSize
attribute. It's default value will be 0, but can be overriden by
whoever is creating the VM instance or setting the attributes.

This functionality is needed for basic memory QoS.

Change-Id: I4fca97bf0d3621883d1320673c648d0fbbd50340
Signed-off-by: Martin Sivak <msivak@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15799
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
spec: finer-grained libvirt requirement

Change-Id: I48e25ca9e307c2cde7f29b65c68ff6e122ec8f64
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15761
Reviewed-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
before/after_update_device hook now receives custom properties

Patch Set 2:
Patch set 1 took the custom properties from the device. But
that means that the custom properties past in the command
are ignored. Patch set 2 fixes this: The custom properties
are now always taken from the verb's arguments, and the
device's custom properties are updated.

Patch Set 3:
Moved the update to the in-memory cache of the device's
custom properties to a more sensible location.

Change-Id: Ife0f617fe7e40104de3dc5bcad28b2de04f1d446
Signed-off-by: Assaf Muller <amuller@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16408
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
API: Add free memory to stats

currently, only memAvailable is exposed by API. But this api is a
calculated value and so it may return negative value in case ksm
is up and pages are shred among VMs.

The new "memFree" returns the true free memory on the host.
i.e. 'MemFree' + 'Cached' + 'Buffers' (from meminfo)

Change-Id: I0e5ebf8b40b728424ba92bf8131fff51b45893bd
Bug-Url: https://bugzilla.redhat.com/977758
Signed-off-by: Ofri Masad <omasad@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/16253
Reviewed-by: Doron Fediuck <dfediuck@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
RAM snapshots feature

This patch adds the ability to take live snapshot of a VM that includes
its memory state, and to restore memory state that is saved as part of a
snapshot when reverting back to it.

There is a detailed description of the design at the feature page:
http://wiki.ovirt.org/Features/RAM_Snapshots

Change-Id: I62401940afb0228cbd9dd3611b6ed8e0ff67c82c
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15072
Reviewed-by: Yeela Kaplan <ykaplan@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Cleanup the usages of configWriter in configNetwork

We should keep the interaction with configWriter inside configurator.
So this patch changes to construct new configWriter instantance in
ifcfg's __init__() and use configurator to implement the transaction
management of configuration.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Change-Id: I19310221ec2c5d7c621c121b77ed87d060676d42
Reviewed-on: http://gerrit.ovirt.org/16343
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Tested-by: Dan Kenigsberg <danken@redhat.com>