Cannot open KVM disk image

networker

New Member
Sep 6, 2011
2
0
1
Klagenfurt, Austria
Dear Proxmoxxers :)

maybe the answer to my question is already here around somewhere, but I did not yet find it. :( I have the following problem: I cannot start any KVM container anymore. It always reports that the target container disk file cannot be opened. Here an example output for starting a container:

=== begin output ===

myhost:~# /usr/bin/kvm -monitor unix:/var/run/qemu-server/105.mon,server,nowait -vnc unix:/var/run/qemu-server/105.vnc,password -pidfile /var/run/qemu-server/105.pid -daemonize -usbdevice tablet -name look2-win7 -smp 2 -vga cirrus -tdf -k en-us -drive file=/var/lib/vz/images/105/vm-105-disk-1.raw,if=ide,index=0,cache=none,boot=on -drive file=/var/lib/vz/template/iso/windows7_enterprise_de_32bit.iso,if=ide,index=2,media=cdrom -m 1024 -net tap,vlan=0,ifname=tap105i0,script=/var/lib/qemu-server/bridge-vlan -net nic,vlan=0,model=rtl8139,macaddr=36:5E:57:09:BB:C3 -id 105 -cpuunits 1000

qemu: could not open disk image /var/lib/vz/images/105/vm-105-disk-1.raw

=== end ===

Here the output of my pveversion:

=== begin output ===

myhost:~# pveversion -v
pve-manager: 1.8-18 (pve-manager/1.8/6070)
running kernel: 2.6.18-6-pve
proxmox-ve-2.6.18: 1.8-15
pve-kernel-2.6.18-2-pve: 2.6.18-5
pve-kernel-2.6.18-6-pve: 2.6.18-15
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.28-1pve1
vzdump: 1.2-14
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm-2.6.18: 0.9.1-15

=== end ===

The system worked fine until we had a power cut tonight.

Does somebody have an idea what may be wrong?

Regards,
Roland
 
power cut? probably you lost some data from your disk. do you have a UPS on your server, a BBU protected raid controller and harddrive cache disabled?

I assume no, otherwise this should not happen. do you have a backup?
 
thx for your replies!

yes, we have an UPS, but the cut lasted quite long due to fire in an electric distribution station. but I don't think that we lost data, since we operate a level 5 sw raid and there were no problems reported after restart. the disk files of all containers are available and readable.

BUT:

we operate a cluster with two nodes, lets name them host1 and host2. host2 is the controller of the cluster. host1 runs KVM containers 105 and 109. host2 runs 107.

if I now start container 107 on the controller host2 it results in:

===
host2:~# /usr/bin/kvm -monitor unix:/var/run/qemu-server/107.mon,server,nowait -vnc unix:/var/run/qemu-server/107.vnc,password -pidfile /var/run/qemu-server/107.pid -daemonize -usbdevice tablet -name look2-vpn.m3sys.uni-klu.ac.at -smp 1 -vga cirrus -tdf -k en-us -drive file=/var/lib/vz/images/107/vm-107-disk-1.raw,if=ide,index=0,cache=none,boot=on -drive file=/var/lib/vz/template/iso/ubuntu-10.04.2-server-amd64.iso,if=ide,index=2,media=cdrom -m 512 -net tap,vlan=0,ifname=tap107i0,script=/var/lib/qemu-server/bridge-vlan -net nic,vlan=0,model=rtl8139,macaddr=AA:84:41:61:0E:E4 -id 107 -cpuunits 1000

qemu: could not open disk image /var/lib/vz/images/107/vm-107-disk-1.raw
===

but the disk file exists!

===
host2:~# l /var/lib/vz/images/107/vm-107-disk-1.raw
-rw-r--r-- 1 root root 34359738368 Sep 6 01:31 /var/lib/vz/images/107/vm-107-disk-1.raw
===

the disk files for 105 and 109 are only located on host1, of course.

could it be that the value of parameter "cache" needs to be changed?
 
Last edited:
almost all hard disks has an internal cache enable by default (16 or 32 or 64 mb). but this cache is not protected from powerloss. so if you do not disabled this cache and you got a powerloss all data inside this cache is gone forever.

so you need to disable this cache to be on the save side - but you will see now that the overall performance is really bad. thats why you need a hardware raid with bbu and NOT sw raid.