diff --git a/reclass_tools/cli.py b/reclass_tools/cli.py
index 8b4ebe7..48e3d9f 100644
--- a/reclass_tools/cli.py
+++ b/reclass_tools/cli.py
@@ -91,6 +91,7 @@
         verbose=params.verbose,
         pretend=pretend)
 
+
 def inventory_list(args=None):
     try:
         from reclass_tools import reclass_models
@@ -106,4 +107,25 @@
 
     params = parser.parse_args(args)
 
-    reclass_models.inventory_list(domain=params.domain)
+    inventory = reclass_models.inventory_list(domain=params.domain)
+
+    print('\n'.join(sorted(inventory.keys())))
+
+def vcp_list(args=None):
+    try:
+        from reclass_tools import reclass_models
+    except ImportError:
+        print("Please run this tool on the salt-master node with installed 'reclass'")
+        return
+
+    parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
+                                     description="")
+    parser.add_argument('--domain', '-d', dest='domain',
+                        help=('Show only the nodes which names are ended with the specified domain, for example:'
+                              ' reclass-inventory-list -d example.local'))
+
+    params = parser.parse_args(args)
+
+    vcp_node_names = reclass_models.vcp_list(domain=params.domain)
+    print('\n'.join(sorted(vcp_node_names)))
+
diff --git a/reclass_tools/helpers.py b/reclass_tools/helpers.py
new file mode 100644
index 0000000..fcfc564
--- /dev/null
+++ b/reclass_tools/helpers.py
@@ -0,0 +1,32 @@
+
+def get_nested_key(data, path=None):
+    if type(path) is not list:
+        raise("Use 'list' object with key names for 'path'")
+    for key in path:
+        value = data.get(key, None)
+        if value:
+            data = value
+        else:
+            return None
+    return data
+
+
+def remove_nested_key(data, path=None):
+    if type(path) is not list:
+        raise("Use 'list' object with key names for 'path'")
+
+    # Remove the value from the specified key
+    val = get_nested_key(data, path[:-1])
+    val[path[-1]] = None
+
+    # Clear parent keys if empty
+    while path:
+        val = get_nested_key(data, path)
+        if val:
+            # Non-empty value, nothing to do
+            return
+        else:
+            get_nested_key(data, path[:-1]).pop(path[-1])
+            path = path[:-1]
+
+
diff --git a/reclass_tools/reclass_models.py b/reclass_tools/reclass_models.py
index 20874d6..9f90fa7 100644
--- a/reclass_tools/reclass_models.py
+++ b/reclass_tools/reclass_models.py
@@ -2,6 +2,8 @@
 from reclass.adapters import salt as reclass_salt
 from reclass import config as reclass_config
 from reclass import core as reclass_core
+
+from reclass_tools import helpers
 #import salt.cli.call
 #import salt.cli.caller
 
@@ -35,9 +37,28 @@
 
 def inventory_list(domain=None):
     core = get_core()
-    inventory = core.inventory()
-    nodes_list = inventory['nodes'].keys()
+    inventory = core.inventory()['nodes']
     if domain is not None:
-        #domain = get_minion_domain()
-        nodes_list = [node for node in nodes_list if node.endswith(domain)]
-    print('\n'.join(sorted(nodes_list)))
+        inventory = {key:val for (key, val) in inventory.items() if key.endswith(domain)}
+    return inventory
+
+
+def vcp_list(domain=None):
+    """List VCP node names
+
+    Scan all nodes for the object salt.control.cluster.internal.node.XXX.name
+    """
+
+    inventory = inventory_list(domain=domain)
+    vcp_path = 'parameters.salt.control.cluster.internal.node'.split('.')
+
+    vcp_node_names = set()
+
+    for node_name, node in inventory.items():
+        vcp_nodes = helpers.get_nested_key(node, path=vcp_path)
+        if vcp_nodes is not None:
+            for vcp_node_name, vcp_node in vcp_nodes.items():
+                vcp_node_names.add(vcp_node['name'])
+    return vcp_node_names
+
+
diff --git a/reclass_tools/walk_models.py b/reclass_tools/walk_models.py
index a07e51b..d57aef5 100644
--- a/reclass_tools/walk_models.py
+++ b/reclass_tools/walk_models.py
@@ -8,6 +8,8 @@
 import urllib2
 import yaml
 
+from reclass_tools import helpers
+
 
 def walkfiles(topdir, verbose=False):
     walker = os.walk(topdir)
@@ -102,37 +104,6 @@
             self.fobj.close()
 
 
-def get_nested_key(data, path=None):
-    if type(path) is not list:
-        raise("Use 'list' object with key names for 'path'")
-    for key in path:
-        value = data.get(key, None)
-        if value:
-            data = value
-        else:
-            return None
-    return data
-
-
-def remove_nested_key(data, path=None):
-    if type(path) is not list:
-        raise("Use 'list' object with key names for 'path'")
-
-    # Remove the value from the specified key
-    val = get_nested_key(data, path[:-1])
-    val[path[-1]] = None
-
-    # Clear parent keys if empty
-    while path:
-        val = get_nested_key(data, path)
-        if val:
-            # Non-empty value, nothing to do
-            return
-        else:
-            get_nested_key(data, path[:-1]).pop(path[-1])
-            path = path[:-1]
-
-
 def get_all_reclass_params(paths, verbose=False):
     """Return dict with all used values for each param"""
     _params = dict()
@@ -142,7 +113,7 @@
                 model = yaml_read(log.fname)
                 if model is not None:
                     # Collect all params from the models
-                    _param = get_nested_key(model, ['parameters', '_param'])
+                    _param = helpers.get_nested_key(model, ['parameters', '_param'])
                     if _param:
                         for key, val in _param.items():
                             if key in _params:
@@ -173,7 +144,7 @@
                 if model is not None:
 
                     # Clear linux.network.interfaces
-                    nested_key = get_nested_key(model, remove_key)
+                    nested_key = helpers.get_nested_key(model, remove_key)
                     if nested_key:
                         found_keys[fyml.fname] = copy.deepcopy(nested_key)
                         if pretend:
@@ -185,7 +156,7 @@
                                                                    fyml.fname))
                             print(yaml.dump(nested_key, default_flow_style=False))
 
-                            remove_nested_key(model, remove_key)
+                            helpers.remove_nested_key(model, remove_key)
 
                             with open(fyml.fname, 'w') as f:
                                 f.write(
diff --git a/setup.cfg b/setup.cfg
index 6fad0ba..10aad7b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -30,3 +30,4 @@
     reclass-remove-key = reclass_tools.cli:remove_key
     reclass-show-key = reclass_tools.cli:show_key
     reclass-inventory-list = reclass_tools.cli:inventory_list
+    reclass-vcp-list = reclass_tools.cli:vcp_list
