Pearl1594 commented on code in PR #13125:
URL: https://github.com/apache/cloudstack/pull/13125#discussion_r3203493628
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -7660,11 +7660,27 @@ private boolean isImplicitPlannerUsedByOffering(long
offeringId) {
protected boolean isAnyVmVolumeUsingLocalStorage(final List<VolumeVO>
volumes) {
for (VolumeVO vol : volumes) {
+ if (vol == null || vol.getRemoved() != null ||
+ Volume.State.Destroy.equals(vol.getState()) ||
+ Volume.State.Expunged.equals(vol.getState())) {
+ logger.debug("Skipping non-active volume while checking local
storage usage: {}", vol);
+ continue;
+ }
Review Comment:
I'm wondering if it would rather be better to have a method is the VolumeDao
to only return the active / non-removed volumes of a VM. To avoid the filtering
here. Just a thought - that way we can reuse the logic in future as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]