Merge "ensure that libvirt is running before creation of VM"
diff --git a/salt/control/virt.sls b/salt/control/virt.sls
index f85af14..d508252 100644
--- a/salt/control/virt.sls
+++ b/salt/control/virt.sls
@@ -20,6 +20,14 @@
 
 {%- if cluster.engine == "virt" %}
 
+libvirt_service:
+  service.running:
+  - name: {{ control.virt_service }}
+  - enable: true
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
+
 ##Posibility to disable rng device globally for old libvirt version
 {%- if cluster.rng is defined %}
 {%- set rng = cluster.rng %}
@@ -63,6 +71,8 @@
       {%- endfor %}
       {%- endif %}
   - unless: virsh list --all --name| grep -E "^{{ node_name }}.{{ cluster.domain }}$"
+  - require:
+    - libvirt_service
 
 #salt_control_seed_{{ cluster_name }}_{{ node_name }}:
 #  module.run:
diff --git a/salt/map.jinja b/salt/map.jinja
index ed48e4a..b20f378 100644
--- a/salt/map.jinja
+++ b/salt/map.jinja
@@ -195,11 +195,13 @@
 {% if grains.get('oscodename') == 'trusty' %}
   - libguestfs-tools
 {% endif %}
+  virt_service: 'libvirt-bin'
 
 RedHat:
   virt_pkgs:
   - libvirt-dev
   - pkg-config
+  virt_service: 'libvirtd'
 {%- endload %}
 
 {%- load_yaml as renderer_defaults %}