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 1187DE4EB for ; Fri, 8 Feb 2013 14:07:47 +0000 (UTC) Received: (qmail 41905 invoked by uid 500); 8 Feb 2013 14:07:46 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 41732 invoked by uid 500); 8 Feb 2013 14:07:46 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 41706 invoked by uid 99); 8 Feb 2013 14:07:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2013 14:07:45 +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.137] (HELO smtp01.mail.pcextreme.nl) (109.72.87.137) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2013 14:07:40 +0000 Received: from [IPv6:2a00:f10:113:0:f944:6048:3793:55af] (unknown [IPv6:2a00:f10:113:0:f944:6048:3793:55af]) by smtp01.mail.pcextreme.nl (Postfix) with ESMTPSA id EEEC876A55 for ; Fri, 8 Feb 2013 15:07:14 +0100 (CET) Message-ID: <51150692.1050408@widodh.nl> Date: Fri, 08 Feb 2013 15:07:14 +0100 From: Wido den Hollander User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: cloudstack-dev@incubator.apache.org Subject: Re: QEMU support in CloudStack 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 Hi, On 02/08/2013 10:34 AM, Dave Cahill wrote: > Hi, > > Recently I encountered two "nested virtualization" use cases which made me > want QEMU hypervisor support in CloudStack. I'm interested to hear if > anyone else is interested in this feature, and any notes on how it should > be implemented. > > Here is a good explanation from OpenStack docs [2] on why they support QEMU: > "From the perspective of the Compute service, the QEMU hypervisor is very > similar to the KVM hypervisor. Both are controlled through libvirt, both > support the same feature set, and all virtual machine images that are > compatible with KVM are also compatible with QEMU. The main difference is > that QEMU does not support native virtualization. Consequently, QEMU has > worse performance than KVM and is a poor choice for a production > deployment." > So, I've been reading into the code and found this on my Ubuntu systems. root@stack01:~# ls -l /usr/bin/kvm lrwxrwxrwx 1 root root 18 Oct 4 02:44 /usr/bin/kvm -> qemu-system-x86_64 root@stack01:~# Imho Qemu is Qemu and KVM only comes into play when the kernel module 'kvm' and 'kvm_amd' or 'kvm_intel' is loaded. > Here are the use cases I encountered: > > [Use case: Dev environment] > Wanted to use Vagrant [1] to create a portable multi-node dev > environment; however Vagrant uses VirtualBox, which doesn't support KVM. > Also, devcloud uses VirtualBox and devcloud-kvm uses kvm-within-kvm. I > imagine maintenance of devcloud and devcloud-kvm would be easier if > devcloud-kvm could use VirtualBox too. > Note: Of course, I'm aware of devcloud-kvm as an alternative for this > use case, and I'll be looking into that next. > > [Use case: Demo environment] > We may want to spin up a multi-node CloudStack install in Amazon AWS > for demo purposes. > Again, AWS instances don't support KVM, so this is not possible without > QEMU support. > > [Implementation ideas] > The management server currently does a check for KVM support ("kvm-ok") > on the host, and refuses to add the host if that fails. I think this check > could be removed, as the agent setup scripts will fail anyway if the user > is trying to setup a certain hypervisor on a machine which doesn't support > it. This way you could do nested virtualization indeed, but it could also hurt users who have their BIOS set to disabled and could lead to long debugging. > Create a new setting in agent.properties like "use_qemu", with a > default of "false". If the person deploying CloudStack agent sets this to > "true", cloud-setup-agent and other setup scripts would ignore lack of KVM > support as long as QEMU support was available. cloud-setup-agent generates a agent.properties, so at that point it doesn't know that the user intents to use the system without KVM support. > Lastly, when creating the libvirt XML file for a VM, set hypervisor to > QEMU rather than KVM in the XML file depending on the config setting. > That's not hard coded. The Agent does a getCapabilities() call to libvirt which returns a list of possible emulators. /usr/bin/kvm is just one of them which is returned and matches the architecture. Wido > Thanks for reading, > Dave. > > [1] http://www.vagrantup.com/ > [2] > http://docs.openstack.org/trunk/openstack-compute/install/yum/content/qemu.html >