Merge "Add dependency on HAProxy service"
diff --git a/README.rst b/README.rst
index 4aeecf8..dd27877 100644
--- a/README.rst
+++ b/README.rst
@@ -131,6 +131,9 @@
         enabled: true
         virtualization: kvm
         availability_zone: availability_zone_01
+        aggregates:
+        - hosts_with_fc
+        - hosts_with_ssd
         security_group: true
         resume_guests_state_on_host_boot: False
         bind:
@@ -281,6 +284,21 @@
             - availability_zone_01
             - availability_zone_02
 
+
+
+Aggregates
+
+.. code-block:: yaml
+
+    nova:
+      client:
+        enabled: true
+        server:
+          identity:
+            aggregates:
+            - aggregate1
+            - aggregate2
+
 SR-IOV
 ------
 
@@ -320,6 +338,39 @@
         - path: /mnt/hugepages_1GB
         - path: /mnt/hugepages_2MB
 
+Custom Scheduler filters
+------------------------
+
+If you have a custom filter, that needs to be included in the scheduler, then you can include it like so:
+
+.. code-block:: yaml
+
+  nova:
+    controller:
+      scheduler_custom_filters:
+      - my_custom_driver.nova.scheduler.filters.my_custom_filter.MyCustomFilter
+
+      # Then add your custom filter on the end (make sure to include all other ones that you need as well)
+      scheduler_default_filters: "DifferentHostFilter,RetryFilter,AvailabilityZoneFilter,RamFilter,CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,PciPassthroughFilter,MyCustomFilter"
+
+Hardware Trip/Unmap Support
+---------------------------
+
+To enable TRIM support for ephemeral images (thru nova managed images), libvirt has this option.
+
+.. code-block:: yaml
+
+  nova:
+    compute:
+      libvirt:
+        hw_disk_discard: unmap
+
+In order to actually utilize this feature, the following metadata must be set on the image as well, so the SCSI unmap is supported.
+
+.. code-block:: bash
+
+  glance image-update --property hw_scsi_model=virtio-scsi <image>
+  glance image-update --property hw_disk_bus=scsi <image>
 
 Documentation and Bugs
 ======================
diff --git a/_modules/novang.py b/_modules/novang.py
index d2009ae..dcac2fc 100644
--- a/_modules/novang.py
+++ b/_modules/novang.py
@@ -243,3 +243,44 @@
         'Availability Zone': item.__getattr__('availability_zone'),
     }
     return ret
+
+def aggregate_list(profile=None):
+    '''
+    list existing aggregates
+    '''
+    connection_args = get_connection_args(profile)
+    conn = _auth(profile)
+    nt_ks = conn.compute_conn
+    ret = nt_ks.aggregates.list()
+    return ret
+
+
+def aggregate_get(name, profile=None):
+    '''
+    list existing aggregates
+    '''
+    connection_args = get_connection_args(profile)
+    conn = _auth(profile)
+    nt_ks = conn.compute_conn
+    aggregate_exists=False
+    items = aggregate_list(profile)
+    for p in items:
+        item = nt_ks.aggregates.get(p).__getattr__('name')
+        if item == name:
+            aggregate_exists = True
+    return aggregate_exists
+
+
+def aggregate_create(name, aggregate, profile=None):
+    '''
+    create aggregate
+    '''
+    connection_args = get_connection_args(profile)
+    conn = _auth(profile)
+    nt_ks = conn.compute_conn
+    item = nt_ks.aggregates.create(name, aggregate)
+    ret = {
+        'Id': item.__getattr__('id'),
+        'Aggregate Name': item.__getattr__('name'),
+    }
+    return ret
diff --git a/_states/novang.py b/_states/novang.py
index 46fae9c..17ba41c 100644
--- a/_states/novang.py
+++ b/_states/novang.py
@@ -67,6 +67,20 @@
         return _already_exists(availability_zone, 'availabilty zone')
     return existing_availability_zones
 
