Canonical Voices

Posts tagged with 'kvm'

mandel

This is here for me to remember the next time I need to do this task:

  1. Copy the default pool definition:

    virsh pool-dumpxml default > pool.xml
  2. edit pool.xml changing the following vars:

    <pool type='dir'>
      <name>{$name}</name>
      <uuid>{$id}</uuid>
      <capacity>43544694784</capacity>
      <allocation>30412328960</allocation>
      <available>13132365824</available>
      <source>
      </source>
      <target>
        <path>{$path}</path>
        <permissions>
          <mode>0700</mode>
          <owner>-1</owner>
          <group>-1</group>
        </permissions>
      </target>
    </pool>
  3. virsh pool-create pool.xml
  4. virsh pool-refresh name

Doing the above you can add a new pool, for example one that is not in you ssd.

Read more
mandel

I use KVM daily for testing purposes of Ubuntu One on Windows. Recetly I created a Vista VM with 20Gb thinking that it was going to be big enough, turns out that after installation I had a single Gb left (WTF!). Not wanting to have to go through the painful installation process again I decided to find out how to re-size a KVM disk image. Here are the steps if you have to do the same:

  1. Create a new image with the extra size

    sudo qemu-img create -f raw addon.raw 30G
  2. Add the new data, my old vm image is called caranage_old.img. Do remember the order is important, otherwise the image won’t boot.

    cat carnage_old.img addon.raw >> carnage.img
  3. Create a new vm that uses the new image and resize the hardrive accordingly. For example, on Windows Vista I had to go to Mamangement Tools and resize the C: partition to use the new 30Gb.
  4. I hope it helps!

    Read more