#Centos7.4#Linux虚拟机KVM配置CPU、内存

mac2022-06-30  58

【修改kvm虚拟机的资源大小cpu、内存、硬盘】

# virsh list --all 

Id    Name         State--------------------------------------------------     bbotte       shut off    # virsh setvcpus bbotte --maximum 4 --config# virsh setmaxmem bbotte 1048576 --config

# virsh dominfo bbotteId:             2Name:           bbotteUUID:           bd22f444-ee7f-7f00-3d1b-1bb0d0857e43OS Type:        hvmState:          runningCPU(s):         4CPU time:       152.3sMax memory:     1048576 KiBUsed memory:    524288 KiBPersistent:     yesAutostart:      disableManaged save:   noSecurity model: noneSecurity DOI:   0   ####修改xml配置文件###

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

参考连接:

https://blog.csdn.net/hnhuangyiyang/article/details/50902223

 

转载于:https://www.cnblogs.com/huanglinxin/p/10145529.html

相关资源:垃圾分类数据集及代码
最新回复(0)