Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1228089
  • 博文数量: 389
  • 博客积分: 2874
  • 博客等级: 少校
  • 技术积分: 3577
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-24 10:34
文章分类

全部博文(389)

文章存档

2020年(2)

2018年(39)

2017年(27)

2016年(3)

2015年(55)

2014年(92)

2013年(54)

2012年(53)

2011年(64)

分类: 虚拟化

2014-12-29 16:34:55

  1. Create a temporary file with a disk definition like this one below.

    adjust the properties to fit your situation

    
      
      
      
     

    Tip: Peek into your current XML domain configuration and copy a section from there.

    virsh dumpxml  
  2. Now, before adding the disk to a current domain, make sure the required hotplug kernel modules are loaded in the guest.

    Some Linux distributions like recent CentOS/RHEL/Fedora have this built-in in the kernel. In this case, check for CONFIG_HOTPLUG_PCI_ACPI. If it's y, then you're all set and you can skip this step.

    modprobe acpiphp
    modprobe pci_hotplug 

    Consider adding these two modules to /etc/modules if you want them to be loaded on boot by default.

  3. Add the disk it to the running VM using

    virsh attach-device  /path/to/disk.xml 

    Optionally, add the --persistent option to let Libvirt update the domain XML definition 'persistent'.

  4. Finally, check inside the guest if the disk was indeed hotplug-inserted. The kernel should be triggered, as can be checked with dmesg:

    [  321.946440] virtio-pci 0000:00:06.0: using default PCI settings
    [...]
    [  321.952782]  vdb: vdb1 vdb2 

    In the above example I've added a disk as vdb with two partitions in the partition table.

阅读(2097) | 评论(0) | 转发(0) |
0

上一篇:3.10.21 rtl8188eus driver

下一篇:google镜像网站

给主人留下些什么吧!~~