天天看点

2.5-调整cpu内存、网卡

调整cpu和内存

virsh edit  wyp1

修改:内存值和1CPU

  <memory unit='KiB'>524288</memory>

  <currentMemory unit='KiB'>524288</currentMemory>

  <vcpu placement='static'>1</vcpu>

为:内存值和2CPU

  <memory unit='KiB'>624288</memory>

  <currentMemory unit='KiB'>624288</currentMemory>

  <vcpu placement='static'>2</vcpu>

重启虚拟机:直接重启虚拟机不行,必须destroy重新加载虚拟机配置文件才行。

virsh destroy wyp1

virsh start wyp1

然后来查看是否修改成功。

free -m 

cat /proc/cpuinfo

不关机临时虚拟机增加网卡

virsh dominfo wyp1     #列出指定虚拟机的网卡设备列表

virsh attach-interface wyp1 --type bridge --source br0   #命令行增加一块网卡,类型桥接

执行ifconfig -a

发现多了一个网卡  eth1  #在线增加网卡,重启失效。

继续阅读