+ boolean isValid = false;
+ String msg = null;
+ config.setProperty(Constants.PROPERTY_RETRY_DELAY, "10");
+ config.setProperty(Constants.PROPERTY_RETRY_LIMIT, "30");
+ while (rc.attempt()) {
+ Map<String, String> map = ser.getAttachments(vm);
+ if (map != null && !(map.isEmpty())) {
+ Iterator<Entry<String, String>> it = map.entrySet().iterator();
+ logger.info("volumes available after attach ");
+ while (it.hasNext()) {
+ Map.Entry volumes = (Map.Entry) it.next();
+ logger.info(" devices " + volumes.getKey() + "volumes" + volumes.getValue());
+ if (volumes.getKey().equals(device) && (volumes.getValue().equals(volumeId))) {
+ logger.info("Device" + volumes.getKey() + "Volume" + volumes.getValue());
+ isValid = true;
+ break;
+ }
+ }
+ if (isValid) {
+ logger.info("AttachVolume" + rc.getAttempts() + "No.of attempts");
+ break;
+ } else {
+ rc.delay();
+ }
+ }
+ }
+ if ((rc.getAttempts() == 30) && (!isValid)) {
+
+ msg = EELFResourceManager.format(Msg.CONNECTION_FAILED_RETRY, Long.toString(rc.getRetryDelay()),
+ Integer.toString(rc.getAttempts()), Integer.toString(rc.getRetryLimit()));
+ logger.error(msg);
+ throw new TimeoutException(msg);