diff --git a/_modules/aodhv2/__init__.py b/_modules/aodhv2/__init__.py
new file mode 100644
index 0000000..7eb1f85
--- /dev/null
+++ b/_modules/aodhv2/__init__.py
@@ -0,0 +1,32 @@
+try:
+    import os_client_config  # noqa
+    from keystoneauth1 import exceptions as ka_exceptions  # noqa
+    REQUIREMENTS_MET = True
+except ImportError:
+    REQUIREMENTS_MET = False
+
+from aodhv2 import lists
+from aodhv2 import alarms
+
+alarm_list = lists.alarm_list
+alarm_create = alarms.alarm_create
+alarm_get_details = alarms.alarm_get_details
+alarm_update = alarms.alarm_update
+alarm_delete = alarms.alarm_delete
+alarm_history_get = alarms.alarm_history_get
+alarm_state_set = alarms.alarm_state_set
+alarm_state_get = alarms.alarm_state_get
+
+
+__all__ = ('alarm_list', 'alarm_create', 'alarm_delete', 'alarm_get_details',
+           'alarm_history_get', 'alarm_state_get', 'alarm_state_set',
+           'alarm_update')
+
+
+def __virtual__():
+    """Only load aodhv2 if requirements are available."""
+    if REQUIREMENTS_MET:
+        return 'aodhv2'
+    else:
+        return False, ("The aodhv2 execution module cannot be loaded: "
+                       "os_client_config or keystoneauth are unavailable.")
diff --git a/_modules/aodhv2/alarms.py b/_modules/aodhv2/alarms.py
new file mode 100644
index 0000000..9d8a6dc
--- /dev/null
+++ b/_modules/aodhv2/alarms.py
@@ -0,0 +1,50 @@
+from aodhv2.common import send
+from aodhv2.arg_converter import get_by_name_or_uuid_multiple
+
+
+@send('post')
+def alarm_create(**kwargs):
+    url = '/alarms'
+    return url, kwargs
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('get')
+def alarm_get_details(alarm_id, **kwargs):
+    url = '/alarms/{}'.format(alarm_id)
+    return url, None
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('put')
+def alarm_update(alarm_id, **kwargs):
+    url = '/alarms/{}'.format(alarm_id)
+    return url, kwargs
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('delete')
+def alarm_delete(alarm_id, **kwargs):
+    url = '/alarms/{}'.format(alarm_id)
+    return url, None
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('get')
+def alarm_history_get(alarm_id, **kwargs):
+    url = '/alarms/{}/history'.format(alarm_id)
+    return url, None
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('put')
+def alarm_state_set(alarm_id, state, **kwargs):
+    url = '/alarms/{}/state'.format(alarm_id)
+    return url, {'state': state}
+
+
+@get_by_name_or_uuid_multiple([('alarm', 'alarm_id')])
+@send('get')
+def alarm_state_get(alarm_id, **kwargs):
+    url = '/alarms/{}/state'.format(alarm_id)
+    return url, None
diff --git a/_modules/aodhv2/arg_converter.py b/_modules/aodhv2/arg_converter.py
new file mode 100644
index 0000000..ee6937b
--- /dev/null
+++ b/_modules/aodhv2/arg_converter.py
@@ -0,0 +1,47 @@
+import uuid
+from aodhv2 import common
+from aodhv2 import queries
+
+
+class CheckId(object):
+    def check_id(self, val):
+        try:
+            return str(uuid.UUID(val)).replace('-', '') == val
+        except (TypeError, ValueError, AttributeError):
+            return False
+
+
+resource_lists = {
+    'alarm': queries.query_post,
+}
+
+
+def get_by_name_or_uuid_multiple(resource_arg_name_pairs):
+    def wrap(func):
+        def wrapped_f(*args, **kwargs):
+            results = []
+            args_start = 0
+            for index, (resource, arg_name) in enumerate(
+                    resource_arg_name_pairs):
+                if arg_name in kwargs:
+                    ref = kwargs.pop(arg_name, None)
+                else:
+                    ref = args[index]
+                    args_start += 1
+                cloud_name = kwargs['cloud_name']
+                checker = CheckId()
+                if checker.check_id(ref):
+                    results.append(ref)
+                else:
+                    # Then we have name not uuid
+                    resp = resource_lists[resource](
+                        name=ref, cloud_name=cloud_name)
+                    if len(resp) == 0:
+                        raise common.ResourceNotFound(resource, ref)
+                    elif len(resp) > 1:
+                        raise common.MultipleResourcesFound(resource, ref)
+                    results.append(resp[0]['alarm_id'])
+                results.extend(args[args_start:])
+            return func(*results, **kwargs)
+        return wrapped_f
+    return wrap
diff --git a/_modules/aodhv2/common.py b/_modules/aodhv2/common.py
new file mode 100644
index 0000000..e507457
--- /dev/null
+++ b/_modules/aodhv2/common.py
@@ -0,0 +1,103 @@
+import logging
+import os_client_config
+
+log = logging.getLogger(__name__)
+
+
+class AodhException(Exception):
+
+    _msg = "Aodh module exception occured."
+
+    def __init__(self, message=None, **kwargs):
+        super(AodhException, self).__init__(message or self._msg)
+
+
+class NoAodhEndpoint(AodhException):
+    _msg = "Aodh endpoint not found in keystone catalog."
+
+
+class NoAuthPluginConfigured(AodhException):
+    _msg = ("You are using keystoneauth auth plugin that does not support "
+            "fetching endpoint list from token (noauth or admin_token).")
+
+
+class NoCredentials(AodhException):
+    _msg = "Please provide cloud name present in clouds.yaml."
+
+
+class ResourceNotFound(AodhException):
+    _msg = "Uniq resource: {resource} with name: {name} not found."
+
+    def __init__(self, resource, name, **kwargs):
+        super(AodhException, self).__init__(
+            self._msg.format(resource=resource, name=name))
+
+
+class MultipleResourcesFound(AodhException):
+    _msg = "Multiple resource: {resource} with name: {name} found."
+
+    def __init__(self, resource, name, **kwargs):
+        super(AodhException, self).__init__(
+            self._msg.format(resource=resource, name=name))
+
+
+def _get_raw_client(cloud_name):
+    service_type = 'alarming'
+    config = os_client_config.OpenStackConfig()
+    cloud = config.get_one_cloud(cloud_name)
+    api_version = 'v2'
+    try:
+        # NOTE(pas-ha) for Queens and later,
+        # 'version' kwarg in absent for Pike and older
+        adapter = cloud.get_session_client(service_type, version=api_version)
+    except TypeError:
+        adapter = cloud.get_session_client(service_type)
+        adapter.version = api_version
+    try:
+        access_info = adapter.session.auth.get_access(adapter.session)
+        endpoints = access_info.service_catalog.get_endpoints()
+    except (AttributeError, ValueError):
+        e = NoAuthPluginConfigured()
+        log.exception('%s' % e)
+        raise e
+    if service_type not in endpoints:
+        if not service_type:
+            e = NoAodhEndpoint()
+            log.error('%s' % e)
+            raise e
+    return adapter
+
+
+def send(method, microversion_header=None):
+    def wrap(func):
+        def wrapped_f(*args, **kwargs):
+            headers = kwargs.pop('headers', {})
+            if kwargs.get('microversion'):
+                headers.setdefault(microversion_header,
+                                   kwargs.get('microversion'))
+            cloud_name = kwargs.pop('cloud_name')
+            if not cloud_name:
+                e = NoCredentials()
+                log.error('%s' % e)
+                raise e
+            adapter = _get_raw_client(cloud_name)
+            # Remove salt internal kwargs
+            kwarg_keys = list(kwargs.keys())
+            for k in kwarg_keys:
+                if k.startswith('__'):
+                    kwargs.pop(k)
+            url, json = func(*args, **kwargs)
+            if json:
+                response = getattr(adapter, method)(url, headers=headers,
+                                                    json=json)
+            else:
+                response = getattr(adapter, method)(url, headers=headers)
+            if not response.content:
+                return {}
+            try:
+                resp = response.json()
+            except:
+                resp = response.content
+            return resp
+        return wrapped_f
+    return wrap
\ No newline at end of file
diff --git a/_modules/aodhv2/lists.py b/_modules/aodhv2/lists.py
new file mode 100644
index 0000000..708d4c1
--- /dev/null
+++ b/_modules/aodhv2/lists.py
@@ -0,0 +1,12 @@
+from aodhv2.common import send
+
+try:
+    from urllib.parse import urlencode
+except ImportError:
+    from urllib import urlencode
+
+
+@send('get')
+def alarm_list(**kwargs):
+    url = '/alarms'
+    return url, None
\ No newline at end of file
diff --git a/_modules/aodhv2/queries.py b/_modules/aodhv2/queries.py
new file mode 100644
index 0000000..df7b5b6
--- /dev/null
+++ b/_modules/aodhv2/queries.py
@@ -0,0 +1,11 @@
+from aodhv2.common import send
+
+
+# NOTE(opetrenko): currently we support only by name filtration
+@send('post')
+def query_post(name, **kwargs):
+    url = '/query/alarms'
+    json = {
+        'filter': "{\"=\":{\"name\": \"%s\"}}" % name
+    }
+    return url, json
diff --git a/_states/aodhv2.py b/_states/aodhv2.py
new file mode 100644
index 0000000..5dff5c2
--- /dev/null
+++ b/_states/aodhv2.py
@@ -0,0 +1,115 @@
+import logging
+
+
+def __virtual__():
+    return 'aodhv2' if 'aodhv2.alarm_list' in __salt__ else False  # noqa
+
+
+log = logging.getLogger(__name__)
+
+
+def _aodhv2_call(fname, *args, **kwargs):
+    return __salt__['aodhv2.{}'.format(fname)](*args, **kwargs)  # noqa
+
+
+def _resource_present(resource, name, cloud_name, **kwargs):
+    try:
+        method_name = '{}_get_details'.format(resource)
+        exact_resource = _aodhv2_call(
+            method_name, name, cloud_name=cloud_name
+        )[resource]
+    except Exception as e:
+        if 'ResourceNotFound' in repr(e):
+            try:
+                method_name = '{}_create'.format(resource)
+                resp = _aodhv2_call(
+                    method_name, name=name, cloud_name=cloud_name, **kwargs
+                )
+            except Exception as e:
+                log.exception('Aodh {0} create failed with {1}'.
+                    format(resource, e))
+                return _failed('create', name, resource)
+            return _succeeded('create', name, resource, resp)
+        elif 'MultipleResourcesFound' in repr(e):
+            return _failed('find', name, resource)
+        else:
+            raise
+
+    to_update = {}
+    for key in kwargs:
+        if key not in exact_resource or kwargs[key] != exact_resource[key]:
+            to_update[key] = kwargs[key]
+    try:
+        method_name = '{}_update'.format(resource)
+        resp = _aodhv2_call(
+            method_name, name, cloud_name=cloud_name, **to_update
+        )
+    except Exception as e:
+        log.exception('Aodh {0} update failed with {1}'.format(resource, e))
+        return _failed('update', name, resource)
+    return _succeeded('update', name, resource, resp)
+
+
+def _resource_absent(resource, name, cloud_name):
+    try:
+        method_name = '{}_get_details'.format(resource)
+        _aodhv2_call(
+            method_name, name, cloud_name=cloud_name
+        )[resource]
+    except Exception as e:
+        if 'ResourceNotFound' in repr(e):
+            return _succeeded('absent', name, resource)
+        if 'MultipleResourcesFound' in repr(e):
+            return _failed('find', name, resource)
+    try:
+        method_name = '{}_delete'.format(resource)
+        _aodhv2_call(
+            method_name, name, cloud_name=cloud_name
+        )
+    except Exception as e:
+        log.error('Aodh delete {0} failed with {1}'.format(resource, e))
+        return _failed('delete', name, resource)
+    return _succeeded('delete', name, resource)
+
+
+def alarm_present(name, cloud_name, **kwargs):
+    return _resource_present('alarm', name, cloud_name, **kwargs)
+
+
+def alarm_absent(name, cloud_name):
+    return _resource_absent('alarm', name, cloud_name)
+
+
+def _succeeded(op, name, resource, changes=None):
+    msg_map = {
+        'create': '{0} {1} created',
+        'delete': '{0} {1} removed',
+        'update': '{0} {1} updated',
+        'no_changes': '{0} {1} is in desired state',
+        'absent': '{0} {1} not present',
+        'resources_moved': '{1} resources were moved from {0}',
+    }
+    changes_dict = {
+        'name': name,
+        'result': True,
+        'comment': msg_map[op].format(resource, name),
+        'changes': changes or {},
+    }
+    return changes_dict
+
+
+def _failed(op, name, resource):
+    msg_map = {
+        'create': '{0} {1} failed to create',
+        'delete': '{0} {1} failed to delete',
+        'update': '{0} {1} failed to update',
+        'find': '{0} {1} found multiple {0}',
+        'resources_moved': 'failed to move {1} from {0}',
+    }
+    changes_dict = {
+        'name': name,
+        'result': False,
+        'comment': msg_map[op].format(resource, name),
+        'changes': {},
+    }
+    return changes_dict
diff --git a/aodh/files/queens/aodh.conf.Debian b/aodh/files/queens/aodh.conf.Debian
index 54f23bc..88c50fc 100644
--- a/aodh/files/queens/aodh.conf.Debian
+++ b/aodh/files/queens/aodh.conf.Debian
@@ -257,5 +257,8 @@
 [keystone_authtoken]
 {%- set _data = server.identity %}
 {%- set auth_type = _data.get('auth_type', 'password') %}
