You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2017/02/23 06:39:24 UTC

[1/4] git commit: updated refs/heads/master to cd68e99

Repository: cloudstack
Updated Branches:
  refs/heads/master bb274a186 -> cd68e9914


CLOUDSTACK-8856 Primary Storage Used(type tag with value 2) related tag is not showing in listCapacity api response.

Conflicts:
	server/src/com/cloud/server/ManagementServerImpl.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bddd7c61
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bddd7c61
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bddd7c61

Branch: refs/heads/master
Commit: bddd7c61a7217fbb7034c800eb7c62658ed6c2ee
Parents: f279840
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Dec 15 16:17:12 2014 +0530
Committer: Bharat Kumar <bh...@accelerite.com>
Committed: Fri Dec 9 15:42:22 2016 +0530

----------------------------------------------------------------------
 .../com/cloud/server/ManagementServerImpl.java  | 38 ++++++++++++--------
 1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bddd7c61/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index b6a2637..e647d69 100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2450,7 +2450,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             }
         }
 
-        final List<SummedCapacity> summedCapacitiesForSecStorage = getSecStorageUsed(zoneId, capacityType);
+        List<SummedCapacity> summedCapacitiesForSecStorage = getStorageUsed(clusterId, podId, zoneId, capacityType);
         if (summedCapacitiesForSecStorage != null) {
             summedCapacities.addAll(summedCapacitiesForSecStorage);
         }
@@ -2488,7 +2488,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         return capacities;
     }
 