+def aggregate_present(name=None, aggregate=None, profile=None):
+    '''
+    Ensures that the nova aggregate exists
+    '''
+    name = aggregate
+    aggregate_exists = __salt__['novang.aggregate_get'](name, profile)
+    if aggregate_exists == False:
+        item_created = __salt__['novang.aggregate_create'](name, aggregate, profile)
+        if bool(item_created):
+            return _created(aggregate, 'aggregate', item_created)
+    else:
+        return _already_exists(aggregate, 'aggregate')
+    return existing_aggregate
+
 
 def instance_present(name, flavor, image, networks, security_groups=None, profile=None, tenant_name=None):
     ret = {'name': name,
@@ -166,4 +180,4 @@
     else:
         changes_dict['comment'] = \
             '{0} {1} is in correct state'.format(resource, name)
-    return changes_dict
\ No newline at end of file
+    return changes_dict
diff --git a/nova/client.sls b/nova/client.sls
index 2d20a8f..57d62e5 100644
--- a/nova/client.sls
+++ b/nova/client.sls
@@ -44,6 +44,17 @@
 
 {%- endif %}
 
+{%- if identity.aggregates is defined %}
+
+{%- for aggregate_name in identity.aggregates %}
+nova_aggregate_{{ aggregate_name }}:
+  novang.aggregate_present:
+    - aggregate: {{ aggregate_name }}
+    - profile: {{ identity_name }}
+{%- endfor %}
+
+{%- endif %}
+
 {%- endfor %}
 
 {%- endif %}
diff --git a/nova/compute.sls b/nova/compute.sls
index a599fcf..efc8b0a 100644
--- a/nova/compute.sls
+++ b/nova/compute.sls
@@ -120,8 +120,6 @@
   - watch:
     - file: /etc/nova/nova.conf
 
-{%- if compute.availability_zone != None %}
-
 {%- set ident = compute.identity %}
 
 {%- if ident.get('api_version', '2') == '3' %}
@@ -138,6 +136,8 @@
 
 {%- set identity_params = " --os-username="+ident.user+" --os-password="+ident.password+" --os-project-name="+ident.tenant+" --os-auth-url="+protocol+"://"+ident.host+":"+ident.port|string+"/"+version %}
 
+{%- if compute.availability_zone != None %}
+
 Add_compute_to_availability_zone_{{ compute.availability_zone }}:
   cmd.run:
   - name: "nova {{ identity_params }} aggregate-add-host {{ compute.availability_zone }} {{ pillar.linux.system.name }}"
@@ -145,6 +145,14 @@
 
 {%- endif %}
 
+{%- for aggregate in compute.aggregates %}
+Add_compute_to_aggregate_{{ aggregate }}:
+  cmd.run:
+  - name: "nova {{ identity_params }} aggregate-add-host {{ aggregate }} {{ pillar.linux.system.name }}"
+  - unless: "nova {{ identity_params }} aggregate-details {{ aggregate }} | grep {{ pillar.linux.system.name }}"
+
+{%- endfor %}
+
 {%- if compute.virtualization == 'kvm' %}
 
 {% if compute.ceph is defined %}
diff --git a/nova/controller.sls b/nova/controller.sls
index 69f063c..c212413 100644
--- a/nova/controller.sls
+++ b/nova/controller.sls
@@ -98,10 +98,14 @@
     - pkg: nova_controller_packages
     - pkg: nova_placement_package
 
+placement_config:
+  file.symlink:
+     - name: /etc/apache2/sites-enabled/nova-placement-api.conf
+     - target: /etc/apache2/sites-available/nova-placement-api.conf
+
 nova_cell_create:
   cmd.run:
-  - name:
-    - 'su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova'
+  - name: 'su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova'
   - unless: 'nova-manage cell_v2 list_cells | grep cell1'
   - require:
     - file: /etc/nova/nova.conf
diff --git a/nova/files/grafana_dashboards/nova_influxdb.json b/nova/files/grafana_dashboards/nova_influxdb.json
index 5c2b325..52c1757 100644
--- a/nova/files/grafana_dashboards/nova_influxdb.json
+++ b/nova/files/grafana_dashboards/nova_influxdb.json
@@ -2501,7 +2501,7 @@
               ],
               "measurement": "openstack_nova_service",
               "policy": "default",
-              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'compute' GROUP BY time($interval), hostname",
+              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'compute' GROUP BY time($interval), hostname fill(null)",
               "rawQuery": true,
               "refId": "A",
               "resultFormat": "table",
@@ -2984,7 +2984,7 @@
               ],
               "measurement": "openstack_nova_service",
               "policy": "default",
-              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'scheduler' GROUP BY time($interval), hostname",
+              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'scheduler' GROUP BY time($interval), hostname fill(null)",
               "rawQuery": true,
               "refId": "A",
               "resultFormat": "table",
@@ -3467,7 +3467,7 @@
               ],
               "measurement": "openstack_nova_service",
               "policy": "default",
