15.5. 使用 CLI 管理虚拟机存储卷
您可以使用 CLI 管理存储卷的以下方面来为虚拟机分配存储:
15.5.1. 使用 CLI 查看存储卷信息 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用命令行,您可以查看主机上所有可用存储池的列表,以及指定存储池的详情
流程
使用
virsh vol-list命令列出指定存储池中的存储卷。# virsh vol-list --pool RHEL-Storage-Pool --details Name Path Type Capacity Allocation --------------------------------------------------------------------------------------------- .bash_history /home/VirtualMachines/.bash_history file 18.70 KiB 20.00 KiB .bash_logout /home/VirtualMachines/.bash_logout file 18.00 B 4.00 KiB .bash_profile /home/VirtualMachines/.bash_profile file 193.00 B 4.00 KiB .bashrc /home/VirtualMachines/.bashrc file 1.29 KiB 4.00 KiB .git-prompt.sh /home/VirtualMachines/.git-prompt.sh file 15.84 KiB 16.00 KiB .gitconfig /home/VirtualMachines/.gitconfig file 167.00 B 4.00 KiB RHEL_Volume.qcow2 /home/VirtualMachines/RHEL8_Volume.qcow2 file 60.00 GiB 13.93 GiB使用
virsh vol-info命令列出指定存储池中的存储卷。# virsh vol-info --pool RHEL-Storage-Pool --vol RHEL_Volume.qcow2 Name: RHEL_Volume.qcow2 Type: file Capacity: 60.00 GiB Allocation: 13.93 GiB