KVM virtualization storage pool Configuration

Source: Internet
Author: User
  1. Define the storage pool directory

[[Email protected] kvmimg] # virsh pool-define-as vmdisk -- type dir -- target/data/kvmimg/pool vmdisk defined2. create a defined storage pool [[email protected] kvmimg] # virsh pool-build vmdiskpool vmdisk built

3. view the defined storage pool. The storage pool cannot be used if it is not activated.

[[Email protected] kvmimg] # virsh pool-list -- all # view all storage pool names autostart defaults active Yes vmdisk inactive no [[email protected] kvmimg] # [email protected] kvmimg] # virsh pool-Info vmdisk # view vmdisk storage pool information Name: vmdiskuuid: 6e80ce65-c13c-aac2-02fe-c370b64631_state: inactivepersistent: yesautostart: No

4. Activate and automatically start the defined storage pool

[[email protected] kvmimg]# virsh pool-autostart vmdiskPool vmdisk marked as autostarted[[email protected] kvmimg]# virsh pool-start vmdiskPool vmdisk started[[email protected] kvmimg]# virsh pool-info vmdisk     Name:           vmdiskUUID:           6e80ce65-c13c-aac2-02fe-c370b6463109State:          runningPersistent:     yesAutostart:      yesCapacity:       774.28 GiBAllocation:     55.51 GiBAvailable:      718.78 GiB[[email protected] kvmimg]# virsh pool-list --all      Name                 State      Autostart -----------------------------------------default              active     yes       vmdisk               active     yes

5. Create a qcow2 VM storage volume in the storage pool, and then you can directly use the qcow2 disk file to install the system.

[[Email protected] kvmimg] # virsh vol-create-as vmdisk test06.qcow2 20g -- format qcow2 vol test06.qcow2 created6. Delete storage pool command to organize [[email protected] kvmimg] # virsh vol- delete -- pool vmdisk test06.qcow2 # Delete the created vol test06.qcow2 deleted [[email protected] kvmimg] # lltotal deleted -- r -- 1 Root 17911579136 Jul 7 test01.qcow2-RW-r -- r -- 1 Root 37823512576 Jul 7 test02.qcow2-rwxr-XR-x 1 Root 17911578624 Jul 7 test03.qcow2-rwxr-XR-x 1 Root 17911513088 Jul 7 test04.qcow2-RW- r -- 1 Root 17911578624 Jul 7 test05.qcow2 [[email protected] kvmimg] # [[email protected] kvmimg] # virsh pool-destroy vmdisk # cancel the activation of the storage pool [[ email protected] kvmimg] # virsh pool-delete vmdisk # Delete the directory defined by the storage pool/data/kvmimg [[email protected] kvmimg] # virsh pool-undefine vmdisk # cancel the definition of the storage pool


This article from the "feet of traces" blog, please be sure to keep this source http://dingmh.blog.51cto.com/188555/1435778

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.