Think before you speak, read before you think.

kvm 静态及动态调整内存

关机升级内存

关机

virsh shutdown dim12zv4

编辑配置文件

virsh edit dim12zv4

找到

  4194304
  4194304

都要调整到 8GB
开机

virsh start dim12zv4

开机状态升级内存
只能提升 currentMemory,天花板是 memory 值

查看当前情况

virsh dominfo dim12zv4

Max memory:     8388608 KiB
Used memory:    4194304 KiB

调成 8G

virsh setmem dim12zv4 8388608

如果设置的值超过 max memory 会报错
error: invalid argument: cannot set memory higher than max memory

调整后及时生效。


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *