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

KVM (2) KVM applications: expand capacity online, increase the number of CPU cores online, increase memory online, and create restore snapshots of KVM virtual machines

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

Share

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

The common methods of + + creating and taking snapshots + + KVM snapshots are qemu-img snapshot and virsh snapshot after I have tried the domain name of qemu-img snapshot-c snapshots many times. This method can no longer create snapshots 100% successfully. After creation, the virtual machine may not be able to start, report an error of File too large, and no solution has been found. The following describes how virsh snapshot creates a restore snapshot. Check the running status of KVM virtual machine [root@KVM ~] # virsh list Id name status-5 kvm-test running first create a clean version of the snapshot No service [root@KVM ~] # virsh snapshot-create-as-- domain kvm-test-- name kvm_cleanDomain snapshot kvm_clean createddomain is the name of the virtual machine name is the name of the snapshot Note: the speed of creating a snapshot varies according to the configuration of the server. While creating the snapshot, the KVM virtual machine is temporarily paused (it will be automatically converted to running after the snapshot is created). If it is an online server, please make your own decision. View the created snapshot [root@KVM ~] # virsh snapshot-list kvm-test name Creation Time status-kvm_clean 2016-01-25 15:07:14 + 0800 running Log in to the kvm virtual machine kvm-test to install the Apache service and start yum install httpd-y Echo "Test KVM snapshot" > > / var/www/html/index.html / etc/init.d/httpd restart access test [root@kvm-test ~] # curl 127.0.0.1Test KVM snapshot create a snapshot again [root@KVM ~] # virsh snapshot-create-as-- domain kvm-test-- name kvm_httpdDomain snapshot kvm_httpd created view snapshot [root@KVM ~] # virsh snapshot-list kvm-test name Creation Time status- -kvm_clean 2016-01-25 15:07:14 + 0800 running kvm_httpd 2016-01-25 16:03:52 + 0800 running restore test: first restore to the pure version Shut down the virtual machine without Apache service (boot restore is also available, not recommended) [root@KVM ~] # virsh snapshot-revert kvm-test kvm_clean log in to the virtual machine to see if you can access the httpd service [root@kvm-test ~] # curl 127.0.0.1 curl: (7) couldn't connect to host cannot be accessed, indicating that the restore is successful Restore to the installed state of the httpd service again [root@KVM ~] # virsh snapshot-revert kvm-test kvm_httpd access test [root@kvm-test ~] # curl 127.0.0.1 Test KVM snapshot restore succeeded. + + increase the number of CPU online + + View the number of logical CPU before the increase [root@kvm-test ~] # cat / proc/cpuinfo | grep process | wc-L2 add CPU and [root@KVM ~] # virsh setvcpus kvm-test 3 view [root@kvm-test ~] # cat / proc/cpuinfo again | grep process | wc-L3 memory + + check the existing memory [root@kvm-test ~] # free-m | grep Mem | Awk'{print $2} '628 add memory to 1024m same command [root@KVM ~] # virsh setmem kvm-test 1024m check [root@kvm-test ~] # free-m again | grep Mem | awk' {print $2} '852Over

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

Wechat

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

12
Report