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 DB608111B4 for ; Sat, 12 Jul 2014 06:48:43 +0000 (UTC) Received: (qmail 77035 invoked by uid 500); 12 Jul 2014 06:48:43 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 76983 invoked by uid 500); 12 Jul 2014 06:48:43 -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 76972 invoked by uid 99); 12 Jul 2014 06:48:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2014 06:48:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mike.tutkowski@solidfire.com designates 209.85.219.46 as permitted sender) Received: from [209.85.219.46] (HELO mail-oa0-f46.google.com) (209.85.219.46) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2014 06:48:39 +0000 Received: by mail-oa0-f46.google.com with SMTP id m1so2223538oag.5 for ; Fri, 11 Jul 2014 23:48:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=T126UOSLA95/jLGMzDTYUTYI87hsh9HnShhmWgic0ZI=; b=QM5Vwne6KuJOk0QAyX4V12DahKkl6egDIWyUK+1xb0Q5oym+fC9FuzZcMGpfQxv5YD NLBgRoq4UZ4Y+FMvfkTzTeW90eOV+FEoBZXNGUxjaUiCGSMD31v4kvgMDKD/MKKVQ3Tt CHcWgz4l3v4ni0vt9CX8RV3MyoG8CaOmeI5tNpcJITN4/jhEohrEDibniLDQBwsTkLCh bokLWXO7Zi2usdVFzH9+8katedYvIeU0iyNF8/Rg9wMXHnMNgL30xH1zwRqepkJY9qQh BiO+Vpo/0meO6fjZ13A2NEKwTdKHSmhmWLsDCutEYpLIgxDqXCBh6FNvmmOXoAGLjIxR 5Zmw== X-Gm-Message-State: ALoCoQlDaNQ71DTSkDmTQp2YkPcJx/GkdtWO/6MPx2tz5vV/5sL2KL5C17b3WnIrCqQI0U0ZCx4o MIME-Version: 1.0 X-Received: by 10.182.98.194 with SMTP id ek2mr4455839obb.5.1405147697760; Fri, 11 Jul 2014 23:48:17 -0700 (PDT) Received: by 10.182.124.230 with HTTP; Fri, 11 Jul 2014 23:48:17 -0700 (PDT) In-Reply-To: References: Date: Sat, 12 Jul 2014 00:48:17 -0600 Message-ID: Subject: Re: Resize Volume Question From: Mike Tutkowski To: "dev@cloudstack.apache.org" Content-Type: multipart/alternative; boundary=047d7b2e420661e19904fdf97130 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2e420661e19904fdf97130 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I didn't put this in the ticket, but - historically - when one talks about 1 GB in the persistent-storage world, one means 1,000,000,000 bytes (as opposed to memory, where 1 GB means 1,073,741,824 bytes). Some systems try to clarify this by using, for example, GB versus GiB. On Sat, Jul 12, 2014 at 12:11 AM, Mike Tutkowski < mike.tutkowski@solidfire.com> wrote: > Oh, by the way, that code documentation is still in my sandbox (i.e. not > committed). I am working on updating the resize-volume logic for 4.5. > Hopefully I'll have it checked in sometime next week. > > > On Sat, Jul 12, 2014 at 12:09 AM, Mike Tutkowski < > mike.tutkowski@solidfire.com> wrote: > >> OK, so, I did a couple things: >> >> 1) I documented the code in the resize-volume area (there were two place= s >> that I saw) where we bit shift to convert from GB to bytes. >> >> 2) I created: https://issues.apache.org/jira/browse/CLOUDSTACK-7101 >> >> The ticket will probably have to wait until a major release because >> changing the meaning of that parameter is essentially breaking backward >> compatibility. >> >> >> On Fri, Jul 11, 2014 at 8:47 PM, Nitin Mehta >> wrote: >> >>> Mike - Would you mind creating a bug for it or better still adding a >>> comment in the code as a //TODO - standardize it if you can't fix it ? >>> I guess currently dev writing new code doesn't have a good reference >>> whether to take it as bytes or in GB. That=C2=B9s why you are seeing bo= th >>> varieties. >>> >>> Thanks, >>> -Nitin >>> >>> On 11/07/14 6:33 PM, "Mike Tutkowski" >>> wrote: >>> >>> >Sure, that makes sense - thanks. >>> > >>> >It's too bad we don't really have a standard for our API in terms of h= ow >>> >volume sizes are referenced. It seems sometimes we use bytes while oth= er >>> >times we use GB. I was thinking the units were bytes here, but they ar= e >>> >GB. >>> > >>> > >>> >On Fri, Jul 11, 2014 at 3:55 PM, Nitin Mehta >>> >wrote: >>> > >>> >> Probably converting from GB to bytes ? I recall doing that for >>> creating >>> >> volumes from custom disk offering. >>> >> >>> >> On 11/07/14 2:07 PM, "Mike Tutkowski" >>> >> wrote: >>> >> >>> >> >Hi, >>> >> > >>> >> >In the resize-volume command, I see this logic: >>> >> > >>> >> > if (diskOffering.isCustomized() || >>> >> >volume.getVolumeType().equals(Volume.Type.ROOT)) { >>> >> > >>> >> > newSize =3D cmd.getSize(); >>> >> > >>> >> > >>> >> > if (newSize !=3D null) { >>> >> > >>> >> > newSize =3D (newSize << 30); >>> >> > >>> >> > } >>> >> > >>> >> > } >>> >> > >>> >> >Any thoughts on why we are shifting bits 30 places to the left? >>> >> > >>> >> >I don't recall us doing this in other places for long values? >>> >> > >>> >> >This is in VolumeApiServiceImpl.resizeVolume. >>> >> > >>> >> >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 >>> >> >* * >>> >> >>> >> >>> > >>> > >>> >-- >>> >*Mike Tutkowski* >>> >*Senior CloudStack Developer, SolidFire Inc.* >>> >e: mike.tutkowski@solidfire.com >>> >o: 303.746.7302 >>> >Advancing the way the world uses the cloud >>> >* * >>> >>> >> >> >> -- >> *Mike Tutkowski* >> *Senior CloudStack Developer, SolidFire Inc.* >> e: mike.tutkowski@solidfire.com >> o: 303.746.7302 >> Advancing the way the world uses the cloud >> *=E2=84=A2* >> > > > > -- > *Mike Tutkowski* > *Senior CloudStack Developer, SolidFire Inc.* > e: mike.tutkowski@solidfire.com > o: 303.746.7302 > Advancing the way the world uses the cloud > *=E2=84=A2* > --=20 *Mike Tutkowski* *Senior CloudStack Developer, SolidFire Inc.* e: mike.tutkowski@solidfire.com o: 303.746.7302 Advancing the way the world uses the cloud *=E2=84=A2* --047d7b2e420661e19904fdf97130--