+{%- if server.get('cache',{}).members is defined and 'cache' not in _data.keys() %}
+{% do _data.update({'cache': server.cache}) %}
+{%- endif %}
 {%- include "oslo_templates/files/queens/keystonemiddleware/_auth_token.conf" %}
 {%- include "oslo_templates/files/queens/keystoneauth/_type_" + auth_type + ".conf" %}
diff --git a/aodh/upgrade/verify/_api.sls b/aodh/upgrade/verify/_api.sls
index e34edf5..d2467a7 100644
--- a/aodh/upgrade/verify/_api.sls
+++ b/aodh/upgrade/verify/_api.sls
@@ -1,7 +1,34 @@
+{%- from "aodh/map.jinja" import server with context %}
 
 aodh_upgrade_verify_api:
   test.show_notification:
     - text: "Running aodh.upgrade.verify.api"
 
-# TODO: Implement api checks when aodh salt
-# modules are implemented
+{%- if server.get('role', 'primary') == 'primary' %}
+{% set Alarm_Name = 'testupgrade_alarm_name' %}
+{% set Random_Uuid = salt['cmd.run']('cat /proc/sys/kernel/random/uuid') %}
+
+aodhv2_alarm_present:
+  aodhv2.alarm_present:
+  - cloud_name: admin_identity
+  - name: {{ Alarm_Name }}
+  - type: gnocchi_resources_threshold
+  - gnocchi_resources_threshold_rule:
+      metric: cpu_util
+      aggregation_method: mean
+      threshold: '70.0'
+      resource_id: {{ Random_Uuid }}
+      resource_type: instance
+
+aodhv2_alarm_list:
+  module.run:
+    - name: aodhv2.alarm_list
+    - kwargs:
+        cloud_name: admin_identity
+
+aodhv2_alarm_absent:
+  aodhv2.alarm_absent:
+  - cloud_name: admin_identity
+  - name: {{ Alarm_Name }}
+
+{%- endif %}