-              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'conductor' GROUP BY time($interval), hostname",
+              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'conductor' GROUP BY time($interval), hostname fill(null)",
               "rawQuery": true,
               "refId": "A",
               "resultFormat": "table",
@@ -3950,7 +3950,7 @@
               ],
               "measurement": "openstack_nova_service",
               "policy": "default",
-              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'cert' GROUP BY time($interval), hostname",
+              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'cert' GROUP BY time($interval), hostname fill(null)",
               "rawQuery": true,
               "refId": "A",
               "resultFormat": "table",
@@ -4433,7 +4433,7 @@
               ],
               "measurement": "openstack_nova_service",
               "policy": "default",
-              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'consoleauth' GROUP BY time($interval), hostname",
+              "query": "SELECT az as \"AZ\", state, last(value) FROM \"openstack_nova_service\" WHERE $timeFilter AND \"environment_label\" =~ /^$environment$/and service = 'consoleauth' GROUP BY time($interval), hostname fill(null)",
               "rawQuery": true,
               "refId": "A",
               "resultFormat": "table",
@@ -4589,7 +4589,7 @@
           "valueMaps": [
             {
               "op": "=",
-              "text": "0",
+              "text": "N/A",
               "value": "null"
             }
           ],
@@ -4639,18 +4639,12 @@
                     "$interval"
                   ],
                   "type": "time"
-                },
-                {
-                  "params": [
-                    "0"
-                  ],
-                  "type": "fill"
                 }
               ],
               "groupByTags": [],
               "measurement": "openstack_nova_instances",
               "policy": "default",
-              "query": "SELECT max(\"value\") FROM \"openstack_nova_instances\" WHERE \"environment_label\" =~ /^$environment$/ AND \"state\" = 'active' AND $timeFilter GROUP BY time($interval) fill(0)",
+              "query": "SELECT max(\"value\") FROM \"openstack_nova_instances\" WHERE \"environment_label\" =~ /^$environment$/ AND \"state\" = 'active' AND $timeFilter GROUP BY time($interval)",
               "rawQuery": false,
               "refId": "A",
               "resultFormat": "time_series",
@@ -4832,7 +4826,7 @@
           "valueMaps": [
             {
               "op": "=",
-              "text": "0",
+              "text": "N/A",
               "value": "null"
             }
           ],
@@ -4881,18 +4875,12 @@
                     "$interval"
                   ],
                   "type": "time"
-                },
-                {
-                  "params": [
-                    "0"
-                  ],
-                  "type": "fill"
                 }
               ],
               "groupByTags": [],
               "measurement": "openstack_nova_instances",
               "policy": "default",
-              "query": "SELECT max(\"value\") FROM \"openstack_nova_instances\" WHERE \"environment_label\" =~ /^$environment$/ AND \"state\" = 'error' AND $timeFilter GROUP BY time($interval) fill(0)",
+              "query": "SELECT max(\"value\") FROM \"openstack_nova_instances\" WHERE \"environment_label\" =~ /^$environment$/ AND \"state\" = 'error' AND $timeFilter GROUP BY time($interval)",
               "rawQuery": false,
               "refId": "A",
               "resultFormat": "time_series",
@@ -5122,18 +5110,12 @@
                     "$interval"
                   ],
                   "type": "time"
-                },
-                {
-                  "params": [
-                    "0"
-                  ],
-                  "type": "fill"
                 }
               ],
               "groupByTags": [],
               "measurement": "openstack_nova_instance_creation_time",
               "policy": "default",
-              "query": "SELECT mean(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval) fill(0)",
+              "query": "SELECT mean(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval)",
               "rawQuery": false,
               "refId": "A",
               "resultFormat": "time_series",
@@ -5171,18 +5153,12 @@
                     "$interval"
                   ],
                   "type": "time"
-                },
-                {
-                  "params": [
-                    "0"
-                  ],
-                  "type": "fill"
                 }
               ],
               "groupByTags": [],
               "measurement": "openstack_nova_instance_creation_time",
               "policy": "default",
-              "query": "SELECT max(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval) fill(0)",
+              "query": "SELECT max(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval)",
               "rawQuery": false,
               "refId": "B",
               "resultFormat": "time_series",
@@ -5220,18 +5196,12 @@
                     "$interval"
                   ],
                   "type": "time"
-                },
-                {
-                  "params": [
-                    "0"
-                  ],
-                  "type": "fill"
                 }
               ],
               "groupByTags": [],
               "measurement": "openstack_nova_instance_creation_time",
               "policy": "default",
