You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (CollectionUtils.isEmpty(vmVolumes) || vmVolumes.get(0).getInstanceId() == null) {
830
+
s_logger.error(String.format("Failed to create VolumeInfo of VM [id: null] volumes due to: [%s].", e.getMessage()), e);
831
+
} else {
832
+
s_logger.error(String.format("Failed to create VolumeInfo of VM [id: %s] volumes due to: [%s].", vmVolumes.get(0).getInstanceId(), e.getMessage()), e);
833
+
}
834
+
throwe;
835
+
}
836
+
}
837
+
815
838
/**
816
839
* Get physical network ID from zoneId and Vmware label
s_logger.debug(String.format("Marking volume [id: %s] of VM [%s] as removed for the backup process.", backedUpVol.getUuid(), ReflectionToStringBuilderUtils.reflectOnlySelectedFields(vm, "uuid", "instanceName")));
if ((vm.getBackupOfferingId() == null || CollectionUtils.isEmpty(vm.getBackupVolumeList())) || BooleanUtils.isTrue(BackupManager.BackupEnableAttachDetachVolumes.value())) {
2483
+
return;
2484
+
}
2485
+
StringerrorMsg = String.format("Unable to detach volume, cannot detach volume from a VM that has backups. First remove the VM from the backup offering or "
2486
+
+ "set the global configuration '%s' to true.", BackupManager.BackupEnableAttachDetachVolumes.key());
2487
+
if (attach) {
2488
+
errorMsg = String.format("Unable to attach volume, please specify a VM that does not have any backups or set the global configuration "
2489
+
+ "'%s' to true.", BackupManager.BackupEnableAttachDetachVolumes.key());
if (CollectionUtils.isEmpty(vmVolumes) || vmVolumes.get(0).getInstanceId() == null) {
2503
+
s_logger.error(String.format("Failed to create VolumeInfo of VM [id: null] volumes due to: [%s].", e.getMessage()), e);
2504
+
} else {
2505
+
s_logger.error(String.format("Failed to create VolumeInfo of VM [id: %s] volumes due to: [%s].", vmVolumes.get(0).getInstanceId(), e.getMessage()), e);
thrownewInvalidParameterValueException("Unable to detach volume, please specify a VM that does not have VM snapshots");
2654
2685
}
2655
2686
2656
-
if (vm.getBackupOfferingId() != null || vm.getBackupVolumeList().size() > 0) {
2657
-
thrownewInvalidParameterValueException("Unable to detach volume, cannot detach volume from a VM that has backups. First remove the VM from the backup offering.");
0 commit comments