且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

KVM调整cpu和内存

更新时间:2022-10-13 18:11:59

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
1、virsh edit centos73 (更改前要将virsh shutdown centos73 )
找到“memory”和“vcpu”标签,将
<name>centos73</name>
  <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
改为:
<name>centos73</name>
  <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid>
  <memory unit='KiB'>3145728</memory>
  <currentMemory unit='KiB'>3145728</currentMemory>
  <vcpu placement='static'>2</vcpu>
  
 virsh define /etc/libvirt/qemu/centos73.xml    重定义使配置生效    
重启虚拟机
virsh start centos73 --console
查看原配置信息
 
  
[root@localhost kvm]# virsh dominfo centos734
Id:             -
Name:           centos73
UUID:           2220a6d1-a36a-4fbb-8523-e078b3dfe795
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     2097152 KiB
Used memory:    2097152 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0
调整后信息:
[root@localhost kvm]# virsh dominfo centos73
Id:             -
Name:           centos73
UUID:           2220a6d1-a36a-4fbb-8523-e078b3dfe795
OS Type:        hvm
State:          shut off
CPU(s):         2
Max memory:     3145728 KiB
Used memory:    3145728 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0



本文转自 喵来个鱼 51CTO博客,原文链接:http://blog.51cto.com/m51cto/1958516,如需转载请自行联系原作者