12.2.
12.2.1. 复制链接链接已复制到粘贴板!
# virsh pool-list --all --details Name State Autostart Persistent Capacity Allocation Available default running yes yes 48.97 GiB 23.93 GiB 25.03 GiB Downloads running yes yes 175.62 GiB 62.02 GiB 113.60 GiB RHEL-Storage-Pool running yes yes 214.62 GiB 93.02 GiB 168.60 GiB
12.2.2. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'dir' supported='yes'"
# virsh pool-define-as guest_images_dir dir --target "/guest_images" Pool guest_images_dir defined# virsh pool-build guest_images_dir Pool guest_images_dir built # ls -la /guest_images total 8 drwx------. 2 root root 4096 May 31 19:38 . dr-xr-xr-x. 25 root root 4096 May 31 19:38 ..# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_dir inactive no# virsh pool-start guest_images_dir Pool guest_images_dir started注意# virsh pool-autostart guest_images_dir Pool guest_images_dir marked as autostarted
# virsh pool-info guest_images_dir Name: guest_images_dir UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.3. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'disk' supported='yes'"GRUB_DISABLE_OS_PROBER=trueGRUB_OS_PROBER_SKIP_LIST="5ef6313a-257c-4d43@/dev/sdb1"
# virsh pool-define-as guest_images_disk disk --source-format=gpt --source-dev=/dev/sdb --target /dev Pool guest_images_disk defined# virsh pool-build guest_images_disk Pool guest_images_disk built注意# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_disk inactive no# virsh pool-start guest_images_disk Pool guest_images_disk started注意# virsh pool-autostart guest_images_disk Pool guest_images_disk marked as autostarted
# virsh pool-info guest_images_disk Name: guest_images_disk UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.4. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'fs' supported='yes'"GRUB_DISABLE_OS_PROBER=trueGRUB_OS_PROBER_SKIP_LIST="5ef6313a-257c-4d43@/dev/sdb1"
# virsh pool-define-as guest_images_fs fs --source-dev /dev/sdc1 --target /guest_images Pool guest_images_fs defined# virsh pool-build guest_images_fs Pool guest_images_fs built # ls -la /guest_images total 8 drwx------. 2 root root 4096 May 31 19:38 . dr-xr-xr-x. 25 root root 4096 May 31 19:38 ..# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_fs inactive no# virsh pool-start guest_images_fs Pool guest_images_fs started注意# virsh pool-autostart guest_images_fs Pool guest_images_fs marked as autostarted
# virsh pool-info guest_images_fs Name: guest_images_fs UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB# mount | grep /guest_images /dev/sdc1 on /guest_images type ext4 (rw) # ls -la /guest_images total 24 drwxr-xr-x. 3 root root 4096 May 31 19:47 . dr-xr-xr-x. 25 root root 4096 May 31 19:38 .. drwx------. 2 root root 16384 May 31 14:18 lost+found
12.2.5. 复制链接链接已复制到粘贴板!
# gluster volume status Status of volume: gluster-vol1 Gluster process Port Online Pid ------------------------------------------------------------ Brick 222.111.222.111:/gluster-vol1 49155 Y 18634 Task Status of Volume gluster-vol1 ------------------------------------------------------------ There are no active volume tasks# setsebool virt_use_fusefs on # getsebool virt_use_fusefs virt_use_fusefs --> on
# virsh pool-capabilities | grep "'gluster' supported='yes'"
# virsh pool-define-as --name guest_images_glusterfs --type gluster --source-host 111.222.111.222 --source-name gluster-vol1 --source-path / Pool guest_images_glusterfs defined# virsh pool-list --all Name State Autostart -------------------------------------------- default active yes guest_images_glusterfs inactive no# virsh pool-start guest_images_glusterfs Pool guest_images_glusterfs started注意# virsh pool-autostart guest_images_glusterfs Pool guest_images_glusterfs marked as autostarted
# virsh pool-info guest_images_glusterfs Name: guest_images_glusterfs UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.6. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'iscsi' supported='yes'"
# virsh pool-define-as --name guest_images_iscsi --type iscsi --source-host server1.example.com --source-dev iqn.2010-05.com.example.server1:iscsirhel7guest --target /dev/disk/by-path Pool guest_images_iscsi defined# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_iscsi inactive no# virsh pool-start guest_images_iscsi Pool guest_images_iscsi started注意# virsh pool-autostart guest_images_iscsi Pool guest_images_iscsi marked as autostarted
# virsh pool-info guest_images_iscsi Name: guest_images_iscsi UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.7. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'logical' supported='yes'"
# virsh pool-define-as guest_images_lvm logical --source-name lvm_vg --target /dev/lvm_vg Pool guest_images_lvm defined# virsh pool-list --all Name State Autostart ------------------------------------------- default active yes guest_images_lvm inactive no# virsh pool-start guest_images_lvm Pool guest_images_lvm started注意# virsh pool-autostart guest_images_lvm Pool guest_images_lvm marked as autostarted
# virsh pool-info guest_images_lvm Name: guest_images_lvm UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.8. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "<value>nfs</value>"
# virsh pool-define-as --name guest_images_netfs --type netfs --source-host='111.222.111.222' --source-path='/home/net_mount' --source-format='nfs' --target='/var/lib/libvirt/images/nfspool'# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_netfs inactive no# virsh pool-start guest_images_netfs Pool guest_images_netfs started注意# virsh pool-autostart guest_images_netfs Pool guest_images_netfs marked as autostarted
# virsh pool-info guest_images_netfs Name: guest_images_netfs UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.9. 复制链接链接已复制到粘贴板!
# virsh pool-capabilities | grep "'scsi' supported='yes'"
# virsh pool-define-as guest_images_vhba scsi --adapter-parent scsi_host3 --adapter-wwnn 5001a4a93526d0a1 --adapter-wwpn 5001a4ace3ee047d --target /dev/disk/ Pool guest_images_vhba defined# virsh pool-list --all Name State Autostart ----------------------------------------- default active yes guest_images_vhba inactive no# virsh pool-start guest_images_vhba Pool guest_images_vhba started注意# virsh pool-autostart guest_images_vhba Pool guest_images_vhba marked as autostarted
# virsh pool-info guest_images_vhba Name: guest_images_vhba UUID: c7466869-e82a-a66c-2187-dc9d6f0877d0 State: running Persistent: yes Autostart: yes Capacity: 458.39 GB Allocation: 197.91 MB Available: 458.20 GB
12.2.10. 复制链接链接已复制到粘贴板!
# virsh pool-list --all Name State Autostart ------------------------------------------- default active yes Downloads active yes RHEL-Storage-Pool active yes# virsh pool-destroy Downloads Pool Downloads destroyed# virsh pool-delete Downloads Pool Downloads deleted# virsh pool-undefine Downloads Pool Downloads has been undefined
# virsh pool-list --all Name State Autostart ------------------------------------------- default active yes rhel-Storage-Pool active yes