KVM调整cpu和内存

一.修改kvm虚拟机的配置

1、virsh edit centos7 找到“memory”和“vcpu”标签,将 <name>centos7</name> <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> 改为: <name>centos7</name> <uuid>2220a6d1-a36a-4fbb-8523-e078b3dfe795</uuid> <memory unit='KiB'>3145728</memory> <currentMemory unit='KiB'>3145728</currentMemory> <vcpu placement='static'>2</vcpu>
 
 重定义使配置生效
virsh define /etc/libvirt/qemu/centos7.xml

启动虚拟机

virsh start centos7

调整前虚拟机信息

[root@localhost kvm]# virsh dominfo centos7
Id:             -
Name:           centos7
UUID:           2220a6d1-a36a-4fbb-8523-e078b3dfe795
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     2097152 KiB
Used memory:    2097152 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0

调整后虚拟机信息

[root@localhost kvm]# virsh dominfo centos7
Id:             -
Name:           centos7
UUID:           2220a6d1-a36a-4fbb-8523-e078b3dfe795
OS Type:        hvm
State:          shut off
CPU(s):         2
Max memory:     3145728 KiB
Used memory:    3145728 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0

  

  

  

   
 
 
 

  

转载于:https://www.cnblogs.com/jimmy-xuli/p/9152651.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值