throws Exception {
FSNamesystem namesystem = cluster.getNameNode().namesystem;
for (DataNode node : cluster.getDataNodes()) {
// Get old descriptor.
DatanodeID dnId = createDataNodeID(node);
DatanodeDescriptor dnDs = namesystem.getDatanode(dnId);
// Create new id and descriptor.
DatanodeID newId = new DatanodeID(node.getMachineName(),
dnDs.getStorageID(), dnDs.getInfoPort(), dnDs.getIpcPort());
DatanodeDescriptor newDS = new DatanodeDescriptor(newId,
dnDs.getNetworkLocation(), dnDs.getHostName(), dnDs.getCapacity(),
dnDs.getDfsUsed(), dnDs.getRemaining(), dnDs.getNamespaceUsed(),
dnDs.getXceiverCount());
newDS.isAlive = true;