sureshanaparti commented on code in PR #10560:
URL: https://github.com/apache/cloudstack/pull/10560#discussion_r1998161519
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -1477,6 +1478,16 @@ private Pair<List<Long>, Integer>
searchForUserVMIdsAndCount(ListVMsCmd cmd) {
userVmSearchBuilder.join("tags", resourceTagSearch,
resourceTagSearch.entity().getResourceId(),
userVmSearchBuilder.entity().getId(), JoinBuilder.JoinType.INNER);
}
+ if (cmd.getOnlyLeasedInstances() != null &&
cmd.getOnlyLeasedInstances()) {
+ if (VMLeaseManagerImpl.InstanceLeaseEnabled.value()) {
+ SearchBuilder<UserVmDetailVO> leasedInstancesSearch =
userVmDetailsDao.createSearchBuilder();
+
leasedInstancesSearch.and(leasedInstancesSearch.entity().getName(),
SearchCriteria.Op.EQ).values(VmDetailConstants.INSTANCE_LEASE_EXPIRY_DATE);
+ userVmSearchBuilder.join("userVmToLeased",
leasedInstancesSearch, leasedInstancesSearch.entity().getResourceId(),
userVmSearchBuilder.entity().getId(), JoinBuilder.JoinType.INNER);
+ } else {
+ logger.warn("Lease feature is not enabled, onlyleasedinstances
will be considered as false");
Review Comment:
When _onlyleasedinstances_ is passed as true, better communicate this msg to
the user.
--
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]