1一.修改kvm虚拟机的配置 2 31、virsh edit centos7 4 5找到“memory”和“vcpu”标签,将 6 7<name>centos7</name> 8 9 <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid> 10 11 <memory unit='KiB'>2097152</memory> 12 13 <currentMemory unit='KiB'>2097152</currentMemory> 14 15 <vcpu placement='static'>1</vcpu> 16 17改为: 18 19<name>centos7</name> 20 21 <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid> 22 23 <memory unit='KiB'>3145728</memory> 24 25 <currentMemory unit='KiB'>3145728</currentMemory> 26 27 <vcpu placement='static'>2</vcpu>
重定义使配置生效
virsh define /etc/libvirt/qemu/centos7.xml
启动虚拟机
virsh start centos7
调整前虚拟机信息
1[root@localhost kvm]# virsh dominfo centos7 2Id: - 3Name: centos7 4UUID: 2220a6d1-a36a-4fbb-8523-e078b3dfe795 5OS Type: hvm 6State: shut off 7CPU(s): 1 8Max memory: 2097152 KiB 9Used memory: 2097152 KiB 10Persistent: yes 11Autostart: disable 12Managed save: no 13Security model: none 14Security DOI: 0
调整后虚拟机信息
1[root@localhost kvm]# virsh dominfo centos7 2Id: - 3Name: centos7 4UUID: 2220a6d1-a36a-4fbb-8523-e078b3dfe795 5OS Type: hvm 6State: shut off 7CPU(s): 2 8Max memory: 3145728 KiB 9Used memory: 3145728 KiB 10Persistent: yes 11Autostart: disable 12Managed save: no 13Security model: none 14Security DOI: 0