码迷,mamicode.com
首页 > 其他好文 > 详细

2.5-调整cpu内存、网卡

时间:2016-03-21 01:54:15      阅读:125      评论:0      收藏:0      [点我收藏+]

标签: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  #在线增加网卡,重启失效。


如果要永久增加网卡,需要编辑配置文件,找到interface type的行,复制粘贴一行。

然后修改mac地址删除address type的行,防止冲突。退出保存。重启虚拟机。


2.5-调整cpu内存、网卡

标签:2.5-调整cpu内存、网卡

原文地址:http://llzdwyp.blog.51cto.com/6140981/1753262

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!