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

Attaching more disks to running KVM instances can be quite useful, especially when using LVM inside the guest OS, as this allows for extending the logical volumes, thus adding more disk space on the go. Libvirt provides two different methods for this as we saw in the steps outlined earlier. We can use the virsh attach-disk command by passing the location of the image file and the name of the new block device for the guest VM as we saw in step 2.

In step 1, we created a new raw image using the dd command; however, we could have used the qemu-img tool as we saw in the Managing Disk images with qemu-img and dd recipe from Chapter 1, Getting Started with QEMU and KVM.

After attaching the new disk in step 2, in steps 3, 4, and ...

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