KVM vs Xen/OpenVZ for VPS hosting business

2009-07-19 Thread howard chen
Hello,

Currently both Xen and OpenVZ are well known and mature product used
in hosting companies.

How about KVM? What are the advantages if I use KVM as the VPS solution?

E.g.

performance?
security?
maintainity?


I am not familar with KVM so want to know your opinion.

Thanks.
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: init scripts for KVM guests UPDATE!

2009-07-19 Thread SAL
On Sat, Jul 18, 2009 at 02:13:44AM +0200, Saman Behnam wrote:
 here is an update for the init scripts for KVM guestsI've wrote for
 starting and stopping the KVM guest machines either by saving and
 restoring or by gracefully shutdown and start. My question, is there an
 option within libvirt to make the KVM guest mashines get saved when
 the KVM host shuts down? I had problems to gracefully shutdown Windows
 VM's!!!

Hello,

  I sent my (and also your) script to libvir-list, but no response yet.
There are also some suggestions, how libvirt can handle graceful shutdown
and leave ability to restart libvirt without touching guests.

  I use my script to also shutdown windows guests. It's working well, if you
configure to shutdown windows on acpi event (virtual power button pressed).
I am not an expert for windows and I can't tell you more, but I am sure,
that you can find more with google. :-)

SAL
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: init scripts for KVM guests UPDATE!

2009-07-19 Thread SAL
On Sun, Jul 19, 2009 at 11:51:44AM +0200, Ján ONDREJ (SAL) wrote:
 On Sat, Jul 18, 2009 at 02:13:44AM +0200, Saman Behnam wrote:
  here is an update for the init scripts for KVM guestsI've wrote for
  starting and stopping the KVM guest machines either by saving and
  restoring or by gracefully shutdown and start. My question, is there an
  option within libvirt to make the KVM guest mashines get saved when
  the KVM host shuts down? I had problems to gracefully shutdown Windows
  VM's!!!

   I sent my (and also your) script to libvir-list, but no response yet.
 There are also some suggestions, how libvirt can handle graceful shutdown
 and leave ability to restart libvirt without touching guests.
 
   I use my script to also shutdown windows guests. It's working well, if you
 configure to shutdown windows on acpi event (virtual power button pressed).
 I am not an expert for windows and I can't tell you more, but I am sure,
 that you can find more with google. :-)

Forgot to attach mail archive URL:
  http://www.mail-archive.com/libvir-l...@redhat.com/msg14754.html

SAL
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


subsribe kvm

2009-07-19 Thread Oliver Schmidt


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: failure to build kvm release against 2.6.30

2009-07-19 Thread Or Gerlitz
 include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
 include/linux/mmzone.h:256:5: warning: MAX_NR_ZONES is not defined

okay, my problem was that for some reason the auto generated linux/bounds.h
file got cleaned from this system, now I can build that.

Or.
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] enable x2APIC without interrupt remapping under KVM

2009-07-19 Thread Gleb Natapov
KVM would like to provide x2APIC interface to a guest without emulating
interrupt remapping device. The reason KVM prefers guest to use x2APIC
is that x2APIC interface is better virtualizable and provides better
performance than mmio xAPIC interface:

- msr exits are faster than mmio (no page table walk, emulation)
- no need to read back ICR to look at the busy bit
- one 64 bit ICR write instead of two 32 bit writes
- shared code with the Hyper-V paravirt interface

Included patch changes x2APIC enabling logic to enable it even if IR
initialization failed, but kernel runs under KVM and no apic id is
greater than 255 (if there is one spec requires BIOS to move to x2apic
mode before starting an OS).

Signed-off-by: Gleb Natapov g...@redhat.com
Acked-by: Suresh Siddha suresh.b.sid...@intel.com
---

This is based on x86 tree commit d7ccd190e5107 with Ingo comments
addressed (comment formatting, print error on alloc failure).

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 0a1c283..a010af4 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -49,6 +49,7 @@
 #include asm/mtrr.h
 #include asm/smp.h
 #include asm/mce.h
