diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index 5049693..b504922 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -1,7 +1,7 @@
 package com.mirantis.mcp
 
 /**
- *
+ * DEPRECATED
  * Tests providing functions
  *
  */
@@ -17,6 +17,8 @@
 def runBasicContainer(master, target, dockerImageLink="xrally/xrally-openstack:0.10.1"){
     def salt = new com.mirantis.mk.Salt()
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Please migrate to validate.runContainer. This method will be removed')
+    error('You are using deprecated method! Please migrate to validate.runContainer. This method will be removed')
     def _pillar = salt.getPillar(master, 'I@keystone:server', 'keystone:server')
     def keystone = _pillar['return'][0].values()[0]
     if ( salt.cmdRun(master, target, "docker ps -f name=cvp -q", false, null, false)['return'][0].values()[0] ) {
@@ -160,6 +162,7 @@
 }
 
 /**
+ * DEPRECATED
  * Get reclass value
  *
  * @param target            The host for which the values will be provided
@@ -168,6 +171,8 @@
  */
 def getReclassValue(master, target, filter) {
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def salt = new com.mirantis.mk.Salt()
     def items = filter.tokenize('.')
     def _result = salt.cmdRun(master, 'I@salt:master', "reclass-salt -o json -p ${target}", false, null, false)
@@ -181,6 +186,7 @@
 }
 
 /**
+ * DEPRECATED
  * Create list of nodes in JSON format.
  *
  * @param filter            The Salt's matcher
@@ -189,6 +195,8 @@
 def getNodeList(master, filter = null) {
     def salt = new com.mirantis.mk.Salt()
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def nodes = []
     def filtered_list = null
     def controllers = salt.getMinions(master, 'I@nova:controller')
@@ -220,6 +228,7 @@
 }
 
 /**
+ * DEPRECATED
  * Execute mcp sanity tests
  * Deprecated. Will be removed soon
  *
@@ -231,6 +240,8 @@
  */
 def runSanityTests(salt_url, salt_credentials, test_set="", output_dir="validation_artifacts/", env_vars="") {
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
+    error('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
     def creds = common.getCredentials(salt_credentials)
     def username = creds.username
     def password = creds.password
@@ -248,6 +259,7 @@
 }
 
 /**
+ * DEPRECATED
  * Execute pytest framework tests
  *
  * @param salt_url          Salt master url
@@ -259,6 +271,8 @@
 def runPyTests(salt_url, salt_credentials, test_set="", env_vars="", name='cvp', container_node="", remote_dir='/root/qa_results/', artifacts_dir='validation_artifacts/') {
     def xml_file = "${name}_report.xml"
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
+    error('You are using deprecated method! Please migrate to validate.runTests. This method will be removed')
     def salt = new com.mirantis.mk.Salt()
     def creds = common.getCredentials(salt_credentials)
     def username = creds.username
@@ -316,6 +330,7 @@
 }
 
 /**
+ * DEPRECATED
  * Execute tempest tests
  *
  * @param target            Host to run tests
@@ -330,6 +345,9 @@
  */
 def runTempestTests(master, target, dockerImageLink, output_dir, confRepository, confBranch, repository, version, pattern = "false", results = '/root/qa_results') {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def output_file = 'docker-tempest.log'
     def dest_folder = '/home/rally/qa_results'
     def skip_list = '--skip-list /opt/devops-qa-tools/deployment/skip_contrail.list'
@@ -562,6 +580,7 @@
 }
 
 /**
+ * DEPRECATED
  * Generate test report
  *
  * @param target            Host to run script from
@@ -573,6 +592,8 @@
     def report_file = 'jenkins_test_report.html'
     def salt = new com.mirantis.mk.Salt()
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def dest_folder = '/opt/devops-qa-tools/generate_test_report/test_results'
     salt.runSaltProcessStep(master, target, 'file.remove', ["${results}"])
     salt.runSaltProcessStep(master, target, 'file.mkdir', ["${results}", "mode=777"])
@@ -608,6 +629,7 @@
 }
 
 /**
+ * DEPRECATED
  * Execute SPT tests
  *
  * @param target            Host to run tests
@@ -618,6 +640,9 @@
  */
 def runSptTests(master, target, dockerImageLink, output_dir, ext_variables = [], results = '/root/qa_results') {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def dest_folder = '/home/rally/qa_results'
     salt.runSaltProcessStep(master, target, 'file.remove', ["${results}"])
     salt.runSaltProcessStep(master, target, 'file.mkdir', ["${results}", "mode=777"])
diff --git a/src/com/mirantis/mk/Test.groovy b/src/com/mirantis/mk/Test.groovy
index d9de536..d67ac1d 100644
--- a/src/com/mirantis/mk/Test.groovy
+++ b/src/com/mirantis/mk/Test.groovy
@@ -316,6 +316,7 @@
 }
 
 /**
+ * DEPRECATED
  * Execute tempest tests
  *
  * @param dockerImageLink   Docker image link with rally and tempest
@@ -335,6 +336,9 @@
                     skipList="mcp_skip.list", localKeystone="/root/keystonercv3" , localLogDir="/root/rally_reports",
                     doCleanupResources = "false") {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     salt.runSaltProcessStep(master, target, 'file.mkdir', ["${localLogDir}"])
     def custom = ''
     if (pattern) {
@@ -357,6 +361,7 @@
 
 
 /**
+ * DEPRECATED
  * Execute Rally scenarios
  *
  * @param dockerImageLink      Docker image link with rally and tempest
@@ -368,6 +373,9 @@
 def runRallyScenarios(master, dockerImageLink, target, scenario, logDir = "/home/rally/rally_reports/",
                       doCleanupResources = "false", containerName = "rally_ci") {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     salt.runSaltProcessStep(master, target, 'file.mkdir', ["/root/rally_reports"])
     salt.cmdRun(master, target, "docker run --net=host -dit " +
                                 "--name ${containerName} " +
@@ -382,11 +390,15 @@
 
 
 /**
+ * DEPRECATED
  * Upload results to cfg01 node
  *
  */
 def copyTempestResults(master, target) {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Use validate.addFiles instead. This method will be removed')
+    error('You are using deprecated method! Use validate.addFiles instead. This method will be removed')
     if (! target.contains('cfg')) {
         salt.cmdRun(master, target, "mkdir -p /root/rally_reports/ && rsync -av /root/rally_reports/ cfg01:/root/rally_reports/")
     }
@@ -417,6 +429,7 @@
 
 /** Upload Tempest test results to Testrail
  *
+ * DEPRECATED
  * @param report              Source report to upload
  * @param image               Testrail reporter image
  * @param testGroup           Testrail test group
@@ -432,6 +445,8 @@
 def uploadResultsTestrail(report, image, testGroup, credentialsId, plan, milestone, suite, master = null, target = 'cfg01*') {
     def salt = new com.mirantis.mk.Salt()
     def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Try Common.uploadResultsTestRail instead. This method will be removed')
+    error('You are using deprecated method! Try Common.uploadResultsTestRail instead. This method will be removed')
     creds = common.getPasswordCredentials(credentialsId)
     command =  "docker run --rm --net=host " +
                            "-v ${report}:/srv/report.xml " +
@@ -451,6 +466,7 @@
 
 /** Archive Rally results in Artifacts
  *
+ * DEPRECATED
  * @param master              Salt connection.
  * @param target              Target node to install docker pkg
  * @param reports_dir         Source directory to archive
@@ -458,7 +474,9 @@
 
 def archiveRallyArtifacts(master, target, reports_dir='/root/rally_reports') {
     def salt = new com.mirantis.mk.Salt()
-
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     def artifacts_dir = '_artifacts/'
     def output_file = 'rally_reports.tar'
 
@@ -495,12 +513,16 @@
 
 /** Cleanup: Remove reports directory
  *
+ * DEPRECATED
  * @param target                   Target node to remove repo
  * @param reports_dir_name         Reports directory name to be removed (that is in /root/ on target node)
  * @param archive_artifacts_name   Archive of the artifacts
  */
 def removeReports(master, target, reports_dir_name = 'rally_reports', archive_artifacts_name = 'rally_reports.tar') {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! This method will be removed')
+    error('You are using deprecated method! This method will be removed')
     salt.runSaltProcessStep(master, target, 'file.find', ["/root/${reports_dir_name}", '\\*', 'delete'])
     salt.runSaltProcessStep(master, target, 'file.remove', ["/root/${archive_artifacts_name}"])
 }
@@ -508,10 +530,14 @@
 
 /** Cleanup: Remove Docker container
  *
+ * DEPREACTED
  * @param target              Target node to remove Docker container
  * @param image_link          The link of the Docker image that was used for the container
  */
 def removeDockerContainer(master, target, containerName) {
     def salt = new com.mirantis.mk.Salt()
+    def common = new com.mirantis.mk.Common()
+    common.errorMsg('You are using deprecated method! Use validate.runCleanup instead. This method will be removed')
+    error('You are using deprecated method! Use validate.runCleanup instead. This method will be removed')
     salt.cmdRun(master, target, "docker rm -f ${containerName}")
 }
