I have a VM running under kvm (it is a .img file), the server it runs on crashed hard and restarted and finally got things up... I think I goofed and ran
yum install -y qemu-kvm
Which I am sure updated a ton of stuff on a very old unpdated os. I had issues after this machine died having it see vms were there like the KVM itself (the image files were there but they were not 'registered' anywhere). Not sure how I got that back but all the VMS did virsh start but one...it gives an error:
[root@sdss4-server1 ~]# virsh start sdss-host2
setlocale: No such file or directory
error: Failed to start domain sdss-host2
error: unsupported configuration: Only a single IDE controller is supported for this machine type
Did my file get corrupted? Can I repair it? I would LOVE to get this VM running again as there was no backup and some of the data needs to get off it. (I thought I could mount .img files in linux somehow? but I tried the following)
kpartx -av sdsshost2.img
add map loop0p1 (253:2): 0 208782 linear /dev/loop0 63
add map loop0p2 (253:3): 0 10490445 linear /dev/loop0 208845
device-mapper: resume ioctl on loop0p3 failed: Invalid argument
create/reload failed on loop0p3
add map loop0p3 (0:0): 0 62916711 linear /dev/loop0 10699290
[root@sdss4-server1 vm-cache]# sudo mount /dev/mapper/loop0p2 /mnt/host2
mount: unknown filesystem type 'swap'
[root@sdss4-server1 vm-cache]# sudo mount /dev/mapper/loop0p1 /mnt/host2
(I think this is a boot and the files in it are:)
System.map initrd-2.4.21-27.0.2.EL.img vmlinux-2.4.21-27.0.2.ELsmp
System.map-2.4.21-27.0.2.EL initrd-2.4.21-27.0.2.ELsmp.img vmlinux-2.4.21-32.0.1.EL
System.map-2.4.21-27.0.2.ELsmp initrd-2.4.21-32.0.1.EL.img vmlinux-2.4.21-32.0.1.ELsmp
System.map-2.4.21-32.0.1.EL initrd-2.4.21-32.0.1.ELsmp.3w-9xxx.img vmlinuz-2.4.21-27.0.2.EL
System.map-2.4.21-32.0.1.ELsmp initrd-2.4.21-32.0.1.ELsmp.img vmlinuz-2.4.21-27.0.2.ELsmp
config-2.4.21-27.0.2.EL initrd-2.4.21-52.ELBOOT.img vmlinuz-2.4.21-32.0.1.EL
config-2.4.21-27.0.2.ELsmp kernel.h vmlinuz-2.4.21-32.0.1.ELsmp
config-2.4.21-32.0.1.EL message vmlinuz-2.4.21-52.ELBOOT
config-2.4.21-32.0.1.ELsmp message.ja
grub vmlinux-2.4.21-27.0.2.EL
Certainly not what I was looking for, it appears the loop0p3 is what I want to mount but the kpartx gives an error on that I do not understand fully.
So is my virtual drive/disk bad? Anything I can do to recover this some how?
The hosts definition file:
<domain type='kvm'>
<name>sdss-host2</name>
<uuid>36637cc5-63a1-4485-9a41-31afafb352dd</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<memoryBacking>
<hugepages/>
</memoryBacking>
<vcpu placement='static' cpuset='21'>1</vcpu>
<cputune>
<emulatorpin cpuset='21'/>
</cputune>
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode='custom' match='exact' check='partial'>
<model fallback='allow'>coreduo</model>
<vendor>Intel</vendor>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/vm-cache/sdsshost2.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdi'/>
<target dev='hdb' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='ide' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller>
<interface type='direct'>
<mac address='52:54:00:2d:d1:ee'/>
<source dev='enp4s0f0' mode='vepa'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='vga' vram='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>
Interesting. You do indeed have two IDE controllers defined, but both the virtual drives are using the first one. You should be able to safely remove the second IDE controller.
Specifically this node should be deleted: