調整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 #線上增加網卡,重新開機失效。