You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/02/22 04:34:25 UTC

[1/2] AMBARI-4530. Cluster install errors out strangely without starting services. (jaimin)

Repository: ambari
Updated Branches:
  refs/heads/trunk 793cad52d -> d79be1109


http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/test/installer/step9_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/installer/step9_test.js b/ambari-web/test/installer/step9_test.js
index 48ccd6d..ae8deac 100644
--- a/ambari-web/test/installer/step9_test.js
+++ b/ambari-web/test/installer/step9_test.js
@@ -27,88 +27,106 @@ describe('App.InstallerStep9Controller', function () {
 
   describe('#isSubmitDisabled', function () {
     var tests = [
-      {controllerName: 'addHostController',state: 'STARTED',e: false},
-      {controllerName: 'addHostController',state: 'START FAILED',e: false},
-      {controllerName: 'addHostController',state: 'INSTALL FAILED',e: false},
-      {controllerName: 'addHostController',state: 'PENDING',e: true},
-      {controllerName: 'addHostController',state: 'INSTALLED',e: true},
-      {controllerName: 'addServiceController',state: 'STARTED',e: false},
-      {controllerName: 'addServiceController',state: 'START FAILED',e: false},
-      {controllerName: 'addServiceController',state: 'INSTALL FAILED',e: false},
-      {controllerName: 'addServiceController',state: 'PENDING',e: true},
-      {controllerName: 'addServiceController',state: 'INSTALLED',e: true},
-      {controllerName: 'installerController',state: 'STARTED',e: false},
-      {controllerName: 'installerController',state: 'START FAILED',e: false},
-      {controllerName: 'installerController',state: 'INSTALL FAILED',e: true},
-      {controllerName: 'installerController',state: 'INSTALLED',e: true},
-      {controllerName: 'installerController',state: 'PENDING',e: true}
+      {controllerName: 'addHostController', state: 'STARTED', e: false},
+      {controllerName: 'addHostController', state: 'START FAILED', e: false},
+      {controllerName: 'addHostController', state: 'INSTALL FAILED', e: false},
+      {controllerName: 'addHostController', state: 'PENDING', e: true},
+      {controllerName: 'addHostController', state: 'INSTALLED', e: true},
+      {controllerName: 'addServiceController', state: 'STARTED', e: false},
+      {controllerName: 'addServiceController', state: 'START FAILED', e: false},
+      {controllerName: 'addServiceController', state: 'INSTALL FAILED', e: false},
+      {controllerName: 'addServiceController', state: 'PENDING', e: true},
+      {controllerName: 'addServiceController', state: 'INSTALLED', e: true},
+      {controllerName: 'installerController', state: 'STARTED', e: false},
+      {controllerName: 'installerController', state: 'START FAILED', e: false},
+      {controllerName: 'installerController', state: 'INSTALL FAILED', e: true},
+      {controllerName: 'installerController', state: 'INSTALLED', e: true},
+      {controllerName: 'installerController', state: 'PENDING', e: true}
     ];
-    tests.forEach(function(test) {
+    tests.forEach(function (test) {
       var controller = App.WizardStep9Controller.create({
         content: {
           controllerName: test.controllerName,
-            cluster: {
+          cluster: {
             status: test.state
           }
         }
       });
-      it('controllerName is ' + test.controllerName + '; cluster status is ' + test.state + '; isSubmitDisabled should be ' + test.e, function() {
+      it('controllerName is ' + test.controllerName + '; cluster status is ' + test.state + '; isSubmitDisabled should be ' + test.e, function () {
         expect(controller.get('isSubmitDisabled')).to.equal(test.e);
       });
     });
 
   });
 
-  describe('#status', function() {
+  describe('#status', function () {
     var tests = [
       {
-        hosts: [{status: 'failed'},{status: 'success'}],
+        hosts: [
+          {status: 'failed'},
+          {status: 'success'}
+        ],
         isStepFailed: false,
         progress: '100',
-        m:'One host is failed',
-        e:'failed'
+        m: 'One host is failed',
+        e: 'failed'
       },
       {
-        hosts: [{status: 'warning'},{status: 'success'}],
-        m:'One host is failed and step is not failed',
+        hosts: [
+          {status: 'warning'},
+          {status: 'success'}
+        ],
+        m: 'One host is failed and step is not failed',
         isStepFailed: false,
         progress: '100',
-        e:'warning'
+        e: 'warning'
       },
       {
-        hosts: [{status: 'warning'},{status: 'success'}],
-        m:'One host is failed and step is failed',
+        hosts: [
+          {status: 'warning'},
+          {status: 'success'}
+        ],
+        m: 'One host is failed and step is failed',
         isStepFailed: true,
         progress: '100',
-        e:'failed'
+        e: 'failed'
       },
       {
-        hosts: [{status: 'success'},{status: 'success'}],
-        m:'All hosts are success and progress is 100',
+        hosts: [
+          {status: 'success'},
+          {status: 'success'}
+        ],
+        m: 'All hosts are success and progress is 100',
         isStepFailed: false,
         progress: '100',
-        e:'success'
+        e: 'success'
       },
       {
-        hosts: [{status: 'success'},{status: 'success'}],
-        m:'All hosts are success and progress is 50',
+        hosts: [
+          {status: 'success'},
+          {status: 'success'}
+        ],
+        m: 'All hosts are success and progress is 50',
         isStepFailed: false,
         progress: '50',
-        e:'info'
+        e: 'info'
       }
     ];
-    tests.forEach(function(test) {
-      var controller = App.WizardStep9Controller.create({hosts: test.hosts, isStepFailed: function(){return test.isStepFailed}, progress: test.progress});
+    tests.forEach(function (test) {
+      var controller = App.WizardStep9Controller.create({hosts: test.hosts, isStepFailed: function () {
+        return test.isStepFailed
+      }, progress: test.progress});
       controller.updateStatus();
-      it(test.m, function() {
+      it(test.m, function () {
         expect(controller.get('status')).to.equal(test.e);
       });
     });
   });
 
-  describe('#visibleHosts', function() {
+  describe('#visibleHosts', function () {
     var hosts = [
       Em.Object.create({status: 'failed'}),
+      Em.Object.create({status: 'heartbeat_lost'}),
       Em.Object.create({status: 'success'}),
       Em.Object.create({status: 'success'}),
       Em.Object.create({status: 'warning'}),
@@ -116,43 +134,43 @@ describe('App.InstallerStep9Controller', function () {
       Em.Object.create({status: 'info'})
     ];
     var tests = [
-      {category: {hostStatus: 'all'},e: hosts.length},
-      {category:{hostStatus: 'inProgress'},e: 2},
-      {category: {hostStatus: 'warning'},e: 1},
-      {category: {hostStatus: 'failed'},e: 1},
-      {category: {hostStatus: 'success'},e: 2}
+      {category: {hostStatus: 'all'}, e: hosts.length},
+      {category: {hostStatus: 'inProgress'}, e: 2},
+      {category: {hostStatus: 'warning'}, e: 1},
+      {category: {hostStatus: 'failed'}, e: 2},
+      {category: {hostStatus: 'success'}, e: 2}
     ];
     var controller = App.WizardStep9Controller.create({
       hosts: hosts
     });
-    tests.forEach(function(test) {
-      it('selected category with hostStatus "' + test.category.hostStatus + '"', function() {
+    tests.forEach(function (test) {
+      it('selected category with hostStatus "' + test.category.hostStatus + '"', function () {
         controller.selectCategory({context: test.category});
         expect(controller.get('visibleHosts.length')).to.equal(test.e);
       });
     });
   });
 
-  describe('#showRetry', function() {
-    it('cluster status is not INSTALL FAILED', function() {
-      var controller = App.WizardStep9Controller.create({content: {cluster:{status:'INSTALLED'}}});
+  describe('#showRetry', function () {
+    it('cluster status is not INSTALL FAILED', function () {
+      var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'INSTALLED'}}});
       expect(controller.get('showRetry')).to.equal(false);
     });
-    it('cluster status is INSTALL FAILED', function() {
-      var controller = App.WizardStep9Controller.create({content: {cluster:{status:'INSTALL FAILED'}}});
+    it('cluster status is INSTALL FAILED', function () {
+      var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'INSTALL FAILED'}}});
       expect(controller.get('showRetry')).to.equal(true);
     });
   });
 
-  describe('#resetHostsForRetry', function() {
-    var hosts = {'host1':Em.Object.create({status:'failed', message:'Failed'}), 'host2':Em.Object.create({status:'success', message:'Success'})};
-    var controller = App.WizardStep9Controller.create({content:{hosts: hosts}});
-    it('All should have status "pending" and message "Waiting"', function() {
+  describe('#resetHostsForRetry', function () {
+    var hosts = {'host1': Em.Object.create({status: 'failed', message: 'Failed'}), 'host2': Em.Object.create({status: 'success', message: 'Success'})};
+    var controller = App.WizardStep9Controller.create({content: {hosts: hosts}});
+    it('All should have status "pending" and message "Waiting"', function () {
       controller.resetHostsForRetry();
       for (var name in hosts) {
         if (hosts.hasOwnProperty(name)) {
-          expect(controller.get('content.hosts')[name].get('status','pending')).to.equal('pending');
-          expect(controller.get('content.hosts')[name].get('message','Waiting')).to.equal('Waiting');
+          expect(controller.get('content.hosts')[name].get('status', 'pending')).to.equal('pending');
+          expect(controller.get('content.hosts')[name].get('message', 'Waiting')).to.equal('Waiting');
         }
       }
     });
@@ -163,72 +181,83 @@ describe('App.InstallerStep9Controller', function () {
       message: 'message1',
       status: 'unknown',
       progress: '1',
-      tasks: [{},{}],
-      logTasks: [{},{}],
+      logTasks: [
+        {},
+        {}
+      ],
       bootStatus: 'REGISTERED'
     },
     'host2': {
       message: '',
       status: 'failed',
       progress: '1',
-      tasks: [{},{}],
-      logTasks: [{},{}],
+      logTasks: [
+        {},
+        {}
+      ],
       bootStatus: ''
     },
     'host3': {
       message: '',
       status: 'waiting',
       progress: null,
-      tasks: [{},{}],
-      logTasks: [{},{}],
+      logTasks: [
+        {},
+        {}
+      ],
       bootStatus: ''
     },
     'host4': {
       message: 'message4',
       status: null,
       progress: '10',
-      tasks: [],
-      logTasks: [{}],
+      logTasks: [
+        {}
+      ],
       bootStatus: 'REGISTERED'
     }
   };
-  
-  describe('#loadHosts', function() {
+
+  describe('#loadHosts', function () {
     var controller = App.WizardStep9Controller.create({content: {hosts: hosts_for_load_and_render}});
     controller.loadHosts();
     var loaded_hosts = controller.get('hosts');
-    it('Only REGISTERED hosts', function() {
+    it('Only REGISTERED hosts', function () {
       expect(loaded_hosts.length).to.equal(2);
     });
-    it('All hosts have progress 0', function() {
+    it('All hosts have progress 0', function () {
       expect(loaded_hosts.everyProperty('progress', 0)).to.equal(true);
     });
-    it('All hosts have progress 0', function() {
+    it('All hosts have progress 0', function () {
       expect(loaded_hosts.everyProperty('progress', 0)).to.equal(true);
     });
-    it('All host don\'t have tasks and logTasks', function() {
-      expect(loaded_hosts.everyProperty('tasks.length', 0)).to.equal(true);
+    it('All host don\'t have logTasks', function () {
       expect(loaded_hosts.everyProperty('logTasks.length', 0)).to.equal(true);
     });
   });
 
-  describe('#hostHasClientsOnly', function() {
+  describe('#hostHasClientsOnly', function () {
     var tests = [
       {
         hosts: [
           Em.Object.create({
             hostName: 'host1',
-            logTasks: [{Tasks: {role: 'HDFS_CLIENT'}},{Tasks: {role: 'DATANODE'}}],
+            logTasks: [
+              {Tasks: {role: 'HDFS_CLIENT'}},
+              {Tasks: {role: 'DATANODE'}}
+            ],
             status: 'old_status',
             progress: '10',
-            e: {status: 'old_status',progress: '10'}
+            e: {status: 'old_status', progress: '10'}
           }),
           Em.Object.create({
             hostName: 'host2',
-            logTasks: [{Tasks: {role: 'HDFS_CLIENT'}}],
+            logTasks: [
+              {Tasks: {role: 'HDFS_CLIENT'}}
+            ],
             status: 'old_status',
             progress: '10',
-            e: {status: 'success',progress: '100'}
+            e: {status: 'success', progress: '100'}
           })
         ],
         jsonError: false
@@ -237,27 +266,32 @@ describe('App.InstallerStep9Controller', function () {
         hosts: [
           Em.Object.create({
             hostName: 'host1',
-            logTasks: [{Tasks: {role: 'HDFS_CLIENT'}},{Tasks: {role: 'DATANODE'}}],
+            logTasks: [
+              {Tasks: {role: 'HDFS_CLIENT'}},
+              {Tasks: {role: 'DATANODE'}}
+            ],
             status: 'old_status',
             progress: '10',
-            e: {status: 'success',progress: '100'}
+            e: {status: 'success', progress: '100'}
           }),
           Em.Object.create({
             hostName: 'host2',
-            logTasks: [{Tasks: {role: 'HDFS_CLIENT'}}],
+            logTasks: [
+              {Tasks: {role: 'HDFS_CLIENT'}}
+            ],
             status: 'old_status',
             progress: '10',
-            e: {status: 'success',progress: '100'}
+            e: {status: 'success', progress: '100'}
           })
         ],
         jsonError: true
       }
     ];
-    tests.forEach(function(test) {
-      it('', function() {
+    tests.forEach(function (test) {
+      it('', function () {
         var controller = App.WizardStep9Controller.create({hosts: test.hosts});
         controller.hostHasClientsOnly(test.jsonError);
-        test.hosts.forEach(function(host) {
+        test.hosts.forEach(function (host) {
           expect(controller.get('hosts').findProperty('hostName', host.hostName).get('status')).to.equal(host.e.status);
           expect(controller.get('hosts').findProperty('hostName', host.hostName).get('progress')).to.equal(host.e.progress);
         });
@@ -265,7 +299,7 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#onSuccessPerHost', function() {
+  describe('#onSuccessPerHost', function () {
     var tests = [
       {
         cluster: {status: 'INSTALLED'},
@@ -277,42 +311,54 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'COMPLETED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'COMPLETED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'success'},
         m: 'All Tasks COMPLETED and cluster status INSTALLED'
       },
       {
         cluster: {status: 'FAILED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'COMPLETED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'COMPLETED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'info'},
         m: 'All Tasks COMPLETED and cluster status FAILED'
       },
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'FAILED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'FAILED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'info'},
         m: 'Not all Tasks COMPLETED and cluster status INSTALLED'
       },
       {
         cluster: {status: 'FAILED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'FAILED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'FAILED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'info'},
         m: 'Not all Tasks COMPLETED and cluster status FAILED'
       }
     ];
-    tests.forEach(function(test) {
+    tests.forEach(function (test) {
       var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}});
       controller.onSuccessPerHost(test.actions, test.host);
-      it(test.m, function() {
+      it(test.m, function () {
         expect(test.host.status).to.equal(test.e.status);
       });
     });
   });
 
-  describe('#onErrorPerHost', function() {
+  describe('#onErrorPerHost', function () {
     var tests = [
       {
         cluster: {status: 'INSTALLED'},
@@ -325,7 +371,10 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'FAILED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'FAILED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'warning'},
         isMasterFailed: false,
         m: 'One Task FAILED and cluster status INSTALLED'
@@ -333,7 +382,10 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'ABORTED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'ABORTED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'warning'},
         isMasterFailed: false,
         m: 'One Task ABORTED and cluster status INSTALLED'
@@ -341,7 +393,10 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'TIMEDOUT'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'TIMEDOUT'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'warning'},
         isMasterFailed: false,
         m: 'One Task TIMEDOUT and cluster status INSTALLED'
@@ -349,7 +404,10 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'PENDING'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'FAILED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'FAILED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'failed'},
         isMasterFailed: true,
         m: 'One Task FAILED and cluster status PENDING isMasterFailed true'
@@ -357,94 +415,111 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'PENDING'},
         host: Em.Object.create({status: 'info'}),
-        actions: [{Tasks: {status: 'COMPLETED'}},{Tasks: {status: 'COMPLETED'}}],
+        actions: [
+          {Tasks: {status: 'COMPLETED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
         e: {status: 'info'},
         isMasterFailed: false,
         m: 'One Task FAILED and cluster status PENDING isMasterFailed false'
       }
     ];
-    tests.forEach(function(test) {
-      var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}, isMasterFailed: function(){return test.isMasterFailed;}});
+    tests.forEach(function (test) {
+      var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}, isMasterFailed: function () {
+        return test.isMasterFailed;
+      }});
       controller.onErrorPerHost(test.actions, test.host);
-      it(test.m, function() {
+      it(test.m, function () {
         expect(test.host.status).to.equal(test.e.status);
       });
     });
   });
 
-  describe('#isMasterFailed', function() {
+  describe('#isMasterFailed', function () {
     var tests = [
       {
         actions: [
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'DATANODE'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'DATANODE'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
         ],
         e: false,
         m: 'No one Master is failed'
       },
       {
         actions: [
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'NAMENODE'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'NAMENODE'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
         ],
         e: true,
         m: 'One Master is failed'
       },
       {
         actions: [
-          {Tasks: {command: 'PENDING',status: 'FAILED',role: 'NAMENODE'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'TASKTRACKER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'HBASE_REGIONSERVER'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'GANGLIA_MONITOR'}},
-          {Tasks: {command: 'INSTALL',status: 'FAILED',role: 'SUPERVISOR'}}
+          {Tasks: {command: 'PENDING', status: 'FAILED', role: 'NAMENODE'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'TASKTRACKER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'HBASE_REGIONSERVER'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'GANGLIA_MONITOR'}},
+          {Tasks: {command: 'INSTALL', status: 'FAILED', role: 'SUPERVISOR'}}
         ],
         e: false,
         m: 'one Master is failed but command is not install'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create();
         expect(controller.isMasterFailed(test.actions)).to.equal(test.e);
       });
     });
   });
 
-  describe('#onInProgressPerHost', function() {
+  describe('#onInProgressPerHost', function () {
     var tests = [
       {
         host: Em.Object.create({message: 'default_message'}),
-        actions: [{Tasks: {status: 'COMPLETED'}},{Tasks: {status: 'COMPLETED'}}],
-        e: {message: 'default_message',b: true},
+        actions: [
+          {Tasks: {status: 'COMPLETED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
+        e: {message: 'default_message', b: true},
         m: 'All Tasks COMPLETED'
       },
       {
         host: Em.Object.create({message: 'default_message'}),
-        actions: [{Tasks: {status: 'IN_PROGRESS'}},{Tasks: {status: 'COMPLETED'}}],
-        e: {message: 'default_message',b: false},
+        actions: [
+          {Tasks: {status: 'IN_PROGRESS'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
+        e: {message: 'default_message', b: false},
         m: 'One Task IN_PROGRESS'
       },
       {
         host: Em.Object.create({message: 'default_message'}),
-        actions: [{Tasks: {status: 'QUEUED'}},{Tasks: {status: 'COMPLETED'}}],
-        e: {message: 'default_message',b: false},
+        actions: [
+          {Tasks: {status: 'QUEUED'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
+        e: {message: 'default_message', b: false},
         m: 'One Task QUEUED'
       },
       {
         host: Em.Object.create({message: 'default_message'}),
-        actions: [{Tasks: {status: 'PENDING'}},{Tasks: {status: 'COMPLETED'}}],
-        e: {message: 'default_message',b: false},
+        actions: [
+          {Tasks: {status: 'PENDING'}},
+          {Tasks: {status: 'COMPLETED'}}
+        ],
+        e: {message: 'default_message', b: false},
         m: 'One Task PENDING'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create();
         controller.onInProgressPerHost(test.actions, test.host);
         expect(test.host.message == test.e.message).to.equal(test.e.b);
@@ -452,7 +527,7 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#progressPerHost', function() {
+  describe('#progressPerHost', function () {
     var tests = [
       {
         cluster: {status: 'PENDING'},
@@ -464,21 +539,21 @@ describe('App.InstallerStep9Controller', function () {
           {Tasks: {status: 'QUEUED'}},
           {Tasks: {status: 'IN_PROGRESS'}}
         ],
-        e: {ret: 17,host: '17'},
+        e: {ret: 17, host: '17'},
         m: 'All types of status available. cluster status PENDING'
       },
       {
         cluster: {status: 'PENDING'},
         host: Em.Object.create({progress: 0}),
         actions: [],
-        e: {ret: 33,host: '33'},
+        e: {ret: 33, host: '33'},
         m: 'No tasks available. cluster status PENDING'
       },
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({progress: 0}),
         actions: [],
-        e: {ret: 100,host: '100'},
+        e: {ret: 100, host: '100'},
         m: 'No tasks available. cluster status INSTALLED'
       },
       {
@@ -491,19 +566,19 @@ describe('App.InstallerStep9Controller', function () {
           {Tasks: {status: 'QUEUED'}},
           {Tasks: {status: 'IN_PROGRESS'}}
         ],
-        e: {ret: 68,host: '68'},
+        e: {ret: 68, host: '68'},
         m: 'All types of status available. cluster status INSTALLED'
       },
       {
         cluster: {status: 'FAILED'},
         host: Em.Object.create({progress: 0}),
         actions: [],
-        e: {ret: 100,host: '100'},
+        e: {ret: 100, host: '100'},
         m: 'Cluster status is not PENDING or INSTALLED'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create({content: {cluster: {status: test.cluster.status}}});
         var progress = controller.progressPerHost(test.actions, test.host);
         expect(progress).to.equal(test.e.ret);
@@ -512,9 +587,13 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#clearStep', function() {
-    var controller = App.WizardStep9Controller.create({hosts: [{},{},{}]});
-    it('All to default values', function() {
+  describe('#clearStep', function () {
+    var controller = App.WizardStep9Controller.create({hosts: [
+      {},
+      {},
+      {}
+    ]});
+    it('All to default values', function () {
       controller.clearStep();
       expect(controller.get('hosts.length')).to.equal(0);
       expect(controller.get('status')).to.equal('info');
@@ -524,16 +603,22 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#replacePolledData', function() {
-    var controller = App.WizardStep9Controller.create({polledData: [{},{},{}]});
-    var newPolledData = [{}];
+  describe('#replacePolledData', function () {
+    var controller = App.WizardStep9Controller.create({polledData: [
+      {},
+      {},
+      {}
+    ]});
+    var newPolledData = [
+      {}
+    ];
     controller.replacePolledData(newPolledData);
-    it('replacing polled data', function() {
+    it('replacing polled data', function () {
       expect(controller.get('polledData.length')).to.equal(newPolledData.length);
     });
   });
 
-  describe('#isSuccess', function() {
+  describe('#isSuccess', function () {
     var tests = [
       {
         polledData: [
@@ -552,119 +637,119 @@ describe('App.InstallerStep9Controller', function () {
         m: 'Not all tasks are COMPLETED'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create();
         expect(controller.isSuccess(test.polledData)).to.equal(test.e);
       });
     });
   });
 
-  describe('#isStepFailed', function() {
+  describe('#isStepFailed', function () {
     var tests = [
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'FAILED'}},
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'FAILED'}},
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}}
         ],
         e: true,
         m: 'GANGLIA_MONITOR 2/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'GANGLIA_MONITOR',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'GANGLIA_MONITOR', status: 'PENDING'}}
         ],
         e: false,
         m: 'GANGLIA_MONITOR 1/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'FAILED'}},
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'FAILED'}},
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}}
         ],
         e: true,
         m: 'HBASE_REGIONSERVER 2/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'HBASE_REGIONSERVER',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'HBASE_REGIONSERVER', status: 'PENDING'}}
         ],
         e: false,
         m: 'HBASE_REGIONSERVER 1/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'FAILED'}},
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'FAILED'}},
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}}
         ],
         e: true,
         m: 'TASKTRACKER 2/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'TASKTRACKER',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'TASKTRACKER', status: 'PENDING'}}
         ],
         e: false,
         m: 'TASKTRACKER 1/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'FAILED'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'FAILED'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
         ],
         e: true,
         m: 'DATANODE 2/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
         ],
         e: false,
         m: 'DATANODE 1/3 failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'NAMENODE',status: 'TIMEDOUT'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'NAMENODE', status: 'TIMEDOUT'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
         ],
         e: true,
         m: 'NAMENODE failed'
       },
       {
         polledData: [
-          {Tasks: {command: 'INSTALL',role: 'NAMENODE',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}},
-          {Tasks: {command: 'INSTALL',role: 'DATANODE',status: 'PENDING'}}
+          {Tasks: {command: 'INSTALL', role: 'NAMENODE', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}},
+          {Tasks: {command: 'INSTALL', role: 'DATANODE', status: 'PENDING'}}
         ],
         e: false,
         m: 'Nothing failed failed'
       }
     ];
-    tests.forEach(function(test) {
+    tests.forEach(function (test) {
       var controller = App.WizardStep9Controller.create({polledData: test.polledData});
-      it(test.m, function() {
+      it(test.m, function () {
         expect(controller.isStepFailed()).to.equal(test.e);
       });
     });
   });
 
-  describe('#getUrl', function() {
+  describe('#getUrl', function () {
     var clusterName = 'tdk';
-    var cluster = App.WizardStep9Controller.create({content:{cluster:{name: clusterName, requestId: null}}});
-    it('check requestId priority', function() {
+    var cluster = App.WizardStep9Controller.create({content: {cluster: {name: clusterName, requestId: null}}});
+    it('check requestId priority', function () {
       cluster.set('content.cluster.requestId', 123);
       var url = cluster.getUrl(321);
       expect(url).to.equal(App.apiPrefix + '/clusters/' + clusterName + '/requests/' + '321' + '?fields=tasks/Tasks/command,tasks/Tasks/exit_code,tasks/Tasks/start_time,tasks/Tasks/end_time,tasks/Tasks/host_name,tasks/Tasks/id,tasks/Tasks/role,tasks/Tasks/status&minimal_response=true');
@@ -673,23 +758,23 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#finishState', function() {
+  describe('#finishState', function () {
     var statuses = ['INSTALL FAILED', 'START FAILED', 'STARTED'];
-    it('Installer is finished', function() {
-      statuses.forEach(function(status) {
-        var controller = App.WizardStep9Controller.create({content:{cluster:{status:status}}});
+    it('Installer is finished', function () {
+      statuses.forEach(function (status) {
+        var controller = App.WizardStep9Controller.create({content: {cluster: {status: status}}});
         var result = controller.finishState();
         expect(result).to.equal(true);
       });
     });
-    it('Unknown cluster status ', function() {
-      var controller = App.WizardStep9Controller.create({content:{cluster:{status:'FAKE_STATUS'}}});
+    it('Unknown cluster status ', function () {
+      var controller = App.WizardStep9Controller.create({content: {cluster: {status: 'FAKE_STATUS'}}});
       var result = controller.finishState();
       expect(result).to.equal(false);
     });
   });
 
-  describe('#setTasksPerHost', function() {
+  describe('#setTasksPerHost', function () {
     var tests = [
       {
         hosts: [
@@ -780,11 +865,11 @@ describe('App.InstallerStep9Controller', function () {
         m: 'No tasks'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create({polledData: test.polledData, hosts: test.hosts});
         controller.setTasksPerHost();
-        for(var name in test.e.hosts) {
+        for (var name in test.e.hosts) {
           if (test.e.hosts.hasOwnProperty(name)) {
             expect(controller.get('hosts').findProperty('name', name).get('tasks.length')).to.equal(test.e[name].count);
           }
@@ -793,35 +878,54 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#setLogTasksStatePerHost', function() {
+  describe('#setLogTasksStatePerHost', function () {
     var tests = [
       {
-        tasksPerHost: [{Tasks: {id: 1,status: 'COMPLETED'}},{Tasks: {id: 2,status: 'COMPLETED'}}],
+        tasksPerHost: [
+          {Tasks: {id: 1, status: 'COMPLETED'}},
+          {Tasks: {id: 2, status: 'COMPLETED'}}
+        ],
         tasks: [],
-        e: {m: 'COMPLETED',l: 2},
+        e: {m: 'COMPLETED', l: 2},
         m: 'host didn\'t have tasks and got 2 new'
       },
       {
-        tasksPerHost: [{Tasks: {id: 1,status: 'COMPLETED'}},{Tasks: {id: 2,status: 'COMPLETED'}}],
-        tasks: [{Tasks: {id: 1,status: 'IN_PROGRESS'}},{Tasks: {id: 2,status: 'IN_PROGRESS'}}],
-        e: {m: 'COMPLETED',l: 2},
+        tasksPerHost: [
+          {Tasks: {id: 1, status: 'COMPLETED'}},
+          {Tasks: {id: 2, status: 'COMPLETED'}}
+        ],
+        tasks: [
+          {Tasks: {id: 1, status: 'IN_PROGRESS'}},
+          {Tasks: {id: 2, status: 'IN_PROGRESS'}}
+        ],
+        e: {m: 'COMPLETED', l: 2},
         m: 'host had 2 tasks and got both updated'
       },
       {
         tasksPerHost: [],
-        tasks: [{Tasks: {id: 1,status: 'IN_PROGRESS'}},{Tasks: {id: 2,status: 'IN_PROGRESS'}}],
-        e: {m: 'IN_PROGRESS',l: 2},
+        tasks: [
+          {Tasks: {id: 1, status: 'IN_PROGRESS'}},
+          {Tasks: {id: 2, status: 'IN_PROGRESS'}}
+        ],
+        e: {m: 'IN_PROGRESS', l: 2},
         m: 'host had 2 tasks and didn\'t get updates'
       },
       {
-        tasksPerHost: [{Tasks: {id: 1,status: 'COMPLETED'}},{Tasks: {id: 2,status: 'COMPLETED'}},{Tasks: {id: 3,status: 'COMPLETED'}}],
-        tasks: [{Tasks: {id: 1,status: 'IN_PROGRESS'}},{Tasks: {id: 2,status: 'IN_PROGRESS'}}],
-        e: {m: 'COMPLETED',l: 3},
+        tasksPerHost: [
+          {Tasks: {id: 1, status: 'COMPLETED'}},
+          {Tasks: {id: 2, status: 'COMPLETED'}},
+          {Tasks: {id: 3, status: 'COMPLETED'}}
+        ],
+        tasks: [
+          {Tasks: {id: 1, status: 'IN_PROGRESS'}},
+          {Tasks: {id: 2, status: 'IN_PROGRESS'}}
+        ],
+        e: {m: 'COMPLETED', l: 3},
         m: 'host had 2 tasks and got both updated and 1 new'
       }
     ];
-    tests.forEach(function(test) {
-      it(test.m, function() {
+    tests.forEach(function (test) {
+      it(test.m, function () {
         var controller = App.WizardStep9Controller.create({hosts: [Em.Object.create({logTasks: test.tasks})]});
         controller.setLogTasksStatePerHost(test.tasksPerHost, controller.get('hosts')[0]);
         expect(controller.get('hosts')[0].get('logTasks').everyProperty('Tasks.status', test.e.m)).to.equal(true);
@@ -830,23 +934,23 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
-  describe('#parseHostInfo', function() {
+  describe('#parseHostInfo', function () {
 
     var tests = [
       {
         cluster: {status: 'PENDING'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host2',status: 'COMPLETED'}},
-            {Tasks: {host_name: 'host2',status: 'COMPLETED'}}
+          tasks: [
+            {Tasks: {host_name: 'host2', status: 'COMPLETED'}},
+            {Tasks: {host_name: 'host2', status: 'COMPLETED'}}
           ]
         },
         e: {
-          hosts:{
+          hosts: {
             host1: {progress: '33'},
             host2: {progress: '33'}
           },
@@ -857,32 +961,32 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'PENDING'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host1',status: 'IN_PROGRESS'}},
-            {Tasks: {host_name: 'host2',status: 'IN_PROGRESS'}}
+          tasks: [
+            {Tasks: {host_name: 'host1', status: 'IN_PROGRESS'}},
+            {Tasks: {host_name: 'host2', status: 'IN_PROGRESS'}}
           ]
         },
-        e: {hosts:{host1: {progress: '12'},host2: {progress: '12'}},progress: '12'},
+        e: {hosts: {host1: {progress: '12'}, host2: {progress: '12'}}, progress: '12'},
         m: 'Two hosts. Each host has one task IN_PROGRESS. Cluster status is PENDING'
       },
       {
         cluster: {status: 'PENDING'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host1',status: 'QUEUED'}},
-            {Tasks: {host_name: 'host2',status: 'QUEUED'}}
+          tasks: [
+            {Tasks: {host_name: 'host1', status: 'QUEUED'}},
+            {Tasks: {host_name: 'host2', status: 'QUEUED'}}
           ]
         },
         e: {
-          hosts:{
+          hosts: {
             host1: {progress: '3'},
             host2: {progress: '3'}
           },
@@ -893,17 +997,17 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host2',status: 'COMPLETED'}},
-            {Tasks: {host_name: 'host2',status: 'COMPLETED'}}
+          tasks: [
+            {Tasks: {host_name: 'host2', status: 'COMPLETED'}},
+            {Tasks: {host_name: 'host2', status: 'COMPLETED'}}
           ]
         },
         e: {
-          hosts:{
+          hosts: {
             host1: {progress: '100'},
             host2: {progress: '100'}
           },
@@ -914,17 +1018,17 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host1',status: 'IN_PROGRESS'}},
-            {Tasks: {host_name: 'host2',status: 'IN_PROGRESS'}}
+          tasks: [
+            {Tasks: {host_name: 'host1', status: 'IN_PROGRESS'}},
+            {Tasks: {host_name: 'host2', status: 'IN_PROGRESS'}}
           ]
         },
         e: {
-          hosts:{
+          hosts: {
             host1: {progress: '58'},
             host2: {progress: '58'}
           },
@@ -935,17 +1039,17 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'INSTALLED'},
         hosts: Em.A([
-          Em.Object.create({name: 'host1',status: '',message: '',progress: '',logTasks: []}),
-          Em.Object.create({name: 'host2',status: '',message: '',progress: '',logTasks: []})
+          Em.Object.create({name: 'host1', status: '', message: '', progress: '', logTasks: []}),
+          Em.Object.create({name: 'host2', status: '', message: '', progress: '', logTasks: []})
         ]),
         polledData: {
-          tasks:[
-            {Tasks: {host_name: 'host1',status: 'QUEUED'}},
-            {Tasks: {host_name: 'host2',status: 'QUEUED'}}
+          tasks: [
+            {Tasks: {host_name: 'host1', status: 'QUEUED'}},
+            {Tasks: {host_name: 'host2', status: 'QUEUED'}}
           ]
         },
         e: {
-          hosts:{
+          hosts: {
             host1: {progress: '40'},
             host2: {progress: '40'}
           },
@@ -970,4 +1074,109 @@ describe('App.InstallerStep9Controller', function () {
     });
   });
 
+  describe('#isAllComponentsInstalledSuccessCallback', function () {
+
+    var hosts = [
+      Em.Object.create({name: 'host1', status: 'failed', expectedStatus: 'heartbeat_lost'}),
+      Em.Object.create({name: 'host2', status: 'info', expectedStatus: 'heartbeat_lost'}),
+      Em.Object.create({name: 'host3',status: 'warning', expectedStatus: 'warning'}),
+      Em.Object.create({name: 'host4',status: 'info', expectedStatus: 'info'})
+    ];
+    var jsonData = {
+      "items": [
+        {
+          "Hosts": {
+            "cluster_name": "c1",
+            "host_name": "host1",
+            "host_state": "HEARTBEAT_LOST"
+          },
+          "host_components": [
+            {
+              "HostRoles": {
+                "cluster_name": "c1",
+                "component_name": "NAMENODE",
+                "host_name": "host1",
+                "state": "INSTALL_FAILED"
+              }
+            }
+          ]
+        },
+        {
+          "Hosts": {
+            "cluster_name": "c1",
+            "host_name": "host2",
+            "host_state": "HEARTBEAT_LOST"
+          },
+          "host_components": [
+
+            {
+              "HostRoles": {
+                "cluster_name": "c1",
+                "component_name": "ZOOKEEPER_SERVER",
+                "host_name": "host2",
+                "state": "UNKNOWN"
+              }
+            }
+          ]
+        },
+        {
+          "Hosts": {
+            "cluster_name": "c1",
+            "host_name": "host3",
+            "host_state": "HEALTHY"
+          },
+          "host_components": [
+            {
+              "HostRoles": {
+                "cluster_name": "c1",
+                "component_name": "DATANODE",
+                "host_name": "host3",
+                "state": "INSTALL_FAILED"
+              }
+            }
+          ]
+        },
+        {
+          "Hosts": {
+            "cluster_name": "c1",
+            "host_name": "host4",
+            "host_state": "HEALTHY"
+          },
+          "host_components": [
+            {
+              "HostRoles": {
+                "cluster_name": "c1",
+                "component_name": "PIG",
+                "host_name": "host4",
+                "state": "INSTALLED"
+              }
+            },
+            {
+              "HostRoles": {
+                "cluster_name": "c1",
+                "component_name": "DATANODE",
+                "host_name": "host3",
+                "state": "INSTALLED"
+              }
+            }
+          ]
+        }
+      ]
+    };
+
+    var controller = App.WizardStep9Controller.create({hosts: hosts,content: {controllerName: 'installerController'}});
+    App.testMode = true;
+    // Action
+    controller.isAllComponentsInstalledSuccessCallback(jsonData);
+
+    // Validation
+    controller.get('hosts').forEach(function (test) {
+      var status = jsonData.items.findProperty('Hosts.host_name',test.get('name')).Hosts.host_state;
+      it('Host "' + test.get('name') + '"' + ' with status "' + status +'" ', function () {
+        expect(test.get('status')).to.equal(test.get('expectedStatus'));
+      });
+    });
+
+  })
+
 });


[2/2] git commit: AMBARI-4530. Cluster install errors out strangely without starting services. (jaimin)

Posted by ja...@apache.org.
AMBARI-4530. Cluster install errors out strangely without starting services. (jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d79be110
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d79be110
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d79be110

Branch: refs/heads/trunk
Commit: d79be1109db28284d96fd32582023591e3051cad
Parents: 793cad5
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Feb 21 19:33:54 2014 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Feb 21 19:33:54 2014 -0800

----------------------------------------------------------------------
 .../wizard/deploy/5_hosts/get_hosts_state.json  | 395 +++++++++++
 .../app/controllers/wizard/step9_controller.js  | 600 ++++++++++++----
 ambari-web/app/messages.js                      |   8 +
 ambari-web/app/templates/wizard/step9.hbs       |  10 +-
 .../templates/wizard/step9HostTasksLogPopup.hbs | 118 ++--
 .../wizard/step9_install_host_popup.hbs         |  40 ++
 ambari-web/app/utils/ajax.js                    |   9 +
 ambari-web/app/views/wizard/step9_view.js       | 147 ++--
 ambari-web/test/installer/step9_test.js         | 693 ++++++++++++-------
 9 files changed, 1517 insertions(+), 503 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/assets/data/wizard/deploy/5_hosts/get_hosts_state.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/wizard/deploy/5_hosts/get_hosts_state.json b/ambari-web/app/assets/data/wizard/deploy/5_hosts/get_hosts_state.json
new file mode 100644
index 0000000..cc520fa
--- /dev/null
+++ b/ambari-web/app/assets/data/wizard/deploy/5_hosts/get_hosts_state.json
@@ -0,0 +1,395 @@
+{
+  "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts?fields=Hosts/host_state,host_components/HostRoles/state",
+  "items" : [
+    {
+      "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal",
+      "Hosts" : {
+        "cluster_name" : "c1",
+        "host_name" : "ambari-1.c.apache.internal",
+        "host_state" : "HEALTHY"
+      },
+      "host_components" : [
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/GANGLIA_MONITOR",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "GANGLIA_MONITOR",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/GANGLIA_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "GANGLIA_SERVER",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/HBASE_MASTER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HBASE_MASTER",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/HCAT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HCAT",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/HDFS_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HDFS_CLIENT",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/HIVE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HIVE_CLIENT",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/NAGIOS_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "NAGIOS_SERVER",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "NAMENODE",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/OOZIE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "OOZIE_CLIENT",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/YARN_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "YARN_CLIENT",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-1.c.apache.internal/host_components/ZOOKEEPER_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "host_name" : "ambari-1.c.apache.internal",
+            "state" : "STARTED"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal",
+      "Hosts" : {
+        "cluster_name" : "c1",
+        "host_name" : "ambari-2.c.apache.internal",
+        "host_state" : "HEARTBEAT_LOST"
+      },
+      "host_components" : [
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/GANGLIA_MONITOR",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "GANGLIA_MONITOR",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/HDFS_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HDFS_CLIENT",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/HISTORYSERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HISTORYSERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/HIVE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HIVE_CLIENT",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/HIVE_METASTORE",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HIVE_METASTORE",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/HIVE_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HIVE_SERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/MYSQL_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "MYSQL_SERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/OOZIE_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "OOZIE_SERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/RESOURCEMANAGER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "RESOURCEMANAGER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/SECONDARY_NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "SECONDARY_NAMENODE",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/WEBHCAT_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "WEBHCAT_SERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/YARN_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "YARN_CLIENT",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/ZOOKEEPER_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-2.c.apache.internal/host_components/ZOOKEEPER_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "host_name" : "ambari-2.c.apache.internal",
+            "state" : "UNKNOWN"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal",
+      "Hosts" : {
+        "cluster_name" : "c1",
+        "host_name" : "ambari-3.c.apache.internal",
+        "host_state" : "HEALTHY"
+      },
+      "host_components" : [
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/DATANODE",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "DATANODE",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/GANGLIA_MONITOR",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "GANGLIA_MONITOR",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/HBASE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HBASE_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/HBASE_REGIONSERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HBASE_REGIONSERVER",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/HCAT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HCAT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/HDFS_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HDFS_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/HIVE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "HIVE_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/MAPREDUCE2_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "MAPREDUCE2_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/NODEMANAGER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "NODEMANAGER",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/OOZIE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "OOZIE_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/PIG",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "PIG",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/SQOOP",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "SQOOP",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/YARN_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "YARN_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/ZOOKEEPER_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "INSTALLED"
+          }
+        },
+        {
+          "href" : "http://162.216.148.67:8080/api/v1/clusters/c1/hosts/ambari-3.c.apache.internal/host_components/ZOOKEEPER_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "host_name" : "ambari-3.c.apache.internal",
+            "state" : "STARTED"
+          }
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index 7008720..b7ad07b 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -20,13 +20,80 @@ var serviceComponents = require('data/service_components');
 
 App.WizardStep9Controller = Em.Controller.extend({
   name: 'wizardStep9Controller',
+
+  /**
+   *  Array of host Objects that are successfully registered on "Confirm Host Options" page
+   *  <code>
+   *    {
+   *      name: {String} host name.
+   *      status: {String} Current status of the host. This field is used in the step 9 view to set the css class of the
+   *             host progress bar and set the appropriate message. Possible values: info, warning, failed, heartbeat_lost and success
+   *      logTasks: {Array} Tasks that are scheduled on the host for the current request.
+   *      message: {String} Message to be shown in front of the host name.
+   *      progress: {Int} Progress of the tasks on the host. Amount of tasks completed for all the tasks scheduled on the host.
+   *      isNoTasksForInstall: {Boolean} Gets set when no task is scheduled for the host on install phase.
+   *    }
+   *  </code>
+   */
+
   hosts: [],
+
+  /*
+   * Array of above hosts that should be made visible depending upon "Host State Filter" chosen <Possible filter values:
+   * All, In Progress, Warning, Success and Fail>
+   */
+  visibleHosts: [],
+
+  /**
+   * overall progress of <Install,Start and Test> page shown as progress bar on the top of the page
+   */
   progress: '0',
 
-  isStepCompleted: false,
+  /*
+   * json file for the mock data to be used in mock mode
+   */
+  mockDataPrefix: '/data/wizard/deploy/5_hosts',
+
+  /*
+   * Current Request data polled from the API: api/v1/clusters/{clusterName}/requests/{RequestId}?fields=tasks/Tasks/command,
+   * tasks/Tasks/exit_code,tasks/Tasks/start_time,tasks/Tasks/end_time,tasks/Tasks/host_name,tasks/Tasks/id,tasks/Tasks/role,
+   * tasks/Tasks/status&minimal_response=true
+   */
+  polledData: [],
+
+  /*
+   * This flag is only used in UI mock mode as a counter for number of polls.
+   */
+  numPolls: 1,
+
+  // Interval in milliseconds between API calls While polling the request status for Install and, Start and Test tasks
+  POLL_INTERVAL: 4000,
+
+  /**
+   * Array of objects
+   * <code>
+   *   {
+   *     hostName: {String} Name of host that has stopped heartbeating to ambari-server
+   *     componentNames: {Sting} Name of all components that are on the host
+   *   }
+   * </code>
+   */
+  hostsWithHeartbeatLost: [],
 
+  /*
+   * Status of the page. Possible values: <info, warning, failed and success>.
+   * This property is used in the step-9 view for displaying the appropriate color of the overall progress bar and
+   * the appropriate result message at the bottom of the page
+   */
+  status: 'info',
+
+  /**
+   * This computed property is used to determine if the Next button and back button on the page should be disabled. The property is
+   * used in the template to grey out Next and Back buttons. Although clicking on the greyed out button do trigger the event and
+   * calls submit and back function of the controller.
+   */
   isSubmitDisabled: function () {
-    var validStates = ['STARTED','START FAILED'];
+    var validStates = ['STARTED', 'START FAILED'];
     var controllerName = this.get('content.controllerName');
     if (controllerName == 'addHostController' || controllerName == 'addServiceController') {
       validStates.push('INSTALL FAILED');
@@ -34,7 +101,27 @@ App.WizardStep9Controller = Em.Controller.extend({
     return !validStates.contains(this.get('content.cluster.status'));
   }.property('content.cluster.status'),
 
-  // links to previous steps are enabled iff install failed in installer
+  /**
+   * This function is called when a click event happens on Next button of <Install, Start and Test> page
+   */
+  submit: function () {
+    if (!this.get('isSubmitDisabled')) {
+      App.router.send('next');
+    }
+  },
+
+  /**
+   * This function is called when a click event happens on back button of <Install, Start and Test> page
+   */
+  back: function () {
+    if (!this.get('isSubmitDisabled')) {
+      App.router.send('back');
+    }
+  },
+
+  /**
+   * Observer function: Enables previous steps link if install task failed in installer wizard.
+   */
   togglePreviousSteps: function () {
     if ('INSTALL FAILED' === this.get('content.cluster.status') && this.get('content.controllerName') == 'installerController') {
       App.router.get('installerController').setStepsEnable();
@@ -43,27 +130,35 @@ App.WizardStep9Controller = Em.Controller.extend({
     }
   }.observes('content.cluster.status', 'content.controllerName'),
 
-  mockDataPrefix: '/data/wizard/deploy/5_hosts',
-  pollDataCounter: 0,
-  polledData: [],
-  numPolls: 1,
-  POLL_INTERVAL: 4000,
-
-  visibleHosts: [],
-  status: 'info',
-
+  /*
+   * Computed property to determine if the Retry button should be made visible on the page.
+   */
   showRetry: function () {
     return this.get('content.cluster.status') == 'INSTALL FAILED';
   }.property('content.cluster.status'),
 
+  /**
+   * Ember Object with the controllerbinding as this controller. This object also contains
+   * <code>
+   *   hostStatus: {String} A valid status of a host.
+   *               Used to filter hosts in that status.
+   *   hostsCount: {Int} Dynamic count of hosts displayed in the category label
+   *   label : {String} status and hosts in that status displayed which consists as a category on the page
+   *   isActive: {boolean} Gets set when the category is selected/clicked by the user
+   *   itemClass: {computed property} Binds the category link to active class when user clicks on the link
+   * </code>
+   */
   categoryObject: Em.Object.extend({
     hostsCount: function () {
       var category = this;
-      var hosts = this.get('controller.hosts').filter(function(_host) {
-        if(category.get('hostStatus') == 'inProgress'){   // queued, pending, in_progress map to inProgress
-          return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+      var hosts = this.get('controller.hosts').filter(function (_host) {
+        if (category.get('hostStatus') == 'inProgress') {
+          return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress');
+        } else if (category.get('hostStatus') == 'failed') {
+          return (_host.get('status') == 'failed' || _host.get('status') == 'heartbeat_lost');
+        } else {
+          return (_host.get('status') == category.get('hostStatus'));
         }
-        return (_host.get('status') == category.get('hostStatus'));
       }, this);
       return hosts.get('length');
     }.property('controller.hosts.@each.status'),
@@ -71,20 +166,25 @@ App.WizardStep9Controller = Em.Controller.extend({
       return "%@ (%@)".fmt(this.get('value'), this.get('hostsCount'));
     }.property('value', 'hostsCount')
   }),
+
+  /**
+   * computed property creates the category objects on the load of the page and sets 'All' as the active category
+   * @Returns: All created categories which are binded and iterated in the template
+   */
   categories: function () {
     var self = this;
     self.categoryObject.reopen({
       controller: self,
-      isActive: function(){
+      isActive: function () {
         return this.get('controller.category') == this;
       }.property('controller.category'),
-      itemClass: function(){
+      itemClass: function () {
         return this.get('isActive') ? 'active' : '';
       }.property('isActive')
     });
 
     var categories = [
-      self.categoryObject.create({value: Em.I18n.t('common.all'), hostStatus:'all', hostsCount: function () {
+      self.categoryObject.create({value: Em.I18n.t('common.all'), hostStatus: 'all', hostsCount: function () {
         return this.get('controller.hosts.length');
       }.property('controller.hosts.length') }),
       self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.inProgress'), hostStatus: 'inProgress'}),
@@ -96,31 +196,64 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.set('category', categories.get('firstObject'));
     return categories;
   }.property(),
+
+  /**
+   * Registered as an handlebar action in step-9 template. Invoked whenever click event occurs on a category label
+   * @param event: {categoryObject}
+   */
+  selectCategory: function (event) {
+    this.set('category', event.context);
+  },
+
+  /**
+   * Present clicked/selected {categoryObject} on the page
+   */
   category: false,
 
-  hostStatusObserver: function(){
+  /**
+   * Observer function: Calls {hostStatusUpdates} function once with change in a host status from any registered hosts.
+   */
+  hostStatusObserver: function () {
     Ember.run.once(this, 'hostStatusUpdates');
   }.observes('hosts.@each.status'),
 
+
+  /**
+   * Updates the hosts mapping to the category selected and updates entire page status
+   */
   hostStatusUpdates: function () {
     this.updateVisibleHosts();
     this.updateStatus();
   },
 
+  /**
+   * Observer function: Updates {visibleHosts Array} of this controller whenever category is changed
+   */
   updateVisibleHosts: function () {
     var targetStatus = this.get('category.hostStatus');
     var visibleHosts = (targetStatus === 'all') ? this.get('hosts') : this.get('hosts').filter(function (_host) {
-      if (targetStatus == 'inProgress') {   // queued, pending, in_progress map to inProgress
-        return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+      if (targetStatus == 'inProgress') {
+        return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress');
+      } else if (targetStatus === 'failed') {
+        return (_host.get('status') === 'failed' || _host.get('status') === 'heartbeat_lost');
+      } else {
+        return (_host.get('status') == targetStatus);
       }
-      return (_host.get('status') == targetStatus);
     }, this);
     this.set('visibleHosts', visibleHosts);
   }.observes('category'),
 
+  /**
+   * A flag that gets set with installation failure.
+   */
+  installFailed: false,
+
+  /**
+   * Observer function: Updates {status} field of the controller.
+   */
   updateStatus: function () {
     var status = 'info';
-    if (this.get('hosts').someProperty('status', 'failed')) {
+    if (this.get('hosts').someProperty('status', 'failed') || this.get('hosts').someProperty('status', 'heartbeat_lost')) {
       status = 'failed';
     } else if (this.get('hosts').someProperty('status', 'warning')) {
       if (this.isStepFailed()) {
@@ -128,46 +261,38 @@ App.WizardStep9Controller = Em.Controller.extend({
       } else {
         status = 'warning';
       }
-    } else if (this.get('progress') == '100') {
-      this.set('isStepCompleted', true);
+    } else if (this.get('progress') == '100' && this.get('content.cluster.status') !== 'INSTALL FAILED') {
       status = 'success';
     }
     this.set('status', status);
   }.observes('progress'),
 
+  /**
+   * Incremental flag that triggers an event in step 9 view to change the tasks related data and icons of hosts.
+   */
   logTasksChangesCounter: 0,
 
-  selectCategory: function(event){
-    this.set('category', event.context);
-  },
-
-  getCategory: function(field, value){
-    return this.get('categories').find(function(item){
-      return item.get(field) == value;
-    });
-  },
-
-  // content.cluster.status can be:
-  // PENDING: set upon successful transition from step 1 to step 2
-  // INSTALLED: set upon successful completion of install phase as well as successful invocation of start services API
-  // STARTED: set up on successful completion of start phase
-  // INSTALL FAILED: set up upon encountering a failure in install phase
-  // START FAILED: set upon unsuccessful invocation of start services API and also upon encountering a failure
-  // during start phase
-
-  // content.cluster.isCompleted
-  // set to false upon successful transition from step 1 to step 2
-  // set to true upon successful start of services in this step
-  // note: looks like this is the same thing as checking content.cluster.status == 'STARTED'
-
+  /**
+   * navigateStep is called by App.WizardStep9View's didInsertElement and "retry" from router.
+   * content.cluster.status can be:
+   * PENDING: set upon successful transition from step 1 to step 2
+   * INSTALLED: set upon successful completion of install phase as well as successful invocation of start services API
+   * STARTED: set up on successful completion of start phase
+   * INSTALL FAILED: set up upon encountering a failure in install phase
+   * START FAILED: set upon unsuccessful invocation of start services API and also upon encountering a failure
+   * during start phase
 
-  // navigateStep is called by App.WizardStep9View's didInsertElement and "retry" from router.
+   * content.cluster.isCompleted
+   * set to false upon successful transition from step 1 to step 2
+   * set to true upon successful start of services in this step
+   * note: looks like this is the same thing as checking content.cluster.status == 'STARTED'
+   */
   navigateStep: function () {
     if (App.testMode) {
       // this is for repeatedly testing out installs in test mode
       this.set('content.cluster.status', 'PENDING');
       this.set('content.cluster.isCompleted', false);
-      this.set('content.cluster.requestId',1);
+      this.set('content.cluster.requestId', 1);
     }
     var clusterStatus = this.get('content.cluster.status');
     console.log('navigateStep: clusterStatus = ' + clusterStatus);
@@ -176,12 +301,9 @@ App.WizardStep9Controller = Em.Controller.extend({
       if (clusterStatus === 'INSTALL FAILED') {
         this.loadStep();
         this.loadLogData(this.get('content.cluster.requestId'));
-        this.set('isStepCompleted', true);
       } else if (clusterStatus === 'START FAILED') {
         this.loadStep();
         this.loadLogData(this.get('content.cluster.requestId'));
-        // this.hosts.setEach('status', 'info');
-        this.set('isStepCompleted', true);
       } else {
         // handle PENDING, INSTALLED
         this.loadStep();
@@ -193,35 +315,48 @@ App.WizardStep9Controller = Em.Controller.extend({
       // the cluster has successfully installed and started
       this.loadStep();
       this.loadLogData(this.get('content.cluster.requestId'));
-      this.set('isStepCompleted', true);
       this.set('progress', '100');
     }
   },
+
+  /**
+   * This is called on initial page load, refreshes and retry event.
+   * clears all in memory stale data for retry event.
+   */
   clearStep: function () {
     this.get('hosts').clear();
+    this.set('hostsWithHeartbeatLost', []);
     this.set('status', 'info');
     this.set('progress', '0');
-    this.set('isStepCompleted', false);
     this.set('numPolls', 1);
   },
 
+  /**
+   * This is called on initial page load, refreshes and retry event.
+   */
   loadStep: function () {
     console.log("TRACE: Loading step9: Install, Start and Test");
     this.clearStep();
     this.loadHosts();
   },
+
+
   /**
-   * reset status and message of all hosts when retry install
+   * Reset status and message of all hosts when retry install
    */
-  resetHostsForRetry: function(){
+  resetHostsForRetry: function () {
     var hosts = this.get('content.hosts');
     for (var name in hosts) {
       hosts[name].status = "pending";
       hosts[name].message = 'Waiting';
+      hosts[name].isNoTasksForInstall = false;
     }
     this.set('content.hosts', hosts);
   },
 
+  /**
+   * Sets the {hosts} array for the controller
+   */
   loadHosts: function () {
     var hosts = this.get('content.hosts');
     for (var index in hosts) {
@@ -229,21 +364,30 @@ App.WizardStep9Controller = Em.Controller.extend({
         var hostInfo = App.HostInfo.create({
           name: hosts[index].name,
           status: (hosts[index].status) ? hosts[index].status : 'info',
-          tasks: [],
           logTasks: [],
           message: (hosts[index].message) ? hosts[index].message : 'Waiting',
-          progress: 0
+          progress: 0,
+          isNoTasksForInstall: false
         });
         this.get('hosts').pushObject(hostInfo);
       }
     }
   },
 
+  /**
+   *
+   * @param polledData: sets the {polledData} object of the controller
+   */
   replacePolledData: function (polledData) {
     this.polledData.clear();
     this.set('polledData', polledData);
   },
 
+  /**
+   *
+   * @param task
+   * @returns {String} The appropriate message for the host as per the running task.
+   */
   displayMessage: function (task) {
     var role = App.format.role(task.role);
     switch (task.command) {
@@ -331,7 +475,8 @@ App.WizardStep9Controller = Em.Controller.extend({
   },
 
   /**
-   * run start/check services after installation phase
+   * Run start/check services after installation phase.
+   * Does Ajax call to start all services
    */
   launchStartServices: function () {
     var data = {
@@ -377,6 +522,10 @@ App.WizardStep9Controller = Em.Controller.extend({
     });
   },
 
+  /**
+   * Success callback function for start services task.
+   * @param jsonData: {json object} Contains Request id to poll.
+   */
   launchStartServicesSuccessCallback: function (jsonData) {
     var clusterStatus = {};
     if (jsonData) {
@@ -403,7 +552,6 @@ App.WizardStep9Controller = Em.Controller.extend({
       App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
       this.set('status', 'success');
       this.set('progress', '100');
-      this.set('isStepCompleted', true);
     }
     // We need to do recovery if there is a browser crash
     App.clusterStatus.setClusterStatus({
@@ -412,18 +560,22 @@ App.WizardStep9Controller = Em.Controller.extend({
       localdb: App.db.data
     });
 
-    if(jsonData) {
+    if (jsonData) {
       this.startPolling();
     }
   },
 
-  hostHasClientsOnly: function(jsonError) {
-    this.get('hosts').forEach(function(host){
+  /**
+   * This function will be called for Add host wizard only.
+   * @param jsonError: {boolean} Boolean is true when API to start services returns 200 ok and no json data
+   */
+  hostHasClientsOnly: function (jsonError) {
+    this.get('hosts').forEach(function (host) {
       var OnlyClients = true;
       var tasks = host.get('logTasks');
-      tasks.forEach(function(task){
-        var component = serviceComponents.findProperty('component_name',task.Tasks.role);
-        if(!(component && component.isClient)) {
+      tasks.forEach(function (task) {
+        var component = serviceComponents.findProperty('component_name', task.Tasks.role);
+        if (!(component && component.isClient)) {
           OnlyClients = false;
         }
       });
@@ -434,6 +586,9 @@ App.WizardStep9Controller = Em.Controller.extend({
     });
   },
 
+  /**
+   * Error callback function for start services task.
+   */
   launchStartServicesErrorCallback: function () {
     console.log("ERROR");
     var clusterStatus = {
@@ -444,29 +599,41 @@ App.WizardStep9Controller = Em.Controller.extend({
     App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
   },
 
-  // marks a host's status as "success" if all tasks are in COMPLETED state
+  /**
+   * marks a host's status as "success" if all tasks are in COMPLETED state
+   */
   onSuccessPerHost: function (actions, contentHost) {
     if (actions.everyProperty('Tasks.status', 'COMPLETED') && this.get('content.cluster.status') === 'INSTALLED') {
       contentHost.set('status', 'success');
     }
   },
 
-  // marks a host's status as "warning" if at least one of the tasks is FAILED, ABORTED, or TIMEDOUT and marks host's status as "failed" if at least one master component install task is FAILED.
-  // note that if the master failed to install because of ABORTED or TIMEDOUT, we don't mark it as failed, because this would mark all hosts as "failed" and makes it difficult for the user
-  // to find which host FAILED occurred on, if any
+  /**
+   * marks a host's status as "warning" if at least one of the tasks is FAILED, ABORTED, or TIMEDOUT and marks host's status as "failed" if at least one master component install task is FAILED.
+   * note that if the master failed to install because of ABORTED or TIMEDOUT, we don't mark it as failed, because this would mark all hosts as "failed" and makes it difficult for the user
+   * to find which host FAILED occurred on, if any
+   * @param actions {Array} of tasks retrieved from polled data
+   * @param contentHost {Object} A host object
+   */
+
   onErrorPerHost: function (actions, contentHost) {
     if (!actions) return;
     if (actions.someProperty('Tasks.status', 'FAILED') || actions.someProperty('Tasks.status', 'ABORTED') || actions.someProperty('Tasks.status', 'TIMEDOUT')) {
       contentHost.set('status', 'warning');
     }
     if ((this.get('content.cluster.status') === 'PENDING' && actions.someProperty('Tasks.status', 'FAILED')) || (this.isMasterFailed(actions))) {
-      contentHost.set('status', 'failed');
+      contentHost.get('status') !== 'heartbeat_lost' ? contentHost.set('status', 'failed') : '';
     }
   },
-  //return true if there is at least one FAILED task of master component install
-  isMasterFailed: function(polledData) {
+
+  /**
+   *
+   * @param polledData : Json data polled from API.
+   * @returns {boolean}  true if there is at least one FAILED task of master component install
+   */
+  isMasterFailed: function (polledData) {
     var result = false;
-    polledData.filterProperty('Tasks.command', 'INSTALL').filterProperty('Tasks.status', 'FAILED').mapProperty('Tasks.role').forEach (
+    polledData.filterProperty('Tasks.command', 'INSTALL').filterProperty('Tasks.status', 'FAILED').mapProperty('Tasks.role').forEach(
       function (role) {
         if (!App.get('components.slaves').contains(role)) {
           result = true;
@@ -476,6 +643,11 @@ App.WizardStep9Controller = Em.Controller.extend({
     return result;
   },
 
+  /**
+   * Mark a host status as in_progress if the any task on the host if either in IN_PROGRESS, QUEUED or PENDONG state.
+   * @param actions {Array} of tasks retrieved from polled data
+   * @param contentHost {Object} A host object
+   */
   onInProgressPerHost: function (actions, contentHost) {
     var runningAction = actions.findProperty('Tasks.status', 'IN_PROGRESS');
     if (runningAction === undefined || runningAction === null) {
@@ -515,10 +687,10 @@ App.WizardStep9Controller = Em.Controller.extend({
      */
     switch (this.get('content.cluster.status')) {
       case 'PENDING':
-        progress = actionsPerHost?(Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsPerHost * 33)):33;
+        progress = actionsPerHost ? (Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsPerHost * 33)) : 33;
         break;
       case 'INSTALLED':
-        progress = actionsPerHost?(34 + Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsPerHost * 66)):100;
+        progress = actionsPerHost ? (34 + Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsPerHost * 66)) : 100;
         break;
       default:
         progress = 100;
@@ -528,6 +700,11 @@ App.WizardStep9Controller = Em.Controller.extend({
     return progress;
   },
 
+  /**
+   *
+   * @param polledData : Josn data retrieved from API
+   * @returns {Boolean} : Has step completed successfully
+   */
   isSuccess: function (polledData) {
     return polledData.everyProperty('Tasks.status', 'COMPLETED');
   },
@@ -564,36 +741,36 @@ App.WizardStep9Controller = Em.Controller.extend({
     return failed;
   },
 
-  // makes a state transition
-  // PENDING -> INSTALLED
-  // PENDING -> INSTALL FAILED
-  // INSTALLED -> STARTED
-  // INSTALLED -> START_FAILED
-  // returns true if polling should stop; false otherwise
-  // polling from ui stops only when no action has 'PENDING', 'QUEUED' or 'IN_PROGRESS' status
+  /**
+   * polling from ui stops only when no action has 'PENDING', 'QUEUED' or 'IN_PROGRESS' status
+   * Makes a state transition
+   * PENDING -> INSTALLED
+   * PENDING -> INSTALL FAILED
+   * INSTALLED -> STARTED
+   * INSTALLED -> START_FAILED
+   * @param polledData json data retrieved from API
+   * @returns {Boolean} true if polling should stop; false otherwise
+   */
   finishState: function (polledData) {
     if (this.get('content.cluster.status') === 'INSTALLED') {
-      return this.finishStateInstalled(polledData);
+      return this.isServicesStarted(polledData);
+    } else if (this.get('content.cluster.status') === 'PENDING') {
+      return this.isServicesInstalled(polledData);
+    } else if (this.get('content.cluster.status') === 'INSTALL FAILED' || this.get('content.cluster.status') === 'START FAILED'
+      || this.get('content.cluster.status') === 'STARTED') {
+      this.set('progress', '100');
+      return true;
     }
-    else
-      if (this.get('content.cluster.status') === 'PENDING') {
-        return this.finishStatePending(polledData);
-      }
-      else
-        if (this.get('content.cluster.status') === 'INSTALL FAILED' ||
-            this.get('content.cluster.status') === 'START FAILED' ||
-            this.get('content.cluster.status') === 'STARTED') {
-          this.set('progress', '100');
-          return true;
-        }
     return false;
   },
 
-  finishStateInstalled: function(polledData) {
+  /**
+   * @param polledData Josn data retrieved from API
+   * @returns {boolean} Has "Start All Services" request completed successfully
+   */
+  isServicesStarted: function (polledData) {
     var clusterStatus = {};
-    if (!polledData.someProperty('Tasks.status', 'PENDING') &&
-        !polledData.someProperty('Tasks.status', 'QUEUED') &&
-        !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
+    if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
       this.set('progress', '100');
       clusterStatus = {
         status: 'INSTALLED',
@@ -608,19 +785,19 @@ App.WizardStep9Controller = Em.Controller.extend({
         clusterStatus.status = 'START FAILED'; // 'START FAILED' implies to step10 that installation was successful but start failed
       }
       App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
-      this.set('isStepCompleted', true);
-      this.setTasksPerHost();
       App.router.get(this.get('content.controllerName')).saveInstalledHosts(this);
       return true;
     }
     return false;
   },
 
-  finishStatePending: function(polledData) {
+  /**
+   * @param polledData Josn data retrieved from API
+   * @returns {boolean} Has "Install All Services" request completed successfully
+   */
+  isServicesInstalled: function (polledData) {
     var clusterStatus = {};
-    if (!polledData.someProperty('Tasks.status', 'PENDING') &&
-        !polledData.someProperty('Tasks.status', 'QUEUED') &&
-        !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
+    if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
       clusterStatus = {
         status: 'PENDING',
         requestId: this.get('content.cluster.requestId'),
@@ -629,37 +806,32 @@ App.WizardStep9Controller = Em.Controller.extend({
       if (this.get('status') === 'failed') {
         clusterStatus.status = 'INSTALL FAILED';
         this.set('progress', '100');
-        this.get('hosts').forEach(function(host){
-          host.get('status') != 'failed' ? host.set('message',Em.I18n.t('installer.step9.host.status.startAborted')) : null;
-          host.set('progress','100');
-        });
+        this.get('hosts').forEach(function (host) {
+          if (host.get('status') !== 'failed' && host.get('status') !== 'warning') {
+            this.isAllComponentsInstalled();
+          }
+          host.set('progress', '100');
+        }, this);
         App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
-        this.set('isStepCompleted', true);
       } else {
-        clusterStatus.status = 'INSTALLED';
         this.set('progress', '34');
-        this.launchStartServices();
+        if (this.get('content.controllerName') === 'installerController') {
+          this.isAllComponentsInstalled();
+        } else {
+          this.launchStartServices();
+        }
       }
-      this.setTasksPerHost();
       App.router.get(this.get('content.controllerName')).saveInstalledHosts(this);
       return true;
     }
     return false;
   },
 
-  setTasksPerHost: function () {
-    var tasksData = this.get('polledData');
-    this.get('hosts').forEach(function (_host) {
-      var tasksPerHost = tasksData.filterProperty('Tasks.host_name', _host.name); // retrieved from polled Data
-      if (tasksPerHost !== null && tasksPerHost !== undefined && tasksPerHost.length !== 0) {
-        tasksPerHost.forEach(function (_taskPerHost) {
-          _host.tasks.pushObject(_taskPerHost);
-        }, this);
-      }
-    }, this);
-  },
-
-  // This is done at HostRole level.
+  /**
+   * This is done at HostRole level.
+   * @param tasksPerHost {Array}
+   * @param host {Object}
+   */
   setLogTasksStatePerHost: function (tasksPerHost, host) {
     tasksPerHost.forEach(function (_task) {
       var task = host.logTasks.findProperty('Tasks.id', _task.Tasks.id);
@@ -672,6 +844,12 @@ App.WizardStep9Controller = Em.Controller.extend({
     }, this);
   },
 
+  /**
+   * Parses the Json data retrieved from API and sets the task on the host of {hosts} array binded to template
+   * @param polledData Json data retrieved from API
+   * @returns {Boolean} True if stage transition is completed.
+   * On true, polling will be stopped.
+   */
   parseHostInfo: function (polledData) {
     console.log('TRACE: Entering host info function');
     var self = this;
@@ -683,7 +861,7 @@ App.WizardStep9Controller = Em.Controller.extend({
     }
     var requestId = this.get('content.cluster.requestId');
     tasksData.setEach('Tasks.request_id', requestId);
-    if(polledData.Requests && polledData.Requests.id && polledData.Requests.id!=requestId){
+    if (polledData.Requests && polledData.Requests.id && polledData.Requests.id != requestId) {
       // We don't want to use non-current requestId's tasks data to
       // determine the current install status.
       // Also, we don't want to keep polling if it is not the
@@ -692,8 +870,8 @@ App.WizardStep9Controller = Em.Controller.extend({
     }
     this.replacePolledData(tasksData);
     var tasksHostMap = {};
-    tasksData.forEach(function(task){
-      if(tasksHostMap[task.Tasks.host_name]) {
+    tasksData.forEach(function (task) {
+      if (tasksHostMap[task.Tasks.host_name]) {
         tasksHostMap[task.Tasks.host_name].push(task);
       } else {
         tasksHostMap[task.Tasks.host_name] = [task];
@@ -703,15 +881,18 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.get('hosts').forEach(function (_host) {
       var actionsPerHost = tasksHostMap[_host.name] || []; // retrieved from polled Data
       if (actionsPerHost.length === 0) {
-        if(this.get('content.cluster.status') === 'PENDING') {
+        if (this.get('content.cluster.status') === 'PENDING' || this.get('content.cluster.status') === 'INSTALL FAILED') {
           _host.set('progress', '33');
+          _host.set('isNoTasksForInstall', true);
           _host.set('status', 'pending');
         }
-        if(this.get('content.cluster.status') === 'INSTALLED' || this.get('content.cluster.status') === 'FAILED') {
+        if (this.get('content.cluster.status') === 'INSTALLED' || this.get('content.cluster.status') === 'FAILED') {
           _host.set('progress', '100');
           _host.set('status', 'success');
         }
         console.log("INFO: No task is hosted on the host");
+      } else {
+        _host.set('isNoTasksForInstall', false);
       }
       this.setLogTasksStatePerHost(actionsPerHost, _host);
       this.onSuccessPerHost(actionsPerHost, _host);     // every action should be a success
@@ -730,11 +911,19 @@ App.WizardStep9Controller = Em.Controller.extend({
     return this.finishState(tasksData);
   },
 
+  /**
+   * starts polling to the API.
+   */
   startPolling: function () {
     this.set('isSubmitDisabled', true);
     this.doPolling();
   },
 
+  /**
+   *
+   * @param requestId {Int} Request Id received on triggering install/start command successfully
+   * @returns {string} URL to poll to track the result of the triggered command
+   */
   getUrl: function (requestId) {
     var clusterName = this.get('content.cluster.name');
     var requestId = requestId || this.get('content.cluster.requestId');
@@ -743,14 +932,18 @@ App.WizardStep9Controller = Em.Controller.extend({
     return url;
   },
 
-  loadLogData: function(requestId) {
+  /**
+   * This function calls API just once to fetch log data of all tasks.
+   * @param requestId {Int} Request Id received on triggering install/start command successfully
+   */
+  loadLogData: function (requestId) {
     var url = this.getUrl(requestId);
     var requestsId = this.get('wizardController').getDBProperty('cluster').oldRequestsId;
     if (App.testMode) {
       this.POLL_INTERVAL = 1;
     }
 
-    requestsId.forEach(function(requestId) {
+    requestsId.forEach(function (requestId) {
       url = this.getUrl(requestId);
       if (App.testMode) {
         this.POLL_INTERVAL = 1;
@@ -764,15 +957,17 @@ App.WizardStep9Controller = Em.Controller.extend({
    * <code>taskId</code> of current open task
    */
   currentOpenTaskId: 0,
+
   /**
    * {Number}
    * <code>requestId</code> of current open task
    */
   currentOpenTaskRequestId: 0,
+
   /**
    * Load form server <code>stderr, stdout</code> of current open task
    */
-  loadCurrentTaskLog: function() {
+  loadCurrentTaskLog: function () {
     var taskId = this.get('currentOpenTaskId');
     var requestId = this.get('currentOpenTaskRequestId');
     var clusterName = this.get('content.cluster.name');
@@ -794,7 +989,11 @@ App.WizardStep9Controller = Em.Controller.extend({
     });
   },
 
-  loadCurrentTaskLogSuccessCallback: function(data) {
+  /**
+   * success callback function for getting log data of the opened task
+   * @param data json object
+   */
+  loadCurrentTaskLogSuccessCallback: function (data) {
     var taskId = this.get('currentOpenTaskId');
     if (taskId) {
       var currentTask = this.get('hosts').findProperty('name', data.Tasks.host_name).get('logTasks').findProperty('Tasks.id', data.Tasks.id);
@@ -806,12 +1005,19 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.set('logTasksChangesCounter', this.get('logTasksChangesCounter') + 1);
   },
 
-  loadCurrentTaskLogErrorCallback: function() {
+  /**
+   * Error callback function for getting log data of the opened task
+   */
+  loadCurrentTaskLogErrorCallback: function () {
     this.set('currentOpenTaskId', 0);
   },
 
-  // polling: whether to continue polling for status or not
-  getLogsByRequest: function(url, polling){
+  /**
+   * Function polls the API to retrieve data for the request.
+   * @param url {string} url to poll
+   * @param polling  {Boolean} whether to continue polling for status or not
+   */
+  getLogsByRequest: function (url, polling) {
     var self = this;
     $.ajax({
       type: 'GET',
@@ -825,6 +1031,9 @@ App.WizardStep9Controller = Em.Controller.extend({
         console.log("TRACE: Step9 -> The value is: ", parsedData);
         var result = self.parseHostInfo(parsedData);
         if (!polling) {
+          if (self.get('content.cluster.status') === 'INSTALL FAILED') {
+            self.isAllComponentsInstalled();
+          }
           return;
         }
         if (result !== true) {
@@ -834,8 +1043,6 @@ App.WizardStep9Controller = Em.Controller.extend({
             }
             self.doPolling();
           }, self.POLL_INTERVAL);
-        } else {
-          self.stopPolling();
         }
       },
 
@@ -843,7 +1050,6 @@ App.WizardStep9Controller = Em.Controller.extend({
         console.log("TRACE: STep9 -> In error function for the GET logs data");
         console.log("TRACE: STep9 -> value of the url is: " + url);
         console.log("TRACE: STep9 -> error code status is: " + request.status);
-        self.stopPolling();
       },
 
       statusCode: require('data/statusCodes')
@@ -855,6 +1061,9 @@ App.WizardStep9Controller = Em.Controller.extend({
     );
   },
 
+  /**
+   * Delegates the function call to {getLogsByRequest} with appropriate params
+   */
   doPolling: function () {
     var url = this.getUrl();
 
@@ -866,20 +1075,105 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.getLogsByRequest(url, true);
   },
 
-  stopPolling: function () {
-    //TODO: uncomment following line after the hook up with the API call
-    // this.set('isStepCompleted',true);
+  /**
+   * Check that all components are in INSTALLED state before issuing start command
+   */
+  isAllComponentsInstalled: function () {
+    if (this.get('content.controllerName') !== 'installerController') {
+      return;
+    }
+    var name = 'wizard.step9.installer.get_host_status';
+    App.ajax.send({
+      name: name,
+      sender: this,
+      data: {
+        cluster: this.get('content.cluster.name')
+      },
+      success: 'isAllComponentsInstalledSuccessCallback',
+      error: 'isAllComponentsInstalledErrorCallback'
+    });
   },
 
-  submit: function () {
-    if (!this.get('isSubmitDisabled')) {
-      App.router.send('next');
+  /**
+   * Success callback function for API checking host state and host_components state.
+   * @param jsonData {Object}
+   */
+  isAllComponentsInstalledSuccessCallback: function (jsonData) {
+    var clusterStatus = {
+      status: 'INSTALL FAILED',
+      isStartError: true,
+      isCompleted: false
+    };
+    var hostsWithHeartbeatLost = [];
+    var hostComponents = jsonData.items.mapProperty('host_components');
+    jsonData.items.filterProperty('Hosts.host_state', 'HEARTBEAT_LOST').forEach(function (host) {
+      var hostComponentObj = {hostName: host.Hosts.host_name};
+      var componentArr = [];
+      host.host_components.forEach(function (_hostComponent) {
+        var componentName = App.format.role(_hostComponent.HostRoles.component_name);
+        componentArr.pushObject(componentName);
+      }, this);
+      hostComponentObj.componentNames = this.getComponentMessage(componentArr);
+      hostsWithHeartbeatLost.pushObject(hostComponentObj);
+    }, this);
+    this.set('hostsWithHeartbeatLost', hostsWithHeartbeatLost);
+    if (hostsWithHeartbeatLost.length) {
+      this.get('hosts').forEach(function (host) {
+        if (hostsWithHeartbeatLost.someProperty(('hostName'), host.get('name'))) {
+          host.set('status', 'heartbeat_lost');
+        } else if (host.get('status') !== 'failed' && host.get('status') !== 'warning') {
+          host.set('message', Em.I18n.t('installer.step9.host.status.startAborted'));
+        }
+        host.set('progress', '100');
+      });
+      this.set('progress', '100');
+      if (!App.testMode) {
+        App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
+      }
+    } else {
+      this.launchStartServices();
     }
+
   },
 
-  back: function () {
-    if (!this.get('isSubmitDisabled')) {
-      App.router.send('back');
-    }
+  /**
+   * Error callback function for API checking host state and host_components state
+   */
+  isAllComponentsInstalledErrorCallback: function () {
+    console.log("ERROR");
+    var clusterStatus = {
+      status: 'INSTALL FAILED',
+      isStartError: true,
+      isCompleted: false
+    };
+    this.set('progress', '100');
+    this.get('hosts').forEach(function (host) {
+      if (host.get('status') !== 'failed' && host.get('status') !== 'warning') {
+        host.set('message', Em.I18n.t('installer.step9.host.status.startAborted'));
+        host.set('progress', '100');
+      }
+    });
+    App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
+  },
+
+  /**
+   * @param componentArr {Array}  Array of components
+   * @returns {String} Formatted string of components to display on the UI.
+   */
+  getComponentMessage: function (componentArr) {
+    var label;
+    componentArr.forEach(function (_component) {
+      if (_component === componentArr[0]) {
+        label = _component;
+      } else if (_component !== componentArr[componentArr.length - 1]) {           // [clients.length - 1]
+        label = label + ' ' + _component;
+        if (_component !== componentArr[componentArr.length - 2]) {
+          label = label + ',';
+        }
+      } else {
+        label = label + ' ' + Em.I18n.t('and') + ' ' + _component;
+      }
+    }, this);
+    return label;
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 0516037..b71a45f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -53,6 +53,7 @@ Em.I18n.translations = {
 
   'common.access':'Access',
   'common.learnMore':'Learn more',
+  'common.showDetails':'Show Details',
   'common.back':'Back',
   'common.prev':'Prev',
   'common.next':'Next',
@@ -552,6 +553,11 @@ Em.I18n.translations = {
   'installer.step9.status.success':'Successfully installed and started the services.',
   'installer.step9.status.warning':'Installed and started the services with some warnings.',
   'installer.step9.status.failed':'Failed to install/start the services.',
+  'installer.step9.status.install.components.failed': 'Some service components are still not known to have installed successfully. Please Retry',
+  'installer.step9.status.hosts.heartbeat_lost': 'Ambari agent is not runnig on {0} host.',
+  'installer.step9.host.heartbeat_lost': 'Heartbeat lost for the host',
+  'installer.step9.host.heartbeat_lost_popup': 'Ambari agent process is not heartbeating on the host',
+  'installer.step9.host.heartbeat_lost.header' : 'Hosts with heartbeat lost',
   'installer.step9.host.status.success':'Success',
   'installer.step9.host.status.startAborted':'Install completed. Start aborted',
   'installer.step9.host.status.warning':'Warnings encountered',
@@ -568,6 +574,7 @@ Em.I18n.translations = {
   'installer.step9.hostLog.popup.categories.aborted':'Cancelled',
   'installer.step9.hostLog.popup.categories.timedout':'Timed Out',
   'installer.step9.hostLog.popup.noTasksToShow':'No tasks to show',
+  'installer.step9.host.status.noTasks': 'Ambari server did not schedule any tasks on the host. Either the service component on the host is already in installed state <b>OR</b> the pre-check of host reachability failed.',
   'installer.step9.overallProgress':'{0} % overall',
   'installer.step9.serviceStatus.install.pending':'Preparing to install ',
   'installer.step9.serviceStatus.install.queued':'Waiting to install ',
@@ -604,6 +611,7 @@ Em.I18n.translations = {
   'installer.step9.serviceStatus.upgrade.inProgress':'Upgrading ',
   'installer.step9.serviceStatus.upgrade.completed':' upgraded successfully',
   'installer.step9.serviceStatus.upgrade.failed':' failed to upgrade',
+  'installer.step9.components.install.failed': 'Installation Failure',
 
   'installer.step10.header':'Summary',
   'installer.step10.body':'Here is the summary of the install process.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/templates/wizard/step9.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step9.hbs b/ambari-web/app/templates/wizard/step9.hbs
index eff8425..ba30a0a 100644
--- a/ambari-web/app/templates/wizard/step9.hbs
+++ b/ambari-web/app/templates/wizard/step9.hbs
@@ -21,12 +21,10 @@
   <h2>{{t installer.step9.header}}</h2>
 
   <p class="alert alert-info">{{t installer.step9.body}}</p>
-
   <div id="overallProgress">
-    {{view.isStepCompleted}}
     <div class="row-fluid">
       <div class="span10">
-        <div {{bindAttr class="isStepCompleted::progress-striped isStepCompleted::active view.barColor :progress"}}>
+        <div {{bindAttr class="view.isStepCompleted::progress-striped view.isStepCompleted::active view.barColor :progress"}}>
           <div class="bar" {{bindAttr style="view.barWidth"}}>
           </div>
         </div>
@@ -116,7 +114,11 @@
 
   <div>
     {{#if view.resultMsg}}
-    <p {{bindAttr class="view.resultMsgColor :alert"}}>{{view.resultMsg}}</p>
+      <p {{bindAttr class="view.resultMsgColor :alert"}}>{{view.resultMsg}}
+      {{#if view.isHostHeartbeatLost}}
+        <a href="javascript:void(null)" data-toggle="modal" {{action hostWithInstallFailed target="view"}}>{{t common.showDetails}}</a>
+      {{/if}}
+      </p>
     {{/if}}
     <div class="btn-area">
       <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action submit target="controller"}}>{{t common.next}} &rarr;</a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs b/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
index c74d64e..2671bbb 100644
--- a/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
+++ b/ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
@@ -15,60 +15,76 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-<div {{bindAttr class="view.isLogWrapHidden::hidden :task-list-main-warp"}}>
-  <div class="task-top-wrap">
-    <div class="task-name-top task-detail-log-rolename">{{t common.tasks}}</div>
-    <div class="select-wrap">
-      {{t common.show}}:
-      {{view Ember.Select
-        contentBinding="view.categories"
-        optionValuePath="content.value"
-        optionLabelPath="content.label"
-        selectionBinding="view.category"
-      }}
-    </div>
+
+{{#if view.isHeartbeatLost}}
+  <div>
+    {{t installer.step9.host.heartbeat_lost_popup}}
   </div>
-  <div id="host-log">
-    {{#each taskInfo in view.tasks}}
-      <div {{bindAttr class="taskInfo.isVisible::hidden :log-list-wrap"}}>
-        <div {{action toggleTaskLog taskInfo}} class="task-list-line-cursor">
-          <div class="operation-name-icon-wrap">
-            <i {{bindAttr class="taskInfo.status taskInfo.icon"}}></i>
-            <a href="#">
-              {{taskInfo.role}} {{taskInfo.command}}
-            </a>
-          </div>
-          <div class="show-details"><i class="icon-caret-right"></i></div>
+{{else}}
+  {{#if view.isNoTasksScheduled}}
+    {{t installer.step9.host.status.noTasks}}
+  {{else}}
+    <div {{bindAttr class="view.isLogWrapHidden::hidden :task-list-main-warp"}}>
+      <div class="task-top-wrap">
+        <div class="task-name-top task-detail-log-rolename">{{t common.tasks}}</div>
+        <div class="select-wrap">
+          {{t common.show}}:
+          {{view Ember.Select
+          contentBinding="view.categories"
+          optionValuePath="content.value"
+          optionLabelPath="content.label"
+          selectionBinding="view.category"
+          }}
         </div>
       </div>
-    {{/each}}
-    {{#if view.isEmptyList}}
-      <div class="log-list-wrap">{{t installer.step9.hostLog.popup.noTasksToShow}}</div>
-    {{/if}}
-  </div>
-</div>
-
-<div {{bindAttr class="view.isLogWrapHidden:hidden :task-detail-info"}}>
-  <div class="task-top-wrap">
-    <a class="task-detail-back" href="javascript:void(null)" {{action backToTaskList}} ><i class="icon-arrow-left"></i>&nbsp;{{t common.tasks}}</a>
-    <div>
-      <i {{bindAttr class="view.openedTask.status :task-detail-status-ico view.openedTask.icon"}} class="task-detail-status-ico"></i>
-      <span class="task-detail-log-rolename" >{{view.openedTask.role}} {{view.openedTask.command}}</span>
-    </div>
-    <div class="task-detail-ico-wrap">
-      <a title="Click to Copy" {{action "textTrigger" taskInfo target="view"}} class="task-detail-copy"><i class="icon-copy"></i> {{t common.copy}}</a>
-      <a title="Open in New Window" {{action openTaskLogInDialog}} class="task-detail-open-dialog"><i class="icon-external-link"></i> {{t common.open}}</a>
+      <div id="host-log">
+        {{#each taskInfo in view.tasks}}
+          <div {{bindAttr class="taskInfo.isVisible::hidden :log-list-wrap"}}>
+            <div {{action toggleTaskLog taskInfo}} class="task-list-line-cursor">
+              <div class="operation-name-icon-wrap">
+                <i {{bindAttr class="taskInfo.status taskInfo.icon"}}></i>
+                <a href="#">
+                  {{taskInfo.role}} {{taskInfo.command}}
+                </a>
+              </div>
+              <div class="show-details"><i class="icon-caret-right"></i></div>
+            </div>
+          </div>
+        {{/each}}
+        {{#if view.isEmptyList}}
+          <div class="log-list-wrap">{{t installer.step9.hostLog.popup.noTasksToShow}}</div>
+        {{/if}}
+      </div>
     </div>
-  </div>
-  <div class="task-detail-log-info">
-    <div class="content-area" >
-      <div class="task-detail-log-clipboard-wrap" ></div>
-      <div class="task-detail-log-maintext">
-        <h5>stderr: &nbsp; <span class="muted">{{view.openedTask.errorLog}} </span></h5>
-        <pre class="stderr">{{view.openedTask.stderr}}</pre>
-        <h5>stdout: &nbsp; <span class="muted"> {{view.openedTask.outputLog}} </span> </h5>
-        <pre class="stdout">{{view.openedTask.stdout}}</pre>
+
+    <div {{bindAttr class="view.isLogWrapHidden:hidden :task-detail-info"}}>
+      <div class="task-top-wrap">
+        <a class="task-detail-back" href="javascript:void(null)" {{action backToTaskList}} ><i
+                class="icon-arrow-left"></i>&nbsp;{{t common.tasks}}</a>
+
+        <div>
+          <i {{bindAttr class="view.openedTask.status :task-detail-status-ico view.openedTask.icon"}}
+                  class="task-detail-status-ico"></i>
+          <span class="task-detail-log-rolename">{{view.openedTask.role}} {{view.openedTask.command}}</span>
+        </div>
+        <div class="task-detail-ico-wrap">
+          <a title="Click to Copy" {{action "textTrigger" taskInfo target="view"}} class="task-detail-copy"><i
+                  class="icon-copy"></i> {{t common.copy}}</a>
+          <a title="Open in New Window" {{action openTaskLogInDialog}} class="task-detail-open-dialog"><i
+                  class="icon-external-link"></i> {{t common.open}}</a>
+        </div>
+      </div>
+      <div class="task-detail-log-info">
+        <div class="content-area">
+          <div class="task-detail-log-clipboard-wrap"></div>
+          <div class="task-detail-log-maintext">
+            <h5>stderr: &nbsp; <span class="muted">{{view.openedTask.errorLog}} </span></h5>
+            <pre class="stderr">{{view.openedTask.stderr}}</pre>
+            <h5>stdout: &nbsp; <span class="muted"> {{view.openedTask.outputLog}} </span></h5>
+            <pre class="stdout">{{view.openedTask.stdout}}</pre>
+          </div>
+        </div>
       </div>
     </div>
-  </div>
-</div>
\ No newline at end of file
+  {{/if}}
+{{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/templates/wizard/step9_install_host_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step9_install_host_popup.hbs b/ambari-web/app/templates/wizard/step9_install_host_popup.hbs
new file mode 100644
index 0000000..5da8642
--- /dev/null
+++ b/ambari-web/app/templates/wizard/step9_install_host_popup.hbs
@@ -0,0 +1,40 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="install-fail-popup" class="pre-scrollable">
+  <table class="table table-striped">
+    <thead>
+    <tr>
+      <th class="span3">{{t common.host}}</th>
+      <th class="span3">{{t common.components}}</th>
+    </tr>
+    </thead>
+    <tbody>
+  {{#each host in view.failedHosts}}
+    <tr>
+      <td>
+        {{host.hostName}}
+      </td>
+      <td>
+        {{host.componentNames}}
+      </td>
+    </tr>
+  {{/each}}
+    </tbody>
+  </table>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 15b86d8..a4ef34e 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -1177,6 +1177,15 @@ var urls = {
       };
     }
   },
+  'wizard.step9.installer.get_host_status': {
+    'real': '/clusters/{cluster}/hosts?fields=Hosts/host_state,host_components/HostRoles/state',
+    'mock': '/data/wizard/deploy/5_hosts/get_host_status.json',
+    'format': function (data, opt) {
+      return {
+        async: false
+      };
+    }
+  },
   'wizard.step9.installer.launch_start_services': {
     'real': '/clusters/{cluster}/services?ServiceInfo/state=INSTALLED&params/run_smoke_test=true&params/reconfigure_client=false',
     'mock': '/data/wizard/deploy/5_hosts/poll_6.json',

http://git-wip-us.apache.org/repos/asf/ambari/blob/d79be110/ambari-web/app/views/wizard/step9_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step9_view.js b/ambari-web/app/views/wizard/step9_view.js
index 1099d99..17838c7 100644
--- a/ambari-web/app/views/wizard/step9_view.js
+++ b/ambari-web/app/views/wizard/step9_view.js
@@ -21,28 +21,35 @@ var date = require('utils/date');
 
 App.WizardStep9View = Em.View.extend({
 
-  templateName:require('templates/wizard/step9'),
-  barColor:'',
-  resultMsg:'',
-  resultMsgColor:'',
+  templateName: require('templates/wizard/step9'),
+  barColor: '',
+  resultMsg: '',
+  resultMsgColor: '',
+  isStepCompleted: function() {
+   return (this.get('controller.progress') === '100');
+  }.property('controller.progress'),
 
-  didInsertElement:function () {
+  didInsertElement: function () {
     var controller = this.get('controller');
     this.get('controller.hosts').setEach('status', 'info');
     this.onStatus();
     controller.navigateStep();
   },
 
-  barWidth:function () {
+  isHostHeartbeatLost: function () {
+    return (this.get('controller.hostsWithHeartbeatLost').length > 0);
+  }.property('controller.hostsWithHeartbeatLost.@each'),
+
+  barWidth: function () {
     var controller = this.get('controller');
     return 'width: ' + controller.get('progress') + '%;';
   }.property('controller.progress'),
 
-  progressMessage: function() {
+  progressMessage: function () {
     return Em.I18n.t('installer.step9.overallProgress').format(this.get('controller.progress'));
   }.property('controller.progress'),
 
-  onStatus:function () {
+  onStatus: function () {
     if (this.get('controller.status') === 'info') {
       this.set('resultMsg', '');
       this.set('barColor', 'progress-info');
@@ -52,16 +59,41 @@ App.WizardStep9View = Em.View.extend({
       this.set('resultMsgColor', 'alert-warning');
     } else if (this.get('controller.status') === 'failed') {
       this.set('barColor', 'progress-danger');
-      console.log('TRACE: Inside error view step9');
-      this.set('resultMsg', Em.I18n.t('installer.step9.status.failed'));
       this.set('resultMsgColor', 'alert-error');
+      console.log('TRACE: Inside error view step9');
+      if (this.get('isHostHeartbeatLost')) {
+        // When present requests succeeds but some host components are in UNKNOWN or INSTALL_FAILED state and
+        // hosts are in HEARTBEAT_LOST state
+        this.set('resultMsg', Em.I18n.t('installer.step9.status.hosts.heartbeat_lost').format(this.get('controller.hostsWithHeartbeatLost').length));
+      } else {
+        this.set('resultMsg', Em.I18n.t('installer.step9.status.failed'));
+      }
     } else if (this.get('controller.status') === 'success') {
       console.log('TRACE: Inside success view step9');
       this.set('barColor', 'progress-success');
       this.set('resultMsg', Em.I18n.t('installer.step9.status.success'));
       this.set('resultMsgColor', 'alert-success');
     }
-  }.observes('controller.status')
+  }.observes('controller.status', 'isHostHeartbeatLost'),
+
+
+  hostWithInstallFailed: function (event, context) {
+    var controller = this.get('controller');
+    App.ModalPopup.show({
+      header: Em.I18n.t('installer.step9.host.heartbeat_lost.header'),
+      classNames: ['sixty-percent-width-modal'],
+      autoHeight: false,
+      secondary: null,
+
+      bodyClass: Ember.View.extend({
+        templateName: require('templates/wizard/step9_install_host_popup'),
+        c: controller,
+        failedHosts: function () {
+          return controller.get('hostsWithHeartbeatLost');
+        }.property()
+      })
+    });
+  }
 });
 
 App.HostStatusView = Em.View.extend({
@@ -76,15 +108,15 @@ App.HostStatusView = Em.View.extend({
   controller: null,
   barColor: '',
 
-  didInsertElement:function () {
+  didInsertElement: function () {
     this.onStatus();
   },
 
-  barWidth:function () {
+  barWidth: function () {
     return 'width: ' + this.get('obj.progress') + '%;';
   }.property('obj.progress'),
 
-  onStatus:function () {
+  onStatus: function () {
     if (this.get('obj.status') === 'info') {
       this.set('barColor', 'progress-info');
     } else if (this.get('obj.status') === 'warning') {
@@ -97,31 +129,34 @@ App.HostStatusView = Em.View.extend({
       if (this.get('obj.progress') === '100') {
         this.set('obj.message', Em.I18n.t('installer.step9.host.status.failed'));
       }
-    } else {
-      if (this.get('obj.status') === 'success' && this.get('isHostCompleted') && parseInt(this.get('controller.progress')) > 34) {
+    } else if (this.get('obj.status') === 'heartbeat_lost') {
+      this.set('barColor', 'progress-danger');
+      if (this.get('obj.progress') === '100') {
+        this.set('obj.message', Em.I18n.t('installer.step9.host.heartbeat_lost'));
+      }
+    } else if (this.get('obj.status') === 'success' && this.get('isHostCompleted') && parseInt(this.get('controller.progress')) > 34) {
         this.set('barColor', 'progress-success');
         this.set('obj.message', Em.I18n.t('installer.step9.host.status.success'));
-      }
     }
   }.observes('obj.status', 'obj.progress', 'controller.progress'),
 
-  isFailed:function () {
-    return (this.get('isHostCompleted') && this.get('obj.status') === 'failed');
+  isFailed: function () {
+    return (this.get('isHostCompleted') && (this.get('obj.status') === 'failed' || this.get('obj.status') === 'heartbeat_lost'));
   }.property('obj.status', 'isHostCompleted'),
 
-  isSuccess:function () {
+  isSuccess: function () {
     return (this.get('isHostCompleted') && this.get('obj.status') === 'success');
   }.property('obj.status', 'isHostCompleted'),
 
-  isWarning:function () {
+  isWarning: function () {
     return(this.get('isHostCompleted') && this.get('obj.status') === 'warning');
   }.property('obj.status', 'isHostCompleted'),
 
-  isHostCompleted:function () {
+  isHostCompleted: function () {
     return this.get('obj.progress') == 100;
   }.property('obj.progress'),
 
-  hostLogPopup:function (event, context) {
+  hostLogPopup: function (event, context) {
     var controller = this.get('controller');
     var host = this.get('obj');
 
@@ -129,7 +164,7 @@ App.HostStatusView = Em.View.extend({
       header: host.get('name'),
       classNames: ['sixty-percent-width-modal'],
       autoHeight: false,
-      secondary:null,
+      secondary: null,
       /**
        * Current host
        */
@@ -139,13 +174,19 @@ App.HostStatusView = Em.View.extend({
        */
       c: controller,
 
-      onClose: function() {
+      onClose: function () {
         this.set('c.currentOpenTaskId', 0);
         this.hide();
       },
 
-      bodyClass:Ember.View.extend({
-        templateName:require('templates/wizard/step9HostTasksLogPopup'),
+      bodyClass: Ember.View.extend({
+        templateName: require('templates/wizard/step9HostTasksLogPopup'),
+        isHeartbeatLost: function() {
+          return (host.get('status') === 'heartbeat_lost');
+        }.property('host.status'),
+        isNoTasksScheduled: function() {
+          return host.get('isNoTasksForInstall');
+        }.property('host.isNoTasksForInstall'),
 
         isLogWrapHidden: true,
 
@@ -190,13 +231,13 @@ App.HostStatusView = Em.View.extend({
         }.observes('category', 'tasks'),
 
         categories: [
-            Ember.Object.create({value: 'all', label: Em.I18n.t('installer.step9.hostLog.popup.categories.all') }),
-            Ember.Object.create({value: 'pending', label: Em.I18n.t('installer.step9.hostLog.popup.categories.pending')}),
-            Ember.Object.create({value: 'in_progress', label: Em.I18n.t('installer.step9.hostLog.popup.categories.in_progress')}),
-            Ember.Object.create({value: 'failed', label: Em.I18n.t('installer.step9.hostLog.popup.categories.failed') }),
-            Ember.Object.create({value: 'completed', label: Em.I18n.t('installer.step9.hostLog.popup.categories.completed') }),
-            Ember.Object.create({value: 'aborted', label: Em.I18n.t('installer.step9.hostLog.popup.categories.aborted') }),
-            Ember.Object.create({value: 'timedout', label: Em.I18n.t('installer.step9.hostLog.popup.categories.timedout') })
+          Ember.Object.create({value: 'all', label: Em.I18n.t('installer.step9.hostLog.popup.categories.all') }),
+          Ember.Object.create({value: 'pending', label: Em.I18n.t('installer.step9.hostLog.popup.categories.pending')}),
+          Ember.Object.create({value: 'in_progress', label: Em.I18n.t('installer.step9.hostLog.popup.categories.in_progress')}),
+          Ember.Object.create({value: 'failed', label: Em.I18n.t('installer.step9.hostLog.popup.categories.failed') }),
+          Ember.Object.create({value: 'completed', label: Em.I18n.t('installer.step9.hostLog.popup.categories.completed') }),
+          Ember.Object.create({value: 'aborted', label: Em.I18n.t('installer.step9.hostLog.popup.categories.aborted') }),
+          Ember.Object.create({value: 'timedout', label: Em.I18n.t('installer.step9.hostLog.popup.categories.timedout') })
         ],
 
         category: null,
@@ -205,7 +246,7 @@ App.HostStatusView = Em.View.extend({
           var tasksArr = [];
           var host = this.get('parentView.host');
           var tasks = this.getStartedTasks(host);
-          tasks = tasks.sort(function(a,b){
+          tasks = tasks.sort(function (a, b) {
             return a.Tasks.id - b.Tasks.id;
           });
           if (tasks.length) {
@@ -244,25 +285,25 @@ App.HostStatusView = Em.View.extend({
           return tasksArr;
         }.property('parentView.c.logTasksChangesCounter'),
 
-        backToTaskList: function(event, context) {
+        backToTaskList: function (event, context) {
           this.destroyClipBoard();
-          this.set("isLogWrapHidden",true);
+          this.set("isLogWrapHidden", true);
         },
 
-        getStartedTasks:function (host) {
+        getStartedTasks: function (host) {
           return host.logTasks.filter(function (task) {
             return task.Tasks.status;
           });
         },
 
-        openTaskLogInDialog: function(){
-          var newwindow=window.open();
-          var newdocument=newwindow.document;
+        openTaskLogInDialog: function () {
+          var newwindow = window.open();
+          var newdocument = newwindow.document;
           newdocument.write($(".task-detail-log-info").html());
           newdocument.close();
         },
 
-        openedTask: function() {
+        openedTask: function () {
           return this.get('tasks').findProperty('id', this.get('parentView.c.currentOpenTaskId'))
         }.property('parentView.c.currentOpenTaskId', 'tasks.@each'),
 
@@ -283,8 +324,8 @@ App.HostStatusView = Em.View.extend({
           }
         },
 
-        textTrigger:function (event) {
-          if($(".task-detail-log-clipboard").length > 0) {
+        textTrigger: function (event) {
+          if ($(".task-detail-log-clipboard").length > 0) {
             this.destroyClipBoard();
           }
           else {
@@ -292,21 +333,21 @@ App.HostStatusView = Em.View.extend({
           }
         },
 
-        createClipBoard:function() {
+        createClipBoard: function () {
           var log = $(".task-detail-log-maintext");
           $(".task-detail-log-clipboard-wrap").html('<textarea class="task-detail-log-clipboard"></textarea>');
           $(".task-detail-log-clipboard")
-              .html("stderr: \n"+$(".stderr").html()+"\n stdout:\n"+$(".stdout").html())
-              .css("display","block")
-              .width(log.width())
-              .height(log.height())
-              .select();
-          log.css("display","none")
+            .html("stderr: \n" + $(".stderr").html() + "\n stdout:\n" + $(".stdout").html())
+            .css("display", "block")
+            .width(log.width())
+            .height(log.height())
+            .select();
+          log.css("display", "none")
         },
 
-        destroyClipBoard:function(){
+        destroyClipBoard: function () {
           $(".task-detail-log-clipboard").remove();
-          $(".task-detail-log-maintext").css("display","block");
+          $(".task-detail-log-maintext").css("display", "block");
         }
       })
     });