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 2F06B1081B for ; Tue, 6 Aug 2013 15:47:01 +0000 (UTC) Received: (qmail 44245 invoked by uid 500); 6 Aug 2013 15:47:00 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 44121 invoked by uid 500); 6 Aug 2013 15:47:00 -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 44112 invoked by uid 99); 6 Aug 2013 15:47:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 15:47:00 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [109.72.87.139] (HELO smtp02.mail.pcextreme.nl) (109.72.87.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 15:46:53 +0000 Received: from [IPv6:2a00:f10:11c:ab:29f1:d68c:618a:c045] (unknown [IPv6:2a00:f10:11c:ab:29f1:d68c:618a:c045]) by smtp02.mail.pcextreme.nl (Postfix) with ESMTPA id 11FEC401F7; Tue, 6 Aug 2013 17:46:13 +0200 (CEST) Message-ID: <52011A44.80400@widodh.nl> Date: Tue, 06 Aug 2013 17:46:12 +0200 From: Wido den Hollander User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: dev@cloudstack.apache.org CC: Edison Su Subject: KVM always defaulting to QCOW2 image formats Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I just encountered CLOUDSTACK-4114 [0] during my tests. I didn't encounter this before, but I just tried to restore from a snapshot and there it assumed the snapshot was in QCOW2 format, but it is actually a RAW device. In VolumeDoaImpl this is implemented: public ImageFormat getImageFormat(Long volumeId) { HypervisorType type = getHypervisorType(volumeId); if (type.equals(HypervisorType.KVM)) { return ImageFormat.QCOW2; } else if (type.equals(HypervisorType.XenServer)) { return ImageFormat.VHD; } else if (type.equals(HypervisorType.VMware)) { return ImageFormat.OVA; } else { s_logger.warn("Do not support hypervisor " + type.toString()); return null; } } Thile QCOW2 is valid when using NFS, it isn't when using either RBD or LVM. So why does KVM always default to QCOW2? Where is the best way to override this and have RBD always use RAW? I'd rather avoid a if pooltype == RBD kind of statement somewhere in the code. For now RBD is using the DefaultPrimary provider. Wido [0]: https://issues.apache.org/jira/browse/CLOUDSTACK-4114