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

Deploy nested esxi6.7 in kvm

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Recently, we tested the vmotion function of esxi6.7. In order to be familiar with kvm, we decided to implement it on kvm. The system is ubuntu16.04. Start a kvm and find that esxi will crash during migration and cannot be migrated. Look for related defective materials. The solution is as follows:

Installation and use of KVM first install kvm# apt install qemu-system-x86 qemu-kvm qemu libvirt-bin virt-manager virtinst bridge-utils cpu-checker virt-viewer to verify whether kvm is installed, and check whether the VT-x virtualization of cpu is on. The following message indicates that it is normal # kvm-okINFO: / dev/kvm existsKVM acceleration can be used run virt-host-validate to check your environment's technical support for kvm, if all are pass Description can be # virt-host-validate QEMU: Checking for hardware virtualization: PASSQEMU: Checking if device / dev/kvm exists: PASS if you want to enable ordinary users to use kvm, you can add the current user to the libvirt group cat / etc/group | grep libvirt | awk-fanglu'{'print $1'} | xargs-N1 sudo adduser $USER # adduser to kvm group alsosudo adduser $USER kvm# relogin Then show group membershipexec su-l $USERid | grep libvirt default, kvm will create a virtual switch named virbr0, using 192.168.122.0 ip addr show virbr017: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:d2:52:b5 brd ff:ff:ff:ff:ff:ffinet 192.168.122.1 scope global virbr0 valid_lft forever preferred_lft forevervirbr0 is actually a nat mode We can see the actual situation through iptables # iptable-t nat-vnLChain POSTROUTING (policy ACCEPT 146packets 11359 bytes) pkts bytes target prot opt in out source destination 0 RETURN all-- * * 192.168.122.0 MASQUERADE tcp 24 224.0.0.0 MASQUERADE tcp-- * * 192.168.122.0 MASQUERADE tcp 24 255.255.255.255 00 -* * 192.168.122.0 MASQUERADE udp 24! 192.168.122.0 MASQUERADE udp 24 masq ports: 1024-655350 0 MASQUERADE udp-* * 192.168.122.0 MASQUERADE udp 24! 192.168.122.0 MASQUERADE all 24 masq ports: 1024-655350 0 MASQUERADE all-* * 192.168.122.0 Universe 24 defines a storage pool The default storage pool is / var/lib/libvirt/images But you can also mount the os disk you want # virsh pool-list-all Name State Autostart-- default active yes $virsh pool-define-as kvmpool-- type dir-- target / data/kvm/poolPool kvmpool defined$ virsh pool-list-- all$ Virsh pool-start kvmpool$ virsh pool-autostart kvmpool$ virsh pool-list-- all Name State Autostart-default active yes kvmpool active yes deploy a vm on your kvm Set up a 1vcpu/1G RAM using the default virbr0 NAT network and the default pool storagevirt-install-- virt-type=kvm-- name=ukvm1404-- ram 1024-- vcpus=1-- virt-type=kvm-- hvm-- cdrom ~ / Downloads/mini.iso-- graphics vnc-- disk pool=default,size=20,bus=virtio,format=qcow2-- noautoconsole# open console to VMvirt-viewer ukvm1404 if you want to delete this vm, you can use the following command: virsh destroy ukvm1404virsh undefine ukvm1404 if you want a full graphical software to manage kvm You can use virt-manager, and you can use the x protocol ssh client when you don't have a graphical interface installed. Such as xshell, or xming+ssh client software deployment esxi to configure VT-x in KVM, you also need to configure VT# vi / etc/modprobe.d/qemu-system-x86.conf options kvm_intel nested=1 enable_apicv=noptions kvm ignore_msrs=1 in ubuntu to restart the system, execute the following command You must return the following value # want Y to be returned$ cat / sys/module/kvm/parameters/ignore_msrs# want N to be returned$ cat / sys/module/kvm_intel/parameters/enable_apicv# want Y to be returned$ cat / sys/module/kvm_intel/parameters/nested to establish the kvm virtual machine # virt-install-virt-type=kvm-name=esxi4\-ram 4096-vcpus=4\-virt-type=kvm-hvm\-cdrom / data/iso/VMware-VMvisor-Installer-6.7. 0.update03-14320388.x86_64.iso\-- network network:default Model=e1000\-- graphics vnc-- video qxl\-- disk pool=default,size=80,sparse=true,bus=ide,format=qcow2\-- boot cdrom,hd-- noautoconsole-- force\-- cpu host-model-only of course you can also use virt-manager to build a virtual machine.

Repeat the establishment of two virtual machines, the establishment of two esxi to achieve dynamic vmotion migration, testing and establishment steps are omitted, the test vmotion can work normally, there will be no collapse.

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