Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BE20D30A for ; Fri, 6 Jul 2012 15:03:57 +0000 (UTC) Received: (qmail 11438 invoked by uid 500); 6 Jul 2012 15:03:57 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 11405 invoked by uid 500); 6 Jul 2012 15:03:56 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 11374 invoked by uid 99); 6 Jul 2012 15:03:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 15:03:55 +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 (athena.apache.org: local policy) Received: from [109.72.87.138] (HELO smtp02.mail.pcextreme.nl) (109.72.87.138) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 15:03:50 +0000 Received: from [IPv6:2a00:f10:11c:ab:58de:c3df:e37f:2462] (unknown [IPv6:2a00:f10:11c:ab:58de:c3df:e37f:2462]) by smtp02.mail.pcextreme.nl (Postfix) with ESMTPA id 7EE7A4023E for ; Fri, 6 Jul 2012 17:03:27 +0200 (CEST) Message-ID: <4FF6FE40.1040706@widodh.nl> Date: Fri, 06 Jul 2012 17:03:28 +0200 From: Wido den Hollander User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: cloudstack-dev@incubator.apache.org Subject: Re: First review of RBD support for primary storage References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org First: Thanks for reviewing! On 07/06/2012 12:54 AM, Chiradeep Vittal wrote: > I took a first glance at this. Really pleased about this feature. EBS-like > scalable primary storage is within reach! > > A few comments: > 1. I see quite a few blocks of code ( > 20 times?) that are like > if (pool.getType() == StoragePoolType.RBD) > I realize that there is existing code that does these kinds of checks > as well. To me this can be solved simply by the "chain of responsibility" > pattern: you hand over the operation to a configured chain of handlers. > The first handler (usually) that says it can handle it, terminates the > chain. Yes, that would indeed be better. The current code is not very flexible, it assumes everything is a regular file or block device, which is not the case with RBD. In the current code I saw no other way then checking for the storage pool type multiple times. > 2. 'user_info' can actually be pushed into the 'storage_pool_details' > table. Generally we avoid modifying existing tables if we can. I get that, but user_info is something that comes from java.net.URI, just like host, port and name. So I figure that user_info was at the right place in the storage_pool. > 3. Copying a snapshot to secondary storage is desirable: to be consistent > with other storage types, to be able to instantiate new volumes in other > zones (when S3 support is available across the region). I'd like to > understand the blockers here. You can't copy a snapshot out of a RBD image to another destionation, this is not supported by qemu-img. root@stack02:~# qemu-img convert -f raw -O qcow2 -s wido rbd:rbd/cloudstack:mon_host=stack02.ceph.widodh.nl:auth_supported=none /root/wido-snapshot.qcow2 qemu-img: Failed to load snapshot root@stack02:~# Here I'm trying to extract the snapshot "wido" out of the image "cloudstack" and copy it to a qcow2 image. I prefer not to use the "rbd" CLI tool since that would bring another dependency into the picture. This could probably be fixed inside qemu-img, but that would involve more patching to be done. However, there is a warning here: RBD disks can become large, very large. In public clouds there should be a way to disable this for administrators, otherwise users could start snapshotting 5TB disks and copying them to the secondary storage. That would eat CPU and network capacity. Wido > > > On 7/2/12 5:59 AM, "Wido den Hollander" wrote: > >> Hi, >> >> On 29-06-12 17:59, Wido den Hollander wrote: >>> Now, the RBD support for primary storage knows limitations: >>> >>> - It only works with KVM >>> >>> - You are NOT able to snapshot RBD volumes. This is due to CloudStack >>> wanting to backup snapshots to the secondary storage and uses 'qemu-img >>> convert' for this. That doesn't work with RBD, but it's also very >>> inefficient. >>> >>> RBD supports native snapshots inside the Ceph cluster. RBD disks also >>> have the potential to reach very large sizes. Disks of 1TB won't be the >>> exception. It would stress your network heavily. I'm thinking about >>> implementing "internal snapshots", but that is step #2. For now no >>> snapshots. >>> >>> - You are able create a template from a RBD volume, but creating a new >>> instance with RBD storage from a template is still a hit-and-miss. >>> Working on that one. >>> >> >> I just pushed a fix for creating instances from a template. That should >> work now! >> >> Wido >