新建raw格式虚拟盘
[root@ubuntu ~]# qemu-img create -f raw /data/raw/disk02.raw 5G
Formatting '/data/raw/disk02.raw', fmt=raw size=5368709120
[root@ubuntu ~]# qemu-img info /data/raw/disk02.raw
image: /data/raw/disk02.raw
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 0
挂载到虚拟机
[root@ubuntu ~]# virsh attach-disk centosv6.5.23_01 [--source] /data/raw/disk02.raw sdb --subdriver=raw --live --config
Disk attached successfully
查看块设备
[root@ubuntu ~]# virsh domblklist centosv6.5.23_01
Target Source
------------------------------------------------
hda /data/raw/disk01.raw
hdc -
sdb /data/raw/disk02.raw
从虚拟机卸载虚拟盘
[root@ubuntu ~]# virsh detach-disk centosv6.5.23_01 [--target] sdc --live --config