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...

To create, inspect and assign volumes to an instance, run the following:

  1. List the available storage pools:
root@kvm:~# virsh pool-list --all Name            State  Autostart------------------------------------------- file_virtimages active yesroot@kvm:~#
  1. List the available volumes, that are a part of the storage pool:
root@kvm:~# virsh vol-list file_virtimages Name     Path-------------------------------------------------------------------- kvm1.img /var/lib/libvirt/images/kvm1.imgroot@kvm:~#





 

 

  1. Create a new volume with the specified size:
root@kvm:~# virsh vol-create-as file_virtimages new_volume.img 9GVol new_volume.img createdroot@kvm:~#
  1. List the volumes on the filesystem:
root@kvm:~# ls -lah /var/lib/libvirt/images/

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