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 2EEEC11188 for ; Fri, 25 Jul 2014 07:12:13 +0000 (UTC) Received: (qmail 7148 invoked by uid 500); 25 Jul 2014 07:12:12 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 7100 invoked by uid 500); 25 Jul 2014 07:12:12 -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 7087 invoked by uid 99); 25 Jul 2014 07:12:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2014 07:12:12 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [109.72.87.137] (HELO smtp01.mail.pcextreme.nl) (109.72.87.137) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2014 07:12:10 +0000 Received: from [IPv6:2a02:f6e:8007:0:e013:f6c7:3a87:3c7c] (unknown [IPv6:2a02:f6e:8007:0:e013:f6c7:3a87:3c7c]) by smtp01.mail.pcextreme.nl (Postfix) with ESMTPA id 49EFA76323 for ; Fri, 25 Jul 2014 09:11:46 +0200 (CEST) Message-ID: <53D20332.7020101@widodh.nl> Date: Fri, 25 Jul 2014 09:11:46 +0200 From: Wido den Hollander User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: dev@cloudstack.apache.org Subject: Re: [CLOUDSTACK-6181] RBD Support not implemented References: <53CEC512.9080908@widodh.nl> <53CEC9EF.1000304@widodh.nl> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 07/24/2014 06:38 PM, Logan Barfield wrote: > I think I've found the cause of the resize failure. When using RBD for > primary storage the disk is not allocated before the VM starts. The resize > operation runs before the disk exists, and instead of failing completely it > just updates the database with the new disk size and returns success. > Deploying the VM in a stopped state doesn't work either, because the disk > isn't created until the VM starts. > Ah, ok. So that's something that has to be fixed there. > I've been able to get a resize operation to work by manually running > deployVM -> wait for ~5 seconds -> resizeVolume. This obviously doesn't > help when passing the 'rootdisksize' parameter to deployVM. > True, true. Weird however that the resize runs prior to the creation of the drive. > To fix this I think the deployment logic would need to be changed to > allocate the VM's disk before starting it, or to run the resize operation > once the disk has been created. I'm assuming the only reason this issue is > appearing with RBD is due to how templates are deployed from an RBD > snapshot instead of being copied from secondary storage every time. > > Thoughts? > Fully agree with you. I think the logic sounds sane. Wido > > Thank You, > > Logan Barfield > Tranquil Hosting > > > On Wed, Jul 23, 2014 at 7:13 PM, Logan Barfield > wrote: > >> The change I mentioned appears to fix the resize error. Resizing the root >> disk with deployVM still doesn't work however. >> >> To test I created a VM from a 5GB template with "rootdisksize" = "20". >> The VM is successfully created, and CloudStack lists the ROOT volume as >> 20GB, but the RBD volume is still 5GB in size. >> >> Resizing the volume manually via virsh seems to work fine. I'll look >> through it again tomorrow. >> >> >> Thank You, >> >> Logan Barfield >> Tranquil Hosting >> >> >> On Wed, Jul 23, 2014 at 5:49 PM, Logan Barfield >> wrote: >> >>> Just an FYI, RBD resizing still fails because libvirt is throwing an >>> invalid flags error. I'm testing the following patch: >>> >>> >>> plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java: >>> >>> - if (conn.getLibVirVersion() > 1001000 && >>> vol.getFormat() == PhysicalDiskFormat.RAW) { >>> + if (conn.getLibVirVersion() > 1001000 && >>> vol.getFormat() == PhysicalDiskFormat.RAW && pool.getType() != >>> StoragePoolType.RBD) { >>> flags = 1; >>> } >>> >>> If it resolves the issue I'll submit it. >>> >>> >>> >>> >>> Thank You, >>> >>> Logan Barfield >>> Tranquil Hosting >>> >>> >>> On Tue, Jul 22, 2014 at 4:38 PM, Logan Barfield >>> wrote: >>> >>>> Wido, >>>> >>>> Excellent. As long as it passes testing we'll be golden. >>>> >>>> >>>> Thank You, >>>> >>>> Logan Barfield >>>> Tranquil Hosting >>>> >>>> >>>> On Tue, Jul 22, 2014 at 4:30 PM, Wido den Hollander >>>> wrote: >>>> >>>>> >>>>> >>>>> On 07/22/2014 10:13 PM, Logan Barfield wrote: >>>>> >>>>>> Wido, >>>>>> >>>>>> I appreciate the confirmation. Would you mind posting an update here >>>>>> when >>>>>> you've submitted the patch? As I mentioned in another post we will >>>>>> probably end up just having to go into production with a non-official >>>>>> build. We won't be able to wait for 4.5 or 4.4.x unfortunately. >>>>>> >>>>>> >>>>> I just pushed a patch: https://git-wip-us.apache.org/ >>>>> repos/asf?p=cloudstack.git;a=commitdiff;h= >>>>> 173909e99d85cfcc85b017bc426950f9f16fddf0 >>>>> >>>>> That should also apply on 4.4 very easily, a simple cherry-pick should >>>>> be sufficient. >>>>> >>>>> >>>>> Wido >>>>> >>>>> >>>>>> Thank You, >>>>>> >>>>>> Logan Barfield >>>>>> Tranquil Hosting >>>>>> >>>>>> >>>>>> On Tue, Jul 22, 2014 at 4:09 PM, Wido den Hollander >>>>>> wrote: >>>>>> >>>>>> >>>>>>> >>>>>>> On 07/22/2014 09:53 PM, Logan Barfield wrote: >>>>>>> >>>>>>> I was testing on a recent 4.4 build today and noticed that volume >>>>>>>> resizing >>>>>>>> for RBD volumes is not working as intended. >>>>>>>> >>>>>>>> In LibvirtComputingResource.java the 'getResizeScriptType()' function >>>>>>>> doesn't have logic for type = RBD and format = RAW or QCOW2, so it >>>>>>>> returns >>>>>>>> 'null' and the resize operation fails. >>>>>>>> >>>>>>>> In CLOUDSTACK-6181 there was some discussion regarding RBD support, >>>>>>>> and it >>>>>>>> was signed off on by Wido (who appears to be the only contributor >>>>>>>> actively >>>>>>>> supporting Ceph in CloudStack). Was the mentioned functionality just >>>>>>>> never >>>>>>>> implemented, or am I overlooking something? >>>>>>>> >>>>>>>> >>>>>>>> So it seems you are right. I can't remember anymore why I signed it >>>>>>> off >>>>>>> (probably because it worked locally), but what you are saying is true. >>>>>>> >>>>>>> RBD are block devices which do not exist in kernel space, so a script >>>>>>> can >>>>>>> never check if the volume exists. >>>>>>> >>>>>>> The fix is rather simple, since libvirt can resize the volume it's >>>>>>> just a >>>>>>> matter of a few if-statements in LibvirtComputing resouce, I'll get >>>>>>> right >>>>>>> to that, but it will never make it into 4.4. Hopefully 4.4.1 >>>>>>> >>>>>>> Wido >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Thank You, >>>>>>>> >>>>>>>> Logan Barfield >>>>>>>> Tranquil Hosting >>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>> >>> >> >