+#include asm/kvm_para.h
 
 unsigned int num_processors;
 
@@ -1361,52 +1362,76 @@ void enable_x2apic(void)
 }
 #endif /* CONFIG_X86_X2APIC */
 
-void __init enable_IR_x2apic(void)
+int __init enable_IR(void)
 {
 #ifdef CONFIG_INTR_REMAP
int ret;
-   unsigned long flags;
-   struct IO_APIC_route_entry **ioapic_entries = NULL;
 
ret = dmar_table_init();
if (ret) {
pr_debug(dmar_table_init() failed with %d:\n, ret);
-   goto ir_failed;
+   return 0;
}
 
if (!intr_remapping_supported()) {
pr_debug(intr-remapping not supported\n);
-   goto ir_failed;
+   return 0;
}
 
-
if (!x2apic_preenabled  skip_ioapic_setup) {
pr_info(Skipped enabling intr-remap because of skipping 
io-apic setup\n);
-   return;
+   return 0;
}
 
+   if (enable_intr_remapping(x2apic_supported()))
+   return 0;
+
+   pr_info(Enabled Interrupt-remapping\n);
+
+   return 1;
+
+#endif
+   return 0;
+}
+
+void __init enable_IR_x2apic(void)
+{
+   unsigned long flags;
+   struct IO_APIC_route_entry **ioapic_entries = NULL;
+   int ret, x2apic_enabled = 0;
+
ioapic_entries = alloc_ioapic_entries();
if (!ioapic_entries) {
-   pr_info(Allocate ioapic_entries failed: %d\n, ret);
-   goto end;
+   pr_err(Allocate ioapic_entries failed\n);
+   goto out;
}
 
ret = save_IO_APIC_setup(ioapic_entries);
if (ret) {
pr_info(Saving IO-APIC state failed: %d\n, ret);
-   goto end;
+   goto out;
}
 
local_irq_save(flags);
-   mask_IO_APIC_setup(ioapic_entries);
mask_8259A();
+   mask_IO_APIC_setup(ioapic_entries);
 
-   ret = enable_intr_remapping(x2apic_supported());
-   if (ret)
-   goto end_restore;
+   ret = enable_IR();
+   if (!ret) {
+   /* IR is required if there is APIC ID  255 even when running
+* under KVM
+   */
+   if (max_physical_apicid  255 || !kvm_para_available())
+   goto nox2apic;
+   /*
+* without IR all CPUs can be addressed by IOAPIC/MSI
+* only in physical mode
+*/
+   x2apic_phys = 1;
+   }
 
-   pr_info(Enabled Interrupt-remapping\n);
+   x2apic_enabled = 1;
 
if (x2apic_supported()  !x2apic_mode) {
x2apic_mode = 1;
@@ -1414,41 +1439,27 @@ void __init enable_IR_x2apic(void)
pr_info(Enabled x2apic\n);
}
 
-end_restore:
-   if (ret)
-   /*
-* IR enabling failed
-*/
+nox2apic:
+   if (!ret) /* IR enabling failed */
restore_IO_APIC_setup(ioapic_entries);
-
unmask_8259A();
local_irq_restore(flags);
 
-end:
+out:
if (ioapic_entries)
free_ioapic_entries(ioapic_entries);
 
-   if (!ret)
+   if (x2apic_enabled)
return;
 
-ir_failed:
-   if (x2apic_preenabled)
-   panic(x2apic enabled by bios. But IR enabling failed);
-   else if (cpu_has_x2apic)
-   pr_info(Not enabling x2apic,Intr-remapping\n);
-#else
-   if (!cpu_has_x2apic)
-   return;
-
-   if (x2apic_preenabled)
-   panic(x2apic enabled prior OS handover,
-  enable CONFIG_X86_X2APIC, CONFIG_INTR_REMAP);
-#endif
-
-   return;
+   if (x2apic_preenabled) {
+   panic(x2apic enabled by bios. But IR enabling failed.
+  Check that CONFIG_X86_X2APIC 

Re: [PATCH] enable x2APIC without interrupt remapping under KVM

2009-07-19 Thread Ingo Molnar

* Gleb Natapov g...@redhat.com wrote:

 + if (!ret) {
 + /* IR is required if there is APIC ID  255 even when running
 +  * under KVM
 + */

Eeek.

 + if (x2apic_preenabled) {
 + panic(x2apic enabled by bios. But IR enabling failed.
 +Check that CONFIG_X86_X2APIC and CONFIG_INTR_REMAP are
 +enabled.);

We dont want to break such messages mid-line, it makes it hard to 
git-grep for them. Also, the '. But' looks weird.

Ingo
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] enable x2APIC without interrupt remapping under KVM

2009-07-19 Thread Gleb Natapov
On Sun, Jul 19, 2009 at 06:27:35PM +0200, Ingo Molnar wrote:
 
 * Gleb Natapov g...@redhat.com wrote:
 
  +   if (!ret) {
  +   /* IR is required if there is APIC ID  255 even when running
  +* under KVM
  +   */
 
 Eeek.
 
  +   if (x2apic_preenabled) {
  +   panic(x2apic enabled by bios. But IR enabling failed.
  +  Check that CONFIG_X86_X2APIC and CONFIG_INTR_REMAP are
  +  enabled.);
 
 We dont want to break such messages mid-line, it makes it hard to 
 git-grep for them. Also, the '. But' looks weird.

So what should I do? Make really long line?

--
Gleb.
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] enable x2APIC without interrupt remapping under KVM

2009-07-19 Thread Ingo Molnar

* Gleb Natapov g...@redhat.com wrote:

 On Sun, Jul 19, 2009 at 06:27:35PM +0200, Ingo Molnar wrote:
  
  * Gleb Natapov g...@redhat.com wrote:
  
   + if (!ret) {
   + /* IR is required if there is APIC ID  255 even when running
   +  * under KVM
   + */
  
  Eeek.
  
   + if (x2apic_preenabled) {
   + panic(x2apic enabled by bios. But IR enabling failed.
   +Check that CONFIG_X86_X2APIC and CONFIG_INTR_REMAP are
   +enabled.);
  
  We dont want to break such messages mid-line, it makes it hard to 
  git-grep for them. Also, the '. But' looks weird.
 
 So what should I do? Make really long line?

i'd suggest short ones generally, like:

x2apic: enabled by BIOS but kernel init failed.

also, referring to whether the config are enabled is a bit lame - we 
are in the kernel so we should know whether they are enabled.

Ingo
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: How much physical memory can be used to run domains in a KVM machine?

2009-07-19 Thread Sheng Yang
On Friday 17 July 2009 17:56:49 sudhir kumar wrote:
 On Fri, Jul 17, 2009 at 12:47 PM, Dor Laordl...@redhat.com wrote:
  On 07/17/2009 08:50 AM, Zhang Qian wrote:
  Hi,
 
  I have a KVM box which has 4GB physical memory totally, I'd like to
  know how much I can use to run my domains, and how much will be
  reserved by hypervisor(KVM) itself?
  Thanks!
 
  KVM and the Linux host use relatively low amount of memory.
  Unlike other hypervisors you know, kvm does not reserve memory and also
  is able to swap the guest memory, so you can even use more than 4G for
  your

 Is that true? I think we can not allocate memory more than the
 physical RAM. Or does upstream kvm supports it? My kvm version is not
 that old but memory allocation failed for me when I tried to give the
 whole memory on my host to the guest.

It's not specific to KVM. QEmu use malloc()/mmap() to allocate memory for KVM, 
which is controlled by Linux kernel memory overcommit policy. Linux kernel 
didn't support memory overcommit by default. You can refer to 
Document/vm/overcommit-accounting and other related document to enable it. 

-- 
regards
Yang, Sheng


  guest. (Just note swapping will be slow)
 
  Regards,
  Qian
  --
  To unsubscribe from this list: send the line unsubscribe kvm in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
  --
  To unsubscribe from this list: send the line unsubscribe kvm in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html