您的位置:首页 > 其它

libvirt-qemu-虚拟机设备热插拔实践

2018-03-02 21:58 381 查看
[align=center](文章来自作者维护的社区微信公众号【虚拟化云计算】)
[/align]


cpu热插拔# virsh setvcpus $domain_name --count 4 --live (--config可写入配置文件永久保存)#前提条件和后续激活参考《libvirt-qemu-虚拟机cpu分配和cpu热插拔》
内存热插拔<memory model='dimm'>    <target>        <size unit='KiB'>524287</size>        <node>0</node>    </target></memory>#和doamin中格式相同# virsh attach-device $domain_name mem.xml (--config可写入配置文件永久保存)#前提条件和后续激活参考《libvirt-qemu-虚拟机内存分配和内存热插拔》
网卡热插拔<interface type='bridge'>      <mac address='52:54:00:2d:ea:aa'/>      <source bridge='br0'/>      <model type='virtio'/></interface>#和doamin中格式相同# virsh attach-device $domain_name interface.xml  (--config可写入配置文件永久保存)# virsh detach-device $domain_name interface.xml
磁盘热插拔<disk type='file' device='disk'>      <driver name='qemu' type='qcow2'/>      <source file='/tmp/test.img'/>      <target dev='vdd' bus='virtio'/></disk>#和doamin中格式相同# virsh attach-device $domain_name disk.xml (--config可写入配置文件永久保存)# virsh detach-device $domain_name disk.xml
USB设备<hostdev mode='subsystem' type='usb'>  <source>    <vendor id='0x096e'/>    <product id='0x0405'/>  </source></hostdev>#和doamin中格式相同# virsh attach-device $domain_name usb.xml (--config可写入配置文件永久保存)# virsh detach-device $domain_name usb.xml
PCI设备热插拔<hostdev mode='subsystem' type='pci' managed='yes'>    <source>        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>    </source></hostdev>#和doamin中格式相同# virsh attach-device $domain_name pci.xml (--config可写入配置文件永久保存)# virsh detach-device $domain_name pci.xml
[align=center]====================================================================[/align][align=center]关注微信公众号【虚拟化云计算】,阅读更多虚拟化云计算知识,纯技术干货更新不停。[/align][align=center][/align]

[align=center][/align]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: