logger.info("Nodes needed to be set password: " + ipsOfNodes.toString());
boolean succeed = true;
List<Callable<Void>> storeProcedures = new ArrayList<Callable<Void>>();
for (NodeEntity node : nodes) {
SetVMPasswordSP setVMPasswordSP = new SetVMPasswordSP(node, password);
storeProcedures.add(setVMPasswordSP);
clusterEntityMgr.updateNodeAction(node, Constants.NODE_ACTION_SETTING_PASSWORD);
}
AuAssert.check(!storeProcedures.isEmpty());
try {
Callable<Void>[] storeProceduresArray =
storeProcedures.toArray(new Callable[0]);
NoProgressUpdateCallback callback = new NoProgressUpdateCallback();
ExecutionResult[] result =
Scheduler
.executeStoredProcedures(
com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,
storeProceduresArray, callback);
for (int i = 0; i < storeProceduresArray.length; i++) {
SetVMPasswordSP sp = (SetVMPasswordSP) storeProceduresArray[i];
NodeEntity node = sp.getNodeEntity();
String vmNameWithIP = node.getVmNameWithIP();
if (result[i].finished && result[i].throwable == null) {
updateNodeData(node, true, null, null);
logger.info("Set password store procedure succeed for "
+ vmNameWithIP);