Although not officially supported, it is possible to run Ubuntu 14.04.2 LTS as a KVM hypervisor in POWER architecture. You can officially support Ubuntu as hypervisor starting at Ubuntu 14.10 and optimally at 15.04.
In order to do that, you need to be on 14.04.2 or later. Ubuntu KVM doesn't run on 3.13 kernel, which is part of original Ubuntu 14.04 and 14.04.1 release. You will also need to download some newer packages from the Cloud Archive repository.
There is a set of differences, mainly some features that were not made upstream yet, as:
Note Recommended 14.10 or later
Ubuntu is able to be used as a hypervisor, as an alternative to PowerKVM.
Just install buntun in bare metal (NV) following the steps in Running Ubuntu non-virtualized on POWER8.
After the installation you need:
# sudo apt-get install qemu-user qemu-utils cloud-image-utils qemu-system-ppc qemu-slof libvirt-bin numactl
<span style="font-size:12px;">root@zhai:~# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 Core(s) per socket: 10 Socket(s): 1 NUMA node(s): 1 Model: TN71-BP012 L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56,64,72 root@zhai:~# apt-get install qemu-user qemu-utils qemu-system-ppc qemu-slof libvirt-bin numactl qemu-kvm Reading package lists... Done Building dependency tree Reading state information... Done qemu-slof is already the newest version. numactl is already the newest version. The following extra packages will be installed: binfmt-support ipxe-qemu libjpeg-turbo8 libjpeg8 libvirt0 qemu-block-extra qemu-system-common qemu-user-binfmt seabios Suggested packages: policykit-1 radvd lvm2 samba vde2 openbios-ppc openhackware debootstrap Recommended packages: dmidecode The following packages will be REMOVED: qemu-keymaps The following NEW packages will be installed: binfmt-support ipxe-qemu libjpeg-turbo8 libjpeg8 qemu-block-extra qemu-user-binfmt seabios The following packages will be upgraded: libvirt-bin libvirt0 qemu-kvm qemu-system-common qemu-system-ppc qemu-user qemu-utils 7 upgraded, 7 newly installed, 1 to remove and 91 not upgraded. Need to get 11.4 MB of archives. After this operation, 16.5 MB of additional disk space will be used. Do you want to continue? [Y/n] y</span>
Once you do that, you should have the following package versions:
Package |
Version |
qemu |
1:2.2+dfsg-5expubuntu9~cloud0 |
qemu-slof |
20140630+dfsg-1ubuntu1 |
libvirt |
1.2.12-0ubuntu12~cloud0 |
root@zhai:~# qemu-system-ppc --version QEMU emulator version 2.3.0 (Debian 1:2.3+dfsg-5ubuntu9.2~cloud0), Copyright (c) 2003-2008 Fabrice Bellard root@zhai:~# libvirtd --version libvirtd (libvirt) 1.2.16 root@zhai:~# dpkg -l | grep qemu-slof ii qemu-slof 20140630+dfsg-1ubuntu1~14.04 all Slimline Open Firmware -- QEversionOnce you have that, you have all the software need to run a KVM guest on your machine.
# sudo usermod -a -G kvm <user>
# sudo ppc64_cpu --smt=off
# sudo modprobe kvm_hv
KVM是Linux的一个模块。可以用modprobe去加载KVM模块。加载了模块后,才能进一步通过其他工具创建虚拟机。但仅有KVM模块是 远远不够的,因为用户无法直接控制内核模块去作事情:还必须有一个用户空间的工具才行。这个用户空间的工具,开发者选择了已经成型的开源虚拟化软件 QEMU。说起来QEMU也是一个虚拟化软件。它的特点是可虚拟不同的CPU。
[Ubuntu 14.10 only] Assure that you have the /usr/bin/qemu-system-ppc64le file, otherwise, create a link as follow. This is only required in Ubuntu 14.10 and this is already 'fixed' on later releases, check [1]:
# sudo ln -s qemu-system-ppc64 /usr/bin/qemu-system-ppc64le
[Ubuntu 14.10 only] Allow apparmor to access the SLOF (firmware). This is only required in Ubuntu 14.10 and this is already 'fixed' on later releases, check[2]:
# echo "/usr/share/slof/** r," >> /etc/apparmor.d/abstractions/libvirt-qemu
allow br0
# chmod u+s /usr/lib/qemu/qemu-bridge-helper
# ps -ef | grep virt /usr/sbin/libvirtd -d
# virsh list --all
参考:
1 ubuntu ppc64el: https://wiki.ubuntu.com/ppc64el/
2 https://wiki.ubuntu.com/ppc64el/CommonQuestions
3 https://wiki.ubuntu.com/ppc64el/KVM1404
4 PowerKVM: http://blog.csdn.net/zhaihaifei/article/details/51025780