Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Make full use of KVM-- server resources

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Main points of content:

1. Introduction of KVM

II. KVM deployment instance

1. KVM introduction:

(1) KVM Virtualization Architecture

The KVM module is directly integrated into the linux kernel

(2) composition of KVM

1. KVM Driver (kernel)

Virtual machine creation

Virtual machine memory allocation

Virtual CPU register read and write

Virtual CPU running

2. QEMU (simplified and modified) tool

User control components that simulate PC hardware

Provide the device model of Ihop 0 and the way to access peripherals.

3. Three modes of KVM Virtualization

Customer model

User mode

Kernel mode

4. The working principle of KVM

5. Install KVM

6. Set up KVM network

KVM network includes user mode and bridge mode.

Bridging mode is used in this lab

7. Graphical management of KVM

8. Basic function management of KVM

View command help

View the configuration file storage directory of KVM

View virtual machine status

Virtual machine shutdown and start-up

Force the instance system to power off

Start the virtual machine system instance through the configuration file

Suspend virtual machine

Restore a virtual machine

Configure the virtual machine instance to start automatically with the host

Guide virtual machine configuration

Deletion and addition of virtual machines

Modify virtual machine configuration information

9. KVM file management

View the current disk format virt-cat commands virt- edit commands virt-df commands

II. KVM deployment instance

1. Set to enable virtualization and add a disk.

[root@localhost ~] # fdisk / dev/sdb # # disk partition [root@localhost ~] # mkfs / dev/sdb1 # # format [root@localhost ~] # mkdir / data [root@localhost ~] # mount / dev/sdb1 / data # # mount [root@localhost data] # df-h [root@localhost data] # mount.cifs / / 192.168.100.3/iOS / mnt/ # # mount Password for root@//192.168.100.3/iOS:

2. Install the necessary components and deploy the basic environment package

[root@localhost ~] # yum groupinstall "GNOME Desktop"-y # # Desktop environment yum install qemu-kvm- y # # kvm kernel yum install qemu-kvm-tools-y # # Debug tool yum install virt-install-y # # Command line tool yum install qemu-img-y # # component, create disk Launch virtual machine yum install bridge-utils-y # # Network support tool yum install libvirt-y # # Virtual machine management tool yum install virt-manager-y # # graphical management of virtual machine [root@localhost ~] # egrep'(vmx | svm)'/ proc/cpuinfo # # see if cpu supports [root@localhost ~] # lsmod | grep kvm # # check whether kvm installs [root@localhost ~] # systemctl start libvirtd # # enable service [root@localhost ~] # systemctl status libvirtd [root@localhost ~] # systemctl enable libvirtd # # enable self-boot [root@localhost mnt] # cd / data/ [root@localhost data] # mkdir vdisk viso # # create directory [root@localhost data] # cp / mnt/CentOS-7-x86_64-DVD-1708.iso / data/viso/ # # copy image to viso directory

3. Modify the network card information and add a bridge network card.

[root@localhost data] # cd / etc/sysconfig/network-scripts/ [root@localhost network-scripts] # cp-p ifcfg-ens33 ifcfg-br0 # # copy configuration file for br0 network card [root@localhost network-scripts] # vim ifcfg-ens33 # # add BRIDGE=br0 [root@localhost network-scripts] # vim ifcfg-br0 # # configuration network card information TYPE=bridge # # bridging mode NAME=br0 # # name is br0DEVICE=br0IPADDR=192.168.13.132 # # ip address NETMASKE=255.255.255.0 # # Subnet Mask GATEWAY=192.168.13.1 # # Gateway [root@localhost network-scripts] # service network restart # # restart the Nic

4. Configure virtual system management under graphical interface.

[root@localhost ~] # virt-manager # # enable

Wait a minute or so for the Virtual system Manager interface to appear.

1. Add a storage pool

2. Add storage volume

3. Create and install

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report