查看内存大小
root@controller:~# virsh dominfo suhw-test | grep memory
Max memory: 4194304 KiB
Used memory: 4194304 KiB
增大虚拟机内存、增加虚拟机CPU个数需要首先关机虚拟机
增加步骤
关闭虚拟机
root@controller:~# virsh shutdown suhw-test
#virsh destroy suhw-test
修改虚拟机配置文件
root@controller:~# virsh edit suhw-test
# 也可 vi /etc/libvirt/qemu/suhw-test.xml
'''
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
'''
从配置文件启动虚机
root@controller:~# virsh create /etc/libvirt/qemu/suhw-test.xml
验证内存
连入虚机内部验证内存
root@Kylin:~# free -h
total used free shared buff/cache available
Mem: 7.9G 744M 6.6G 27M 550M 6.2G
Swap: 7.6G 0B 7.6G