Vmware QEMU-KVM Virtualization Testing

Source: Internet
Author: User

[[email protected] cloud]# lsmod | grep kvmkvm_intel 55496 3 KVM 337772 1 kvm_intel[[email protected] cloud]# egrep "(V MX|SVM) "--color/proc/cpuinfo flags:fpu vme de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA Cmov Pat PSE36 C Lflush DTS MMX FXSR SSE SSE2 SS Syscall NX PDPE1GB rdtscp lm constant_tsc Arch_perfmon pebs BTS xtopology tsc_reliable non STOP_TSC aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 FMA cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt AES Xsave AVX f16c Rdrand hypervisor lahf_lm ida Arat EPB xsaveopt PLN pts DTS Tpr_shadow vnmi ept vpid fsgsbase smepflags:f  Pu vme de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS MMX fxsr SSE SSE2 SS Syscall NX PDPE1GB Rdtscp lm constant_tsc Arch_perfmon pebs BTS xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock PNI PCLMULQDQ VMX ssse3 FMA cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt AES Xsave AVX f16c Rdrand hypervisor lahf_lm Ida Arat EPB xsaveopt PLN pts DTS Tpr_shadow vnmi ept vpid fsgsbase smep[[email protected] cloud]#  


If there is no result, you should turn on the machine support Inter vt-x/ept or Amd-v/rvi


#查看Linux内核是否加载了kvm模块lsmod | grep kvm# installs QEMU-KVM, the installation is completed will generate/USR/LIBEXEC/QEMU-KVM, is the user space Operation KVM Core interface yum install qemu-kvm# upload ISO image files over the network #生成一个8G的文件 ( The file content is all 0), as the virtual machine's disk DD If=/dev/zero of=/cloud/centos.img bs=1m count=8192# use QEMU-KVM to create the virtual machine (parameter description-m specifies the memory size-SMP Specify the number of Cups-boot boot order)/usr/libexec/qemu-kvm-m 2048-SMP 1-boot order=cd-hda/cloud/centos.img-cdrom/iso/centos-6.6-x86_ 64-minimal.iso-vnc:1 parameter Description:-m Specifies the client memory size, the default unit MB-SMP specifies the number of client CPUs. SMP: (symmetric[s? ') Metr?k '] multi-processing) symmetric multi-processing-boot Specifies the boot order of the client system, and ORDER=CD refers to the CD-ROM before the hard disk. C:cd-rom D:hard DISK-HDA Specifies the client's IDE hard disk (that is, the previously created image file)-cdrom the specified client's optical drive-vnc a remote Desktop similar to window: 1 Port 5900 + 1 = 5901# Install VNC or connect using the VNC tool Virtual machine, install system for virtual machine # Shut down the virtual machine and start the virtual machine again, specify a VNC port of 5901 (you do not need to specify CDROM because the operating system is installed on disk)/usr/libexec/qemu-kvm-m 2048-SMP 1-boot Order =cd-hda/cloud/centos.img-vnc:1# viewing virtual machine Information FREE-MDMESG | grep Memory View CPU Information command: Lscpucat/proc/cpuinfo number of logical CPUs Cat/proc/cpuinfo | grep "Processor" | Wc-l number of physical CPUs Cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc-l number of cores per physical CPU (into hyperspace threads not counted) CAT/Proc/cpuinfo | grep "Core ID" | Sort | Uniq | wc-l# modifying configuration memory and CPU parameters/usr/libexec/qemu-kvm-m 4096-SMP 2,cores=4-boot ORDER=CD-HDA/CLOUD/CENTOS.IMG-VNC:1N[,MAXCPUS=CP Us][,cores=cores][,threads=threads][,sockets=sockets]set the number of CPUs to ' n ' [default=1]maxcpus= maximum number of Total CPUs, including offline CPUs for HotPlug etc. (the maximum amount of CPU that the client may be using is lost, including the number of CPUs in the offline state at startup, which can be used for hot-swappable CPU, but not exceeding the Maxcpus limit) Cores=number of CPU cores on one Socket. (which is what we normally call the kernel, each physical CPU can be dual-core, quad-core, etc.) Threads=number of threads on one CPU core. (Thread is the number of hardware threads per core, that is, Hyper-threading) sockets= Number of discrete sockets in the system. (That is, how many slots on the motherboard are plugged into the CPU, that is, the number of physical CPUs that can be plugged in) #qemu-img is a more important tool and a Disk management tool for QEMU. #查看帮助信息qemu-img-h# View image file Information qemu-img info/cloud/centos.img# Create a disk image file Qemu-img create-f qcow2/cloud/bill.img 10g# Convert RAW format to QCOW2 format qemu-img convert-o qcow2/cloud/bill.raw/cloud/bill.qcow2# modify Mirror size qemu-img resize/cloud/test.img +2G# Check the image qemu-img check/cloud/bill.qcow2# image format #qemu-img support a variety of image formats, can be viewed through the qemu-img-h command, commonly used Qcow2,raw#raw: Original disk image formatis the default file format for the QEMU-IMG command, the advantage of this format file is that it is very simple and very easy to port to other emulators. The feature starts by letting the image actually occupy the allocated space, but the write speed is a little bit faster. #qcow2: This format is the currently recommended image format for QEMU, it is the most functional format, it supports sparse files to save storage space, support encryption, compression, snapshots and other functions QEMU monitor is a console that QEMU interacts with the user, Typically used to provide a more complex function for the QEMU emulator, the switch of QEMU Monitor "CTRL + ALT + 2"---QEMU monitor State "CTRL + ALT + 1"-Client standard Display window view Help information /? [Cmd]help SAVEVM or? SAVEVM Display System command status: Info View the version information for QEMU info versions see if the current QEMU has KVM support info kvminfo nameinfo Status View information about each Vcpus in the client info CPUs view block device information, such as hard disk, floppy disk, optical drive, etc. info block view client's network configuration information info network displays saved client snapshot information for the current system Info Snapshots View the current client's migration status info Migrate displays the VNC status of the current client info VNC View the History of command execution in QEMU monitor create snapshot savevm snap20150406 recovery snapshot LOADVM snap20150406 Deleting a snapshot DELVM snap20150406


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Vmware QEMU-KVM Virtualization Testing

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.