-    List<SummedCapacity> getSecStorageUsed(final Long zoneId, final Integer capacityType) {
+    List<SummedCapacity> getStorageUsed(Long clusterId, Long podId, Long zoneId, Integer capacityType) {
         if (capacityType == null || capacityType == Capacity.CAPACITY_TYPE_SECONDARY_STORAGE) {
             final List<SummedCapacity> list = new ArrayList<SummedCapacity>();
             if (zoneId != null) {
@@ -2496,19 +2496,10 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
                 if (zone == null || zone.getAllocationState() == AllocationState.Disabled) {
                     return null;
                 }
-                final CapacityVO capacity = _storageMgr.getSecondaryStorageUsedStats(null, zoneId);
-                if (capacity.getTotalCapacity() != 0) {
-                    capacity.setUsedPercentage(capacity.getUsedCapacity() / capacity.getTotalCapacity());
-                } else {
-                    capacity.setUsedPercentage(0);
-                }
-                final SummedCapacity summedCapacity = new SummedCapacity(capacity.getUsedCapacity(), capacity.getTotalCapacity(), capacity.getUsedPercentage(),
-                        capacity.getCapacityType(), capacity.getDataCenterId(), capacity.getPodId(), capacity.getClusterId());
-                list.add(summedCapacity);
-            } else {
-                final List<DataCenterVO> dcList = _dcDao.listEnabledZones();
-                for (final DataCenterVO dc : dcList) {
-                    final CapacityVO capacity = _storageMgr.getSecondaryStorageUsedStats(null, dc.getId());
+                List<CapacityVO> capacities=new ArrayList<CapacityVO>();
+                capacities.add(_storageMgr.getSecondaryStorageUsedStats(null, zoneId));
+                capacities.add(_storageMgr.getStoragePoolUsedStats(null,clusterId, podId, zoneId));
+                for (CapacityVO capacity : capacities) {
                     if (capacity.getTotalCapacity() != 0) {
                         capacity.setUsedPercentage((float)capacity.getUsedCapacity() / capacity.getTotalCapacity());
                     } else {
@@ -2517,6 +2508,23 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
                     final SummedCapacity summedCapacity = new SummedCapacity(capacity.getUsedCapacity(), capacity.getTotalCapacity(), capacity.getUsedPercentage(),
                             capacity.getCapacityType(), capacity.getDataCenterId(), capacity.getPodId(), capacity.getClusterId());
                     list.add(summedCapacity);
+                }
+            } else {
+                List<DataCenterVO> dcList = _dcDao.listEnabledZones();
+                for (DataCenterVO dc : dcList) {
+                    List<CapacityVO> capacities=new ArrayList<CapacityVO>();
+                    capacities.add(_storageMgr.getSecondaryStorageUsedStats(null, dc.getId()));
+                    capacities.add(_storageMgr.getStoragePoolUsedStats(null, null, null, dc.getId()));
+                    for (CapacityVO capacity : capacities) {
+                        if (capacity.getTotalCapacity() != 0) {
+                            capacity.setUsedPercentage((float)capacity.getUsedCapacity() / capacity.getTotalCapacity());
+                        } else {
+                            capacity.setUsedPercentage(0);
+                        }
+                        SummedCapacity summedCapacity = new SummedCapacity(capacity.getUsedCapacity(), capacity.getTotalCapacity(), capacity.getUsedPercentage(),
+                                capacity.getCapacityType(), capacity.getDataCenterId(), capacity.getPodId(), capacity.getClusterId());
+                        list.add(summedCapacity);
+                    }
                 }// End of for
             }
             return list;


[2/4] git commit: updated refs/heads/master to cd68e99

Posted by ra...@apache.org.
CLOUDSTACK-8857 listProjects doesn't return tags vmstopped or vmrunning when their value is zero


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c6e9d825
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c6e9d825
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c6e9d825

Branch: refs/heads/master
Commit: c6e9d82595aa3461d72907ae75817eae4527ba63
Parents: 7da95172
Author: Bharat Kumar <bh...@citrix.com>
Authored: Thu Feb 19 10:40:16 2015 +0530
Committer: Bharat Kumar <bh...@accelerite.com>
Committed: Mon Dec 12 13:36:46 2016 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6e9d825/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
index b110478..a8d3b68 100644
--- a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
@@ -162,8 +162,8 @@ public class AccountJoinDaoImpl extends GenericDaoBase<AccountJoinVO, Long> impl
         response.setTemplateAvailable(templateAvail);
 
         // Get stopped and running VMs
-        response.setVmStopped(account.getVmStopped());
-        response.setVmRunning(account.getVmRunning());
+        response.setVmStopped(account.getVmStopped()!=null ? account.getVmStopped() : 0);
+        response.setVmRunning(account.getVmRunning()!=null ? account.getVmRunning() : 0);
 
         //get resource limits for networks
         long networkLimit = ApiDBUtils.findCorrectResourceLimit(account.getNetworkLimit(), account.getId(), ResourceType.network);


[4/4] git commit: updated refs/heads/master to cd68e99

Posted by ra...@apache.org.
Merge pull request #838 from bvbharatk/CLOUDSTACK-8857

CLOUDSTACK-8857 listProjects doesn't return tags vmstopped or vmrunning when their value is zero listProjects doesn't return tags vmstopped or vmrunning when their value is zero
added the the appropriate tags to response.

tested this manually by creating projects, launching vms from project accounts and then listing the projects.

* pr/838:
  CLOUDSTACK-8857 listProjects doesn't return tags vmstopped or vmrunning when their value is zero

Signed-off-by: Rajani Karuturi <ra...@accelerite.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cd68e991
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cd68e991
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cd68e991

Branch: refs/heads/master
Commit: cd68e99148ac9ed96a8d1906b206cb5c5bcee11b
Parents: 75c08c4 c6e9d82
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Thu Feb 23 12:08:47 2017 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Thu Feb 23 12:08:47 2017 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[3/4] git commit: updated refs/heads/master to cd68e99

Posted by ra...@apache.org.
Merge pull request #865 from bvbharatk/CLOUDSTACK-8856

CLOUDSTACK-8856 Primary Storage Used(type tag with value 2) related tPrimary Storage Used(type tag with value 2) related tag is not showing in listCapacity api response

* pr/865:
  CLOUDSTACK-8856 Primary Storage Used(type tag with value 2) related tag is not showing in listCapacity api response.

Signed-off-by: Rajani Karuturi <ra...@accelerite.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75c08c46
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75c08c46
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75c08c46

Branch: refs/heads/master
Commit: 75c08c467caf5bcb476c3aebe5abfb5538520541
Parents: bb274a1 bddd7c6
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Thu Feb 23 12:08:17 2017 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Thu Feb 23 12:08:18 2017 +0530

----------------------------------------------------------------------
 .../com/cloud/server/ManagementServerImpl.java  | 38 ++++++++++++--------
 1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75c08c46/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------