private void startConsolidation() throws Exception {
		// get list of vHosts with their cpu_usage
		Map<String, HostSystem> vHostList = vhostMonitor.getHostAsPerUsage();
		boolean valueSet = true;
		if (vHostList != null && !vHostList.isEmpty()) {
			// identify vHost whose VMs need to be migrated
			if(shouldStart)
			{
			HostSystem leastUsageHost = vHostList.get((vHostList.keySet()
					.toArray()[0]));
			VirtualMachine[] vms = leastUsageHost.getVms();

			// now start migrating the above VMs to second host
			for (int i = 0; i < vms.length; i++) {
				VirtualMachine vm = vms[i];
				HostSystem newHost = vHostList.get((vHostList.keySet()
						.toArray()[1]));

				System.out.println(newHost.getName());
				ComputeResource cr = (ComputeResource) newHost.getParent();

				String[] checks = new String[] { "cpu", "software" };
				HostVMotionCompatibility[] vmcs = si.queryVMotionCompatibility(
						vm, new HostSystem[] { newHost }, checks);

				String[] comps = vmcs[0].getCompatibility();
				if (checks.length != comps.length) {
					System.out.println("CPU/software NOT compatible. Exit.");
					valueSet = false;
				}

				if (valueSet) {
					Task task = null;
					if (VirtualMachinePowerState.poweredOn.equals(vm
							.getRuntime().getPowerState())) {
						// live migration
						System.out
								.println("Live Migration of: " + vm.getName());
						task = vm.migrateVM_Task(cr.getResourcePool(), newHost,
								VirtualMachineMovePriority.highPriority,
								VirtualMachinePowerState.poweredOn);
					} else {
						// cold migration
						System.out
								.println("Cold Migration of: " + vm.getName());
						task = vm.migrateVM_Task(cr.getResourcePool(), newHost,
								VirtualMachineMovePriority.highPriority,
								VirtualMachinePowerState.poweredOff);
					}

					if (task.waitForTask() == Task.SUCCESS) {
						System.out.println("VM Migrated Successfully..!");

					}
				}
			}
			// delete the leastUsageHost
			ComputeResource cr = (ComputeResource) vHostList.get(
					(vHostList.keySet().toArray()[0])).getParent();
			System.out.println("Entering the delete phase of host "
					+ vHostList.get((vHostList.keySet().toArray()[0]))
							.getName());
			Task task = cr.destroy_Task();
			if (task.waitForTask() == Task.SUCCESS) {
				System.out.println("Deleted ");
			}
			}
			else
			{
				System.out.println("Usage for all vHosts above 30%. DPM not necessary");
			}
		} else {
			System.out.println("No need to perform DPM");
		}
	}