kvm热添加和热迁移
生活随笔
收集整理的這篇文章主要介紹了
kvm热添加和热迁移
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
a.熱添加磁盤
1.創建磁盤
qemu-img create -f qcow2 web01-add01.qcow2 5G2.附加磁盤設備
virsh attach-disk web01 /opt/web01-add01.qcow2 vdb --live --cache=none --subdriver=qcow23.格式化磁盤
mkfs.xfs /dev/vdb4.掛載
mount /dev/vdb /data磁盤擴容
1.卸載掛載磁盤
umount /dev/vdb2.分離磁盤設備
virsh detach-disk web01 vdb3.增加磁盤大小
qemu-img resize web01-add01.qcow2 +3G?4.掛載
mount /dev/vdb /data5.重新分配磁盤空間
xfs_growfs /dev/vdb?
b.熱添加網卡
virsh attach-interface web01 --type network --model virtio --source default #添加nat模式網卡 virsh attach-interface web01 --type bridge --model virtio --source br0 #添加橋接網卡或修改配置文件
virsh edit web01 <interface type='bridge'><mac address='52:54:00:45:02:55'/><source bridge='br0'/><model type='virtio'/><address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/></interface><interface type='network'><source network='default'/><model type='virtio'/></interface>?
c.熱添加CPU
安裝參數
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name web01 --memory 1024 --vcpus 1,maxvcpus=4 --disk /opt/web01.qcow2,format=qcow2,size=10 --boot hd --network bridge=br0 --graphics vnc,listen=0.0.0.0 --noautoconsole添加CPU
virsh setvcpus web01 --count=2?
d.熱添加內存
安裝參數
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name web01 --memory 1024,maxmemory=4096 --vcpus=1,maxvcpus=4 --disk /opt/web01.qcow2,format=qcow2,size=10 --boot hd --network bridge=br0 --graphics vnc,listen=0.0.0.0 --noautoconsole添加內存
virsh setmem web01 2G?
轉載于:https://www.cnblogs.com/omgasw/p/10597817.html
總結
以上是生活随笔為你收集整理的kvm热添加和热迁移的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: js屏蔽鼠标操作
- 下一篇: APICloud学习第二天——操作云数据