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]
[/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]
相关文章推荐
- libvirt-qemu-虚拟机设备热插拔
- libvirt-qemu-虚拟机cpu分配和cpu热插拔
- 使用libvirt和qemu将pci pass through设备添加到虚拟机上
- 使用libvirt和qemu将pci pass through设备添加到虚拟机上
- 使用libvirt和qemu将pci pass through设备添加到虚拟机上
- 【虚拟机】虚拟化技术以及KVM、QEMU与libvirt介绍
- libvirt-qemu-虚拟机qos控制
- QEMU KVM Libvirt手册(8): 半虚拟化设备virtio
- libvirt-qemu-用cgroup对虚拟机进行资源分割
- Ubuntu 下安装kvm, qemu, libvirt,并新建虚拟机的过程
- [libvirt]快速查找虚拟机对应的vnet设备
- 虚拟机提示:无法打开内核设备“\\.\Global\vmx86”: 系统找不到指定的文件
- 解决虚拟机中安装的mac os系统无法识别ios设备的问题
- zabbix 设备(自己的实践)
- openstack, kvm, qemu-kvm以及libvirt之间的关系
- libvirt api 虚拟机动态迁移代码示例(非共享存储)
- libvirt 虚拟机迁移配置
- QEMU KVM Libvirt手册(10): KVM的各种限制
- QEMU-KVM自己主动创建虚拟机,以指定IP构造
- qemu,kvm,qemu-kvm,xen,libvirt的区别