KVM and libvirt: How to configure a new disc device to an existing VM?

0

I've got an Ubuntu 9.04 server running two VM's. In /etc/libvirt/qemu/machine1.xml two disk devices are defined like this:

<devices>
 <emulator>/usr/bin/kvm</emulator>
 <disk type='file' device='disk'>
   <source file='/vserver/machine1/disk0.qcow2'/>
   <target dev='hda' bus='ide'/>
 </disk>
 <disk type='file' device='disk'>
   <source file='/vserver/machine1/disk1.qcow2'/>
   <target dev='hdb' bus='ide'/>
 </disk>

I need more storage space in at least one of the devices and thought about adding a third hdc device by simply adding one with same style as above and re-organising my mount structure (The virtual sizes of the current qcow2 files are unfortunately limited.)

My problem is that reloading libvirtd and restarting the VM do not result in a new visible device (checked with fdisk).

I'm aware of extending an existing qcow2 file (converting to raw format, cat-ing/adding the new one, using smth. like gparted) - but only as a last resort.

Hopefully it's something very simple I'm missing?

initall

Posted 2011-02-28T09:50:07.727

Reputation: 131

Answers

0

IDE only allows for two controllers (primary and secondary) each with two devices (master and slave). A total of four IDE devices. You may already have a CD-ROM defined that is using one of those possibilities.

It may be that libvirt (used by KVM) likes to keep hard disks on the primary controller and thus is limited to two IDE disks.

You could play around with the <address> tag or try scsi emulation.

RedGrittyBrick

Posted 2011-02-28T09:50:07.727

Reputation: 70 632