1. 以root身份登录host,创建image目录和iso目录
$ mkdir -p /VmImage
$ mkdir -p /VmIso
2.使用virsh定义VM image及OS iso存放目录
$virsh pool-define-as <Name> <Format> - - - - "Path"
$virsh pool-define-as VM-Image dir - - - - "/VmImage"
$virsh pool-define-as VM-Iso dir - - - - "/VmIso/"
3. 查看pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image inactive no
VM-Iso inactive no
4. start pool并设为autostart
$ virsh pool-start VM-Image
Pool VM-Image started
$ virsh pool-start VM-Iso
Pool VM-Iso started
$ virsh pool-autostart VM-Image
Pool VM-Image marked as autostarted
$ virsh pool-autostart VM-Iso
Pool VM-Iso marked as autostarted
5. 确认pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image active yes
VM-Iso active yes
$ mkdir -p /VmImage
$ mkdir -p /VmIso
2.使用virsh定义VM image及OS iso存放目录
$virsh pool-define-as <Name> <Format> - - - - "Path"
$virsh pool-define-as VM-Image dir - - - - "/VmImage"
$virsh pool-define-as VM-Iso dir - - - - "/VmIso/"
3. 查看pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image inactive no
VM-Iso inactive no
4. start pool并设为autostart
$ virsh pool-start VM-Image
Pool VM-Image started
$ virsh pool-start VM-Iso
Pool VM-Iso started
$ virsh pool-autostart VM-Image
Pool VM-Image marked as autostarted
$ virsh pool-autostart VM-Iso
Pool VM-Iso marked as autostarted
5. 确认pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image active yes
VM-Iso active yes