Merge "Update nova-compute to support baremetal case"
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index b1d9bcd..2c762b0 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -13,3 +13,5 @@
         enabled: true
       grafana:
         enabled: true
+      telegraf:
+        enabled: true
diff --git a/nova/compute.sls b/nova/compute.sls
index 9820a98..7c60447 100644
--- a/nova/compute.sls
+++ b/nova/compute.sls
@@ -189,7 +189,6 @@
   - template: jinja
   - require:
     - pkg: nova_compute_packages
-{%- if not grains.get('noservices', False) %}
   - watch_in:
     - service: {{ compute.libvirt_service }}
 
@@ -205,7 +204,6 @@
 
 {%- endif %}
 {%- endif %}
-{%- endif %}
 
 /etc/libvirt/qemu.conf:
   file.managed:
@@ -228,17 +226,18 @@
     - pkg: nova_compute_packages
   - onlyif: "virsh net-list | grep default"
 
-{%- if not grains.get('noservices', False) %}
 {{ compute.libvirt_service }}:
   service.running:
   - enable: true
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - require:
     - pkg: nova_compute_packages
     - cmd: virsh net-undefine default
   - watch:
     - file: /etc/libvirt/{{ compute.libvirt_config }}
     - file: /etc/libvirt/qemu.conf
-{%- endif %}
 
 {%- if grains.get('init', None) == "upstart" %}
 # MOS9 libvirt fix for upstart
diff --git a/nova/controller.sls b/nova/controller.sls
index 0a8ac8f..006a541 100644
--- a/nova/controller.sls
+++ b/nova/controller.sls
@@ -93,15 +93,15 @@
 
 {%- endfor %}
 
-{%- if not grains.get('noservices', False) %}
-
 {%- if controller.version in ["mitaka", "newton", "ocata"] %}
 nova_controller_sync_apidb:
   cmd.run:
   - name: nova-manage api_db sync
+  {%- if grains.get('noservices') %}
+  - onlyif: /bin/false
+  {%- endif %}
   - require:
     - file: /etc/nova/nova.conf
-{%- endif %}
 
 {%- if controller.version in ["newton", "ocata"] %}
 nova_controller_online_data_migrations:
diff --git a/nova/meta/telegraf.yml b/nova/meta/telegraf.yml
new file mode 100644
index 0000000..6b2366b
--- /dev/null
+++ b/nova/meta/telegraf.yml
@@ -0,0 +1,7 @@
+{%- from "nova/map.jinja" import controller with context %}
+{%- if controller is defined and controller.get('enabled', False) and controller.cpu_allocation_ratio is defined %}
+remote_agent:
+  input:
+    openstack:
+      cpu_ratio: "{{ controller.cpu_allocation_ratio }}"
+{%- endif %}