Xen主機動態調整CPU和內存

宿主機爲24核cpu,64G內存,上面運行3臺guest,由於業務的不肯定性,不能提早肯定多大性能服務器可以支持,因此開機爲最小配置:4核 8G,之後隨着業務增加動態調整CPU和內存centos

cat centos1服務器

name = "centos1"ide

vcpus = 4性能

maxvcpus = 10spa

memory = 8192rest

maxmem = 24576內存

disk = [ "file:/var/xen/centos1.qcow2,"phy:/dev/sdc,xvdc,w"]it

vif = [ "bridge=br0","bridge=br1" ]class

on_reboot = "restart"配置

on_crash = "destroy"


修改內存:

xm mem-set centos1 16384     #調整centos1的內存爲16G

xm mem-set centos1 24576     #調整centos1的內存爲20G


修改cpu:

xm vcpu-list                            #查看cpu的使用

xm vcpu-set centos1 6            #修改centos1的cpu顆數


xm top                                   #查看當前各主機的狀態



快照,作快照須要關機

xm save centos1 centos1.save

xm shutdown centos1

xm restore centos1.save

相關文章
相關標籤/搜索