Kvm virtualization learning notes (16)-kvm virtualization storage pool Configuration

Source: Internet
Author: User

KVM virtualization learning notes Series
----------------------------------------
Kvm virtualization learning notes (1) Installation of kvm virtualization environment
Http://koumm.blog.51cto.com/703525/1288795
Kvm virtualization learning notes (ii) Installation of linuxkvm Virtual Machine
Http://koumm.blog.51cto.com/703525/1289627
Kvm virtualization learning notes (iii) Windows Virtual Machine Installation
Http://koumm.blog.51cto.com/703525/1290191
Kvm virtualization learning notes (4) daily management and configuration of kvm virtual machines
Http://koumm.blog.51cto.com/703525/1290269
Kvm virtualization learning notes (5) Performance adjustment for windows virtual machines
Http://koumm.blog.51cto.com/703525/1290682
Kvm virtualization learning notes (6) kvm VM Console Logon Configuration
Http://koumm.blog.51cto.com/703525/1290996
Kvm virtualization learning notes (7) cloning of kvm virtual machines
Http://koumm.blog.51cto.com/703525/1291793
Kvm virtualization learning notes (8)-kvm Virtual Machine vnc Configuration
Http://koumm.blog.51cto.com/703525/1291803
Kvm virtualization learning notes (9)-kvm Virtual Machine Time Configuration
Http://koumm.blog.51cto.com/703525/1291862
Kvm virtualization learning notes (10) backup of kvm Virtual Machine snapshots
Http://koumm.blog.51cto.com/703525/1291893
Kvm virtualization learning notes (11): Expanding disk space using kvm virtual machines
Http://koumm.blog.51cto.com/703525/1292146
Kvm virtualization learning notes (12) Online disk expansion for kvmlinux virtual machines
Http://koumm.blog.51cto.com/703525/1295296

Kvm virtualization learning notes (13): kvm Virtual Machine Disk File Reading Summary
Http://koumm.blog.51cto.com/703525/1298845
Kvm virtualization Study Notes (14): kvm Virtual Machine static migration
Http://koumm.blog.51cto.com/703525/1298852
Kvm virtualization learning notes (15th): kvm Virtual Machine Dynamic migration
Http://koumm.blog.51cto.com/703525/1300783

Kvm virtualization learning notes (16)-kvm virtualization storage pool Configuration

Http://koumm.blog.51cto.com/703525/1304196

1. Create a folder-based storage pool directory)

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201310/2/703525_1380741331bOuI.png "height =" 203 "/>

2. Define the storage pool and Its Directory
# virsh pool-define-as vmdisk --type dir --target /data/vmfs

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201310/2/703525_1380741331OTeb.png "height =" 89 "/>

3. Create a defined storage pool (1) create a defined storage pool
# virsh pool-build vmdisk

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201310/2/703525_1380741332kHx8.png "height =" 96 "/>

(2) view the defined storage pool. The storage pool cannot be used if it is not activated.
#virsh pool-list --all

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/203214CM-3.png "height =" 148 "/>

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/2032143H1-4.png "height =" 167 "/>

4. Activate and automatically start the defined storage pool
# virsh pool-autostart vmdisk# virsh pool-start vmdisk

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/2032142K4-5.png "height =" 326 "/>

Here, the vmdisk storage pool has been created. You can create a virtual disk file directly in this storage pool.

5. Create a virtual machine storage volume in the storage pool (1) create a virtual machine storage volume in the storage pool
# virsh vol-create-as vmdisk oeltest03.qcow2 20G --format qcow2

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201310/2/703525_1380741338bfOS.png "height =" 139 "/>

(2) install the VM Based on the created VM storage volume
virt-install --name=oeltest03 --os-variant=RHEL6 --ram 1024 --vcpus=1 --disk path=/data/oeltest03.qcow2,format=qcow2,size=20,bus=virtio --accelerate --cdrom /data/iso/oel63x64.iso --vnc --vncport=5910 --vnclisten=0.0.0.0 --network bridge=br0,model=virtio –noautoconsole

The installation process is omitted. For more information about how to install linux on kvm, see http://koumm.blog.51cto.com/703525/1289627.

NOTE 1: The KVM storage pool is mainly a management method. You can create a storage pool by attaching the storage directory and lvm logical volume. After the VM storage volume is created, the remaining operations are no different from those without storage volumes.
Note 2: The KVM storage pool should also be used for VM migration tasks.

6. storage pool related management commands (1) create virtual machine storage volumes in the storage pool
# virsh vol-delete --pool vmdisk oeltest03.qcow2

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/20321452N-7.png "height =" 144 "/>

(2) Cancel activating the storage pool
# virsh pool-destroy vmdisk

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/203214CC-8.png "height =" 293 "/>

(3) Delete the storage pool definition directory/data/vmfs
# virsh pool-delete vmdisk

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/2032144340-9.png "height =" 303 "/>

(4) Cancel defining a storage pool
# virsh pool-undefine vmdisk

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px; "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/203214F59-10.png "height =" 281 "/>

Configuration and management of the kvm storage pool have been completed.

This article is from the "koumm linux technology blog" blog, please be sure to keep this source http://koumm.blog.51cto.com/703525/1304196

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.