VMware Cloud Community
vMarkusK1985
Expert
Expert
Jump to solution

Find select or view for allocated Datastore Space in vCAC Database

Hello,

I need to report the allocated Datastore Space per Datastore and BusinessGroup.

In the attachment is the View in vCAC where the values are visible.

Home >            Infrastructure > Reservations > Reservations

Does anybody know where to find in the Database?

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
1 Solution

Accepted Solutions
vMarkusK1985
Expert
Expert
Jump to solution

SELECT DISTINCT D.Name, SUM(E.MaxCapacity) AS Reserviert, SUM(B.StorageAllocated) AS Verwendet

FROM [vCAC].[dbo].[HostReservation] A, [vCAC].[dbo].[HostReservationToStorageStats] B, [vCAC].[dbo].[HostToStorage] C, [vCAC].[dbo].[HostStorageReservationPolicy] D,[vCAC].[dbo].[HostReservationToStorage] E

WHERE A.HostReservationName = 'RES-Default' AND A.HostReservationID = B.HostReservationID AND A.HostReservationID = E.HostReservationID AND B.HostToStorageID = C.HostToStorageID AND C.HostStorageReservationPolicyID = D.HostStorageReservationPolicyID AND C.HostToStorageID = E.HostToStorageID AND D.Name = 'Gold'

GROUP BY D.Name;

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK

View solution in original post

0 Kudos
7 Replies
VirExprt
Expert
Expert
Jump to solution

Hey!!

You may have to filter and trace out the data which is distributed in different tables..

All Reservation related tables are located as 'dbo.Host........'

dbo.jpg

Br,

MG

Regards, MG
0 Kudos
JamesMW
Enthusiast
Enthusiast
Jump to solution

Not entirely sure what level of info you want, but digging thru the HostReservation and ProvisioningGroup tables should provide what you are looking for.

select

  g.GroupName,

  r.HostReservationName,

  r.ReservationMemorySizeMB,

  r.ReservationStorageSizeGB

from

  ProvisioningGroup g left join

  HostReservation r on r.GroupID = g.GroupID

where

  MachineType = 0

This should get you started.

0 Kudos
GrantOrchardVMw
Commander
Commander
Jump to solution

You could pull this out of the IaaS Capacity Usage by Group portlet pretty easily. Are you planning on running it regularly?

Grant

pastedImage_1.png

Grant http://grantorchard.com
0 Kudos
vMarkusK1985
Expert
Expert
Jump to solution

Hi,

thats a good starting point but not what i need.

My intention is to Report the Used reservation per Datastore because I need i to report the Usage of my Storage classes (Gold, Silver).

There is no out of the box report avaiable...

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
0 Kudos
vMarkusK1985
Expert
Expert
Jump to solution

Sorry, thats not detailed enoth.

I need the different Datastores and Storage Classes.

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
0 Kudos
kumarankpl
Hot Shot
Hot Shot
Jump to solution

This is saved in HostReservationStats view(Select * from HostReservationStats). Where you can find the Columns StorageAllocated and other information's.

vMarkusK1985
Expert
Expert
Jump to solution

SELECT DISTINCT D.Name, SUM(E.MaxCapacity) AS Reserviert, SUM(B.StorageAllocated) AS Verwendet

FROM [vCAC].[dbo].[HostReservation] A, [vCAC].[dbo].[HostReservationToStorageStats] B, [vCAC].[dbo].[HostToStorage] C, [vCAC].[dbo].[HostStorageReservationPolicy] D,[vCAC].[dbo].[HostReservationToStorage] E

WHERE A.HostReservationName = 'RES-Default' AND A.HostReservationID = B.HostReservationID AND A.HostReservationID = E.HostReservationID AND B.HostToStorageID = C.HostToStorageID AND C.HostStorageReservationPolicyID = D.HostStorageReservationPolicyID AND C.HostToStorageID = E.HostToStorageID AND D.Name = 'Gold'

GROUP BY D.Name;

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
0 Kudos