Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13B6810715 for ; Thu, 15 Aug 2013 09:33:34 +0000 (UTC) Received: (qmail 54088 invoked by uid 500); 15 Aug 2013 09:33:33 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 53653 invoked by uid 500); 15 Aug 2013 09:33:30 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 53644 invoked by uid 99); 15 Aug 2013 09:33:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 09:33:29 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of donal.lafferty@citrix.com designates 66.165.176.89 as permitted sender) Received: from [66.165.176.89] (HELO SMTP.CITRIX.COM) (66.165.176.89) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 09:33:24 +0000 X-IronPort-AV: E=Sophos;i="4.89,884,1367971200"; d="scan'208,217";a="44492378" Received: from accessns.citrite.net (HELO FTLPMAILMX01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 15 Aug 2013 09:33:02 +0000 Received: from AMSPEX01CL03.citrite.net (10.69.46.34) by FTLPMAILMX01.citrite.net (10.13.107.65) with Microsoft SMTP Server (TLS) id 8.3.298.1; Thu, 15 Aug 2013 05:33:01 -0400 Received: from AMSPEX01CL02.citrite.net ([169.254.7.154]) by AMSPEX01CL03.citrite.net ([10.69.46.34]) with mapi id 14.02.0342.004; Thu, 15 Aug 2013 11:33:00 +0200 From: Donal Lafferty To: Mike Tutkowski , "dev@cloudstack.apache.org" Subject: RE: Disk Allocated Versus Disk Used Thread-Topic: Disk Allocated Versus Disk Used Thread-Index: AQHOf2ZCwzV4g3Q960qcyIVSllszLJlhvjQAgDOWIYCAANQWAA== Date: Thu, 15 Aug 2013 09:33:00 +0000 Message-ID: <9ADDE3F979256644BED8F0D244BE51F00604EB@AMSPEX01CL02.citrite.net> References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.30.249.37] Content-Type: multipart/alternative; boundary="_000_9ADDE3F979256644BED8F0D244BE51F00604EBAMSPEX01CL02citri_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_9ADDE3F979256644BED8F0D244BE51F00604EBAMSPEX01CL02citri_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Mike, I've had problems with GUI stats as well. I tried to solve the issue by fo= cusing on the kernel commands that are used to populate database entries th= e GUI relies on. There seem to be three important commands: GetStorageStatsCommand, Startup= StorageCommand and ModifyStoragePoolCommand. GetStorageStatsCommand is cal= led on a regular basis, StartupStorageCommand is returned by a Hypervisor a= gent once when it connects to the management server, and ModifyStoragePoo= lCommand is called once when primary storage is configured. The commands = have fields for capacity, used, and available. Problems were that I found the term 'capacity' ambiguous, and that ModifySt= roagePoolCommand seemed to take a different view on what 'availableBytes' m= eans. For, 'capacity', I went with an implementation that set 'capacity' to tota= l storage device volume and 'available' to unallocated space. E.g. public static void GetCapacityForLocalPath(string localStoragePath, out lon= g capacityBytes, out long availableBytes) { ... System.IO.DriveInfo poolInfo =3D new System.IO.DriveInfo(fullPath); capacityBytes =3D poolInfo.TotalSize; availableBytes =3D poolInfo.AvailableFreeSpace; ... 'used' became the difference between the two, e.g. for GetStorageStatsComma= nd object ansContent =3D new { result =3D result, details =3D details, capacity =3D capacity, used =3D capacity - available }; return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.GetStorageSt= atsAnswer); StartupStorageCommand does not have a 'used'. Instead it returns "availabl= e" and "capacity", e.g. StoragePoolInfo pi =3D new StoragePoolInfo( poolGuid.ToString(), ipAddr, localStoragePath, localStoragePath, StoragePoolType.Filesystem.ToString(), capacity, available); However, I have a note on the ModifyStoragePoolCommand to double check the = meaning of available. E.g. var poolInfo =3D new { uuid =3D uuid, host =3D cmd.pool.host, localPath =3D cmd.pool.host, hostPath =3D cmd.localPath, poolType =3D cmd.pool.type, capacityBytes =3D capacityBytes, // TODO: double check whether you need 'available' or 'used' bytes? availableBytes =3D availableBytes }; What has your experience been with ModifyStoragePoolCommand? Finally, if the agent reconnects with a different identifier, you end up tw= o entries in the database. One for the previous connect and one for the ne= w connection. This messes up your storage stats. DL From: Mike Tutkowski [mailto:mike.tutkowski@solidfire.com] Sent: 14 August 2013 23:05 To: dev@cloudstack.apache.org Cc: Donal Lafferty Subject: Re: Disk Allocated Versus Disk Used I wonder if Donal can answer this question? On Fri, Jul 12, 2013 at 7:18 PM, Mike Tutkowski > wrote: In looking at my Xen boxes, disksizeused appears to equate to used space. disksizeallocated, I presume, should equate to what Xen calls allocated spa= ce, but it does not seem to (ex. the GUI wasn't showing anything, but in Xe= nCenter it says 8 GB allocated space for one of my hosts). On Fri, Jul 12, 2013 at 7:13 PM, Mike Tutkowski > wrote: Hi, I noticed in the 4.2 GUI under the details of Primary Storage that the Disk= Allocated field always seems to be empty. I changed the logic to display the disksizeused field (instead of the disks= izeallocated field) and now it seems to work. Can someone tell me what the difference is supposed to be between these two= fields and if the change I made should be checked in (along with changing = the name of this field from Disk Allocated to Disk Used)? Thanks! -- Mike Tutkowski Senior CloudStack Developer, SolidFire Inc. e: mike.tutkowski@solidfire.com o: 303.746.7302 Advancing the way the world uses the cloud(tm) -- Mike Tutkowski Senior CloudStack Developer, SolidFire Inc. e: mike.tutkowski@solidfire.com o: 303.746.7302 Advancing the way the world uses the cloud(tm) -- Mike Tutkowski Senior CloudStack Developer, SolidFire Inc. e: mike.tutkowski@solidfire.com o: 303.746.7302 Advancing the way the world uses the cloud(tm) --_000_9ADDE3F979256644BED8F0D244BE51F00604EBAMSPEX01CL02citri_--