O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

The following steps demonstrate how to create a new storage pool, inspect it, and assign it to a virtual machine:

  1. Copy the raw Debian image file we created in the Building new KVM instances with virt-install and using the console recipe earlier in this chapter:
root@kvm:~# cp /tmp/kvm1.img /var/lib/libvirt/images/root@kvm:~#
  1. Create the following storage pool definition:
root@kvm:~# cat file_storage_pool.xml<pool type="dir"> <name>file_virtimages</name> <target>   <path>/var/lib/libvirt/images</path> </target></pool>root@kvm:~#
  1. Define the new storage pool:
root@kvm:~# virsh pool-define file_storage_pool.xmlPool file_virtimages defined from file_storage_pool.xmlroot@kvm:~#
  1. List all storage pools:
root@kvm:~# virsh ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required