(1)查看物理機Free 比較大的硬盤
#df -Th
/dev/mapper/centos-home xfs 1.2T 55G 1.1T 5% /homedocker
(2)建立虛擬disk
#qemu-img create -f qcow2 /home/vm/dev-host-0001.img 100Gcentos
(3)添加disk到dev host
#virsh attach-disk dev /home/vm/dev-host-0001.img vdb --subdriver=qcow2app
我認爲,既然雲計算能夠動態添加硬盤無需重啓機器,對於kvm這麼牛逼的開源項目,確定也能夠動態添加無需重啓機器,subdriver參數能夠實現。雲計算
(4)查看添加disk狀況spa
(5)Dev主機的根分區爲lvmcode
# pvcreate /dev/vdb # vgextend centos /dev/vdb # lvextend -l +100%FREE /dev/mapper/centos-root
(6)Dev主機filesystem 爲 xfsip
#xfs_growfs /dev/mapper/centos-root