This system CentOS 6.5 x64
The KVM platform manages storage in the form of a storage pool that can be understood as a local directory, allocated over a remote disk array (ISCSI, NFS), and, of course, a variety of distributed file systems.
The Virsh Pool command enables you to view, create, activate, register, and delete storage pools.
Note 1:KVM Storage pool is mainly a management mode, you can mount the storage directory, LVM logical volume to create a storage pool, virtual machine storage volume after the creation of the complete, the remaining operations and no storage volume of the way no difference.
Note 2:KVM storage pools are also used for virtual machine migration tasks.
This example uses a local directory to create a storage pool
1. Create a directory to create a storage pool
[Email protected]/]# Mkdir/data/vmdisk
2. Define Storage Pools
[[email protected]/]# virsh pool-define-as vmstoragepool--type dir--target/data/vmdisk/define pool Vmstoragepool
3. Create a storage pool
[[email protected]/]# Virsh pool-build vmstoragepool Build Pool Vmstoragepool
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/39/wKiom1XevfSQghHJAADg3ItYVXU891.jpg "title=" cc.jpg "alt=" Wkiom1xevfsqghhjaadg3ityvxu891.jpg "/>
4. Activate the storage pool and set up auto-start
[[email protected]/]# Virsh pool-start vmstoragepool[[email protected]/]# Virsh Pool-autostart vmstoragepool
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/36/wKioL1XewTGgyB59AALXCkKlhjA154.jpg "title=" cc.jpg "alt=" Wkiol1xewtggyb59aalxckklhja154.jpg "/>
5. Create Virtual disk space (storage volume) in the storage pool
[Email protected] vmdisk]# Virsh vol-create-as vmstoragepool vmtest.qcow2 6G--format qcow2
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/4D/wKiom1XgBwnzLFyGAAGR5dQhdNE034.jpg "title=" cc.jpg "alt=" Wkiom1xgbwnzlfygaagr5dqhdne034.jpg "/>
6. Create a virtual machine to point the storage space to the above disk space (storage volume)
Virt-install--name=vmtest--os-variant=rhel6--ram--vcpus=1--disk path=/data/vmdisk/vmtest.qcow2,format=qcow2, Size=6,bus=virtio--accelerate--cdrom=/iso/centos-6.5-x86_64-bin-dvd1.iso--vnc--vncport=5910--vnclisten=0.0.0.0 --network Bridge=br0,model=virtio--noautoconsole
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/4A/wKioL1XgCijz9e81AAGS8aW5SUc827.jpg "title=" cc.jpg "alt=" Wkiol1xgcijz9e81aags8aw5suc827.jpg "/>
7. Additional management commands for storage pools
Delete storage space (storage volume) in the storage pool
[Email protected] vmdisk]# Virsh vol-delete--pool vmstoragepool vmtest.qcow2
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/4D/wKiom1XgCqfxpzsEAADebA_loE0259.jpg "title=" cc.jpg "alt=" Wkiom1xgcqfxpzseaadeba_loe0259.jpg "/>
Deactivate a storage pool
[Email protected] vmdisk]# Virsh Pool-destroy vmstoragepool
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/4A/wKioL1XgDRSgo02VAAIB0rBGdz0613.jpg "title=" cc.jpg "alt=" Wkiol1xgdrsgo02vaaib0rbgdz0613.jpg "/>
Delete the definition directory used by the storage pool
[Email protected] vmdisk]# Virsh pool-delete vmstoragepool
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/4A/wKioL1XgDdyQM0rEAAHvuuY3tdw832.jpg "title=" cc.jpg "alt=" Wkiol1xgddyqm0reaahvuuy3tdw832.jpg "/>
The point is, the Vmdisk catalog is missing.
To cancel the definition of a storage pool
[Email protected] data]# Virsh pool-undefine vmstoragepool
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/4A/wKioL1XgDiKzHVn3AAFWUkqFZnk819.jpg "title=" cc.jpg "alt=" Wkiol1xgdikzhvn3aafwukqfznk819.jpg "/>
This article is from the "Big Wind" blog, please be sure to keep this source http://lansgg.blog.51cto.com/5675165/1690046
KVM (10) Virtual machine storage Pool