KVM-調整虛機內存大小

查看內存大小

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章