Ganeti: describe how to change the CPU type on POWER
[mirror/dsa-wiki.git] / input / howto / install-ganeti.creole
index d18ef4b..cd69cbb 100644 (file)
@@ -108,7 +108,7 @@ This is the interfaces file for bar.debian.org:
 
 On each node, configure lvm to ignore drbd devices and to prefer
 {{{/dev/cciss}}} devices names over {{{/dev/block}}} device names
-([[http://code.google.com/p/ganeti/issues/detail?id=93|why?]]):
+([[https://code.google.com/p/ganeti/issues/detail?id=93|why?]]):
 
 {{{
     ssed -i \
@@ -468,10 +468,37 @@ Order is important, or else things get very, very confused and the world needs a
   gnt-cluster command "echo 1 > /sys/bus/pci/devices/0000:0e:00.0/cciss0/rescan"
 }}}
 
+
+=== DRBD optimization ===
+
+The default DRBD parameters are not really optimized, which means very slow (re)syncing. The
+following commands might help to make it faster. Of course the max speed can be increased if
+both the network and disk speed allow that.
+
+{{{
+    gnt-cluster modify -D drbd:net-custom="--max-buffers 36k --sndbuf-size 1024k --rcvbuf-size 2048k"
+    gnt-cluster modify -D drbd:c-min-rate=32768
+    gnt-cluster modify -D drbd:c-max-rate=98304
+    gnt-cluster modify -D drbd:resync-rate=98304
+}}}
+
+
+=== Change the disk cache ===
+
+When using raw volumes or partitions, it is best to avoid the host cache completely to reduce data copies
+and bus traffic. This can be done using:
+
+{{{
+    gnt-cluster modify -H kvm:disk_cache=none
+}}}
+
+
 === Change the CPU type ===
 
 Modern processors come with a wide variety of additional instruction sets (SSE, AES-NI, etc.) which vary from processor to processor, but can greatly improve the performance depending on the workload. Ganeti and QEMU default to a compatible subset of cpu features called qemu64, so that if the host processor is changed, or a live migration is performed, the guest will see its CPUfeatures unchanged. This is great for compatibility but comes at a performance cost.
 
+==== On x86 ====
+
 The CPU presented to the guests can easily be changed, using the cpu_type option in Ganeti hypervisor options. However to still be able to live-migrate VMs from one host to another, the CPU presented to the guest should be the common denominator of all hosts in the cluster. Otherwise a live migration between two different CPU types could crash the instance.
 
 For homogeneous clusters it is possible to use the host cpu type:
@@ -549,3 +576,21 @@ With the SandyBridge CPU type:
   aes-256-cbc     309840.39k   328612.18k   330784.68k   324245.16k   328116.91k
   aes-256-gcm     160820.14k   424322.20k   557212.50k   599435.61k   610459.65k
 }}}
+
+==== On POWER ====
+
+There are two KVM implementations on POWER, the KVM-PR (kvm-pr.ko) one which uses the "PRoblem state" of the ppc CPUs to run the guests and the KVM-HV (kvm-hv.ko) one uses the hardware virtualization support of the POWER CPU. In the later case the guest CPU has to be of the same type as the host CPU. However, there is at least the possibility to run the guest in a backward-compatibility mode of the previous CPU generation by using the compat parameter:
+{{{
+  gnt-cluster modify -H kvm:cpu_type='host,\compat=power8'
+}}}
+
+=== Add a virtio-rng device ===
+
+VirtIO RNG (random number generator) is a paravirtualized device that is exposed as a hardware RNG device to the guest. Virtio RNG just appears as a regular hardware RNG to the guest, which the kernel reads from to fill its entropy pool. Unfortunately Ganeti does not support it natively, therefore the kvm_extra option should be used. Ganeti forces the allocation of the PCI devices to specific slots, which means it is not possible to use the QEMU autoallocation and that an explicit PCI slot has to be provided. There 32 possible slots on the default QEMU machine, so we can use one of the last ones for example 0x1e.
+
+The final command to add a virtio-rng device cluster-wise is therefore:
+{{{
+  gnt-cluster modify -H kvm:kvm_extra="-device virtio-rng-pci\,bus=pci.0\,addr=0x1e\,max-bytes=1024\,period=1000"
+}}}
+
+The max-bytes and period options limit the entropy rate a guest can get to 1kB/s.