-              "query": "SELECT min(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval) fill(0)",
+              "query": "SELECT min(\"value\") FROM \"openstack_nova_instance_creation_time\" WHERE \"environment_label\" =~ /^$environment$/ AND $timeFilter GROUP BY time($interval)",
               "rawQuery": false,
               "refId": "C",
               "resultFormat": "time_series",
diff --git a/nova/files/juno/nova-controller.conf.Debian b/nova/files/juno/nova-controller.conf.Debian
index 8e8d138..0415ff6 100644
--- a/nova/files/juno/nova-controller.conf.Debian
+++ b/nova/files/juno/nova-controller.conf.Debian
@@ -70,7 +70,6 @@
 security_group_api = neutron
 
 rpc_backend = nova.rpc.impl_kombu
-start_guests_on_host_boot=truembu
 
 {%- if controller.cache is defined %}
 memcached_servers={%- for member in controller.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
@@ -114,7 +113,6 @@
 {%- endif %}
 
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_conn_pool_size = 300
diff --git a/nova/files/kilo/nova-controller.conf.Debian b/nova/files/kilo/nova-controller.conf.Debian
index e61da50..99dfe00 100644
--- a/nova/files/kilo/nova-controller.conf.Debian
+++ b/nova/files/kilo/nova-controller.conf.Debian
@@ -72,7 +72,6 @@
 security_group_api = neutron
 
 rpc_backend = nova.rpc.impl_kombu
-start_guests_on_host_boot=truembu
 
 {%- if controller.cache is defined %}
 memcached_servers={%- for member in controller.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
@@ -103,7 +102,6 @@
 {%- endif %}
 
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_conn_pool_size = 300
diff --git a/nova/files/liberty/nova-compute.conf.Debian b/nova/files/liberty/nova-compute.conf.Debian
index 4df50c7..283f9c4 100644
--- a/nova/files/liberty/nova-compute.conf.Debian
+++ b/nova/files/liberty/nova-compute.conf.Debian
@@ -92,7 +92,7 @@
 block_device_allocate_retries=600
 block_device_allocate_retries_interval=10
 
-resume_guests_state_on_host_boot = True
+resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', True) }}
 service_down_time = 90
 
 {% if pillar.ceilometer is defined %}
@@ -125,8 +125,6 @@
 notification_driver = messagingv2
 {%- endif %}
 
-resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', False) }}
-
 {%- if compute.identity.get('version', 2) == 2 %}
 
 [keystone_authtoken]
diff --git a/nova/files/liberty/nova-controller.conf.Debian b/nova/files/liberty/nova-controller.conf.Debian
index bf7d9dd..0c2f11a 100644
--- a/nova/files/liberty/nova-controller.conf.Debian
+++ b/nova/files/liberty/nova-controller.conf.Debian
@@ -73,7 +73,6 @@
 security_group_api = neutron
 
 rpc_backend = nova.rpc.impl_kombu
-start_guests_on_host_boot=true
 
 {%- if controller.cache is defined %}
 memcached_servers={%- for member in controller.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
@@ -100,12 +99,7 @@
 novncproxy_base_url={{ controller.vncproxy_url }}/vnc_auto.html
 novncproxy_port={{ controller.bind.get('vncproxy_port', '6080') }}
 
-{%- if controller.get('networking', 'default') != "contrail" %}
-neutron_metadata_proxy_shared_secret={{ controller.metadata.password }}
-{%- endif %}
-
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_conn_pool_size = 300
@@ -217,6 +211,9 @@
 {%- endif %}
 url=http://{{ controller.network.host }}:{{ controller.network.port }}
 
+{%- if controller.get('networking', 'default') != "contrail" %}
+metadata_proxy_shared_secret={{ controller.metadata.password }}
+{%- endif %}
 service_metadata_proxy=True
 
 [cinder]
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index c2f522d..ba9a0f0 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -56,7 +56,7 @@
 block_device_allocate_retries=600
 block_device_allocate_retries_interval=10
 
-resume_guests_state_on_host_boot = True
+resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', True) }}
 service_down_time = 90
 
 {% if pillar.ceilometer is defined %}
@@ -72,8 +72,6 @@
 notify_on_state_change = vm_and_task_state
 {%- endif %}
 
-resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', False) }}
-
 [oslo_concurrency]
 lock_path = /var/lib/nova/tmp
 
@@ -128,6 +126,9 @@
 libvirt_inject_password=false
 libvirt_inject_key=false
 {%- endif %}
+{%- if compute.libvirt.hw_disk_discard is defined %}
+hw_disk_discard={{ compute.libvirt.hw_disk_discard }}
+{%- endif %}
 
 {%- if compute.get('libvirt', {}).uri is defined %}
 connection_uri={{ compute.libvirt.uri }}
diff --git a/nova/files/mitaka/nova-controller.conf.Debian b/nova/files/mitaka/nova-controller.conf.Debian
index 2711cb8..4554ca1 100644
--- a/nova/files/mitaka/nova-controller.conf.Debian
+++ b/nova/files/mitaka/nova-controller.conf.Debian
@@ -22,6 +22,9 @@
 scheduler_default_filters = {{ controller.scheduler_default_filters }}
 scheduler_available_filters = nova.scheduler.filters.all_filters
 scheduler_available_filters = nova.scheduler.filters.pci_passthrough_filter.PciPassthroughFilter
+{% for filter in controller.get('scheduler_custom_filters', []) %}
+scheduler_available_filters = {{ filter }}
+{% endfor %}
 scheduler_driver = filter_scheduler
 allow_resize_to_same_host = True
 osapi_max_limit = {{ controller.osapi_max_limit|default('1000') }}
@@ -52,13 +55,7 @@
 osapi_compute_workers = {{ controller.workers }}
 metadata_workers = {{ controller.workers }}
 
-
-{%- if controller.get('networking', 'default') != "contrail" %}
-neutron_metadata_proxy_shared_secret={{ controller.metadata.password }}
-{%- endif %}
-
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_response_timeout = 3600
@@ -197,6 +194,9 @@
 {%- endif %}
 url=http://{{ controller.network.host }}:{{ controller.network.port }}
 
+{%- if controller.get('networking', 'default') != "contrail" %}
+metadata_proxy_shared_secret={{ controller.metadata.password }}
+{%- endif %}
 service_metadata_proxy=True
 
 [cinder]
diff --git a/nova/files/newton/nova-compute.conf.Debian b/nova/files/newton/nova-compute.conf.Debian
index 2c1a7a0..f49529f 100644
--- a/nova/files/newton/nova-compute.conf.Debian
+++ b/nova/files/newton/nova-compute.conf.Debian
@@ -58,7 +58,7 @@
 block_device_allocate_retries=600
 block_device_allocate_retries_interval=10
 
-resume_guests_state_on_host_boot = True
+resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', True) }}
 service_down_time = 90
 
 {%- if compute.message_queue.members is defined %}
@@ -86,8 +86,6 @@
 notify_on_state_change = vm_and_task_state
 {%- endif %}
 
-resume_guests_state_on_host_boot = {{ compute.get('resume_guests_state_on_host_boot', False) }}
-
 [oslo_concurrency]
 lock_path = /var/lib/nova/tmp
 
@@ -142,6 +140,9 @@
 libvirt_inject_password=false
 libvirt_inject_key=false
 {%- endif %}
+{%- if compute.libvirt.hw_disk_discard is defined %}
+hw_disk_discard={{ compute.libvirt.hw_disk_discard }}
+{%- endif %}
 
 {%- if compute.get('libvirt', {}).uri is defined %}
 connection_uri={{ compute.libvirt.uri }}
diff --git a/nova/files/newton/nova-controller.conf.Debian b/nova/files/newton/nova-controller.conf.Debian
index 7f87aa4..159485f 100644
--- a/nova/files/newton/nova-controller.conf.Debian
+++ b/nova/files/newton/nova-controller.conf.Debian
@@ -22,6 +22,9 @@
 scheduler_default_filters = {{ controller.scheduler_default_filters }}
 scheduler_available_filters = nova.scheduler.filters.all_filters
 scheduler_available_filters = nova.scheduler.filters.pci_passthrough_filter.PciPassthroughFilter
+{% for filter in controller.get('scheduler_custom_filters', []) %}
+scheduler_available_filters = {{ filter }}
+{% endfor %}
 scheduler_driver = filter_scheduler
 scheduler_use_baremetal_filters = False
 allow_resize_to_same_host = True
@@ -62,8 +65,6 @@
 
 
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
-resume_guests_state_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_response_timeout = 3600
diff --git a/nova/files/newton/nova-controller.conf.RedHat b/nova/files/newton/nova-controller.conf.RedHat
index 7f87aa4..c8382d7 100644
--- a/nova/files/newton/nova-controller.conf.RedHat
+++ b/nova/files/newton/nova-controller.conf.RedHat
@@ -62,8 +62,6 @@
 
 
 allow_resize_to_same_host=True
-start_guests_on_host_boot=true
-resume_guests_state_on_host_boot=true
 
 rpc_cast_timeout = 30
 rpc_response_timeout = 3600
diff --git a/nova/files/ocata/nova-compute.conf.Debian b/nova/files/ocata/nova-compute.conf.Debian
index 55d89a2..cc00305 100644
--- a/nova/files/ocata/nova-compute.conf.Debian
+++ b/nova/files/ocata/nova-compute.conf.Debian
@@ -669,7 +669,7 @@
 # resume their state each time the compute node boots or restarts.
 #  (boolean value)
 #resume_guests_state_on_host_boot=false
-resume_guests_state_on_host_boot=true
+resume_guests_state_on_host_boot={{ compute.get('resume_guests_state_on_host_boot', True) }}
 
 #
 # Number of times to retry network allocation. It is required to attempt network
@@ -6482,6 +6482,9 @@
 #  (string value)
 # Allowed values: ignore, unmap
 #hw_disk_discard=<None>
+{%- if compute.libvirt.hw_disk_discard is defined %}
+hw_disk_discard={{ compute.libvirt.hw_disk_discard }}
+{%- endif %}
 
 # DEPRECATED: Allows image information files to be stored in non-standard
 # locations (string value)
@@ -8234,6 +8237,7 @@
 username = {{ compute.identity.user }}
 password = {{ compute.identity.password }}
 auth_url=http://{{ compute.identity.host }}:35357/v3
+interface = internal
 
 #
 # Region name of this node. This is used when picking the URL in the service
diff --git a/nova/files/ocata/nova-controller.conf.Debian b/nova/files/ocata/nova-controller.conf.Debian
index ef773b1..eb23112 100644
--- a/nova/files/ocata/nova-controller.conf.Debian
+++ b/nova/files/ocata/nova-controller.conf.Debian
@@ -652,14 +652,6 @@
 #live_migration_retry_count=30
 
 #
-# This option specifies whether to start guests that were running before the
-# host rebooted. It ensures that all of the instances on a Nova compute node
-# resume their state each time the compute node boots or restarts.
-#  (boolean value)
-#resume_guests_state_on_host_boot=false
-resume_guests_state_on_host_boot=true
-
-#
 # Number of times to retry network allocation. It is required to attempt network
 # allocation retries if the virtual interface plug fails.
 #
@@ -4702,6 +4694,9 @@
 #available_filters=nova.scheduler.filters.all_filters
 available_filters=nova.scheduler.filters.all_filters
 available_filters=nova.scheduler.filters.pci_passthrough_filter.PciPassthroughFilter
+{% for filter in controller.get('scheduler_custom_filters', []) %}
+scheduler_available_filters = {{ filter }}
+{% endfor %}
 
 #
 # Filters that the scheduler will use.
@@ -8249,6 +8244,7 @@
 username = {{ controller.identity.user }}
 password = {{ controller.identity.password }}
 auth_url=http://{{ controller.identity.host }}:35357/v3
+interface = internal
 
 #
 # Endpoint interface for this node. This is used when picking the URL in the
diff --git a/nova/map.jinja b/nova/map.jinja
index 10577d5..81df0a8 100644
--- a/nova/map.jinja
+++ b/nova/map.jinja
@@ -45,8 +45,10 @@
         'libvirt_service': 'libvirt-bin',
         'bind': compute_bind_defaults,
         'debug': false,
+        'libvirt': [],
         'notification': false,
         'availability_zone': None,
+        'aggregates': [],
         'identity': {
             'region': 'RegionOne'
         },
@@ -63,6 +65,7 @@
         'libvirt_service': 'libvirtd',
         'bind': compute_bind_defaults,
         'debug': false,
+        'libvirt': [],
         'notification': false,
         'availability_zone': None,
         'identity': {
diff --git a/tests/pillar/compute_cluster.sls b/tests/pillar/compute_cluster.sls
index bd61ecc..c3a2485 100644
--- a/tests/pillar/compute_cluster.sls
+++ b/tests/pillar/compute_cluster.sls
@@ -64,3 +64,5 @@
         port: 11211
       - host: 127.0.2.1
         port: 11211
+    libvirt:
+      hw_disk_discard: unmap