Vmware QEMU-KVM Virtualization Test

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]#  


Suppose 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 and generates/USR/LIBEXEC/QEMU-KVM after installation, which is the interface of the user space operation KVM Kernel, 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-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, and 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 under a similar window: 1 port for 5900 + 1 = 5901# to install VNC or use the VNC tool Connect the virtual machine. Install system for virtual machine # Shut down the virtual machine and start the virtual machine again, specify Vncport to 5901 (no 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 on each physical CPU (into hyperspace threads not counted)Cat/proc/cpuinfo | grep "Core ID" | Sort | Uniq | wc-l# change configuration memory and CPU references/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 possible CPU for the client is lost, including the number of CPUs in the offline state at startup, which can be used for hot-swapping to increase the CPU.) But cannot exceed maxcpus this upper limit) Cores=number of CPU cores on one socket. (That's what we call nuclear.) 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. (The number of slots on the motherboard that are plugged into the CPU.) That is, the number of physical CPUs that can be plugged in) #qemu-img is a relatively important tool that is the QEMU Disk Management tool.

#查看帮助信息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# change 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, often used Qcow2,raw#raw: the original disk image format, is the default file format for the qemu-img command. The advantage of a file in this format is that it is simple and easy to migrate to other emulators.

The feature starts by letting the image actually occupy the allocated space. But the writing speed is a little bit faster. #qcow2: This format is the image format that QEMU now recommends, which is the most versatile format that supports sparse files to conserve storage space. Support for encryption, compression, snapshots, etc. qemu Monitor is a console that QEMU interacts with users and is typically used to provide more complex functionality for the QEMU emulator, with the switch of the QEMU monitor "Ctrl + Alt + 2"--and Qemu monitor State "C TRL + ALT + 1 "-Client standard Display Form view help information help/? [Cmd]help SAVEVM or? SAVEVM Display System command status: Info View the version number 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 run in QEMU Monitor create snapshot savevm snap20150406 recovery snapshot LOADVM snap20150406 Deleting a snapshot DELVM snap20150406



Vmware QEMU-KVM Virtualization Test

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.