[New KVM concept]-Virtual Machine CPU Hot plugging

Source: Internet
Author: User

[KVM New Concept]-Virtual Machine CPU Hot Plug-in background CPU and memory hot plug-in has been supported by mainstream operating systems for a long time. Microsoft has started to support it since Windows Server 2008, linux is supported from the kernel 3.2.0. Status Qemu has also planned the CPU Hot plugging feature for a long time, but it has not been integrated into the master-stem version, because there are many bugs and restrictions in implementation. The latest hot plugging branch of cpu is: https://github.com/imammedo/qemu/tree/cpu_add.v2 Currently, only vcpu Hot Plug-in is implemented, and hot unplug is not supported. I only verified the CPU hot-plug in the ora 18 client. step I specifically optimized qemu-kvm for Fedora 18, mainly optimizing qemu on IA 64, KVM and Linux to improve the stability and performance of qemu-kvm. The git repository is https://github.com/luohao-brian/qemu-kvm . You are welcome to try it out. Checkout branch qemu. dev. cpu_add and build qemu-kvm rpm packages; $ git clone https://github.com/luohao-brian/qemu-kvm $ Git checkout-B cpu_add remotes/origin/qemu. dev. cpu_add $ cp qemu-kvm.spec ~ /Rpmbuild/SPECS/$ rpmbuild-ba ~ /Rpmbuild/SPECS/qemu-kvm.spec $ rpm-Uvh qemu-common-1.4.0-10000.x86_64.rpm qemu-kvm-1.4.0-10000.x86_64.rpm qemu-img-1.4.0-10000.x86_64.rpmLaunch a guest which supports cpu hotplug like F18 or Win 2008 with a qemu qmp server: $ qemu-kvm-cpu host-enable-kvm-m 1024-smp 2, maxcpus = 4-drive file =/root/f18-live.iso-qmp tcp: localhost: 4444, server Connect to the qmp server using telnet $ telnet localhost 4444 Issue the json command as follows to check qmp capabilities, otherwise the following cpu-add command does not work. INPUT: {"execute": "qmp_capabilities"} OUTPUT: {"return" :{}} Issue the json commands to add vcpus to the guest: INPUT: {"execute ": "cpu-add", "arguments": {"id": 2 }}output: {"return" :{}} INPUT: {"execute ": "cpu-add", "arguments": {"id": 3 }}output: {"return" :{}} Go check the guest, and if it is a linux, you will see 2 cpus have been made available under/sys/devices/system/cpu /. to activate either of them, issue a command like: $ echo 1>/sys/devices/system/cpu/cpu2/online
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.