Error at startup after adding LVM disk

cosmos

Renowned Member
Apr 1, 2013
108
2
83
Hello,

I've a got a Linux VM running as follows:
Code:
balloon: 0
boot: cdn
bootdisk: ide1
cores: 2
ide1: local:106/vm-106-disk-1.qcow2
ide2: local:iso/Hiren's.BootCD.15.2.iso,media=cdrom,size=609268K
memory: 128
name: asystem
net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr0
numa: 0
ostype: l26
scsi0: images:vm-106-disk-1,size=20G
scsihw: pvscsi
smbios1: uuid=94dac97d-18f6-4132-b27f-cbbef3fd315f
sockets: 1

Boot disk is ide1, whereas scsi0 is used for storage, on my LVM "images". I now want to move the qcow to my images LVM storage as well. It seems I screwed things up somehow. I wanted to create specifically a 256M boot disk and I could not do that for LVM storage from within the GUI; it needed to specify 1G at least.

So I tried creating a lv images:vm-106-disk-2 by hand (ie, without using pvesm, which I found later on, but rather directly lvcreate) and then edited the vm conf file to insert a line as follows:
Code:
scsi1: images:vm-106-disk-2,size=256M

The problem is the the system would not start, throwing the following error:
Code:
kvm: -device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1: bad scsi device lun: 1
TASK ERROR: start failed: command '/usr/bin/kvm -id 106 -chardev 'socket,id=qmp,path=/var/run/qemu-server/106.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/106.pid -daemonize -smbios 'type=1,uuid=94dac97d-18f6-4132-b27f-cbbef3fd315f' -name XXXXXXXX  -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/106.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 128 -k en-us -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:f11a2b541815' -drive 'file=/var/lib/vz/images/106/vm-106-disk-1.qcow2,if=none,id=drive-ide1,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1,bootindex=100' -drive 'file=/var/lib/vz/template/iso/Hiren'\''s.BootCD.15.2.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -device 'pvscsi,id=scsihw0,bus=pci.0,addr=0x5' -drive 'file=/dev/vmstorage/vm-106-disk-1,if=none,id=drive-scsi0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0' -drive 'file=/dev/vmstorage/vm-106-disk-2,if=none,id=drive-scsi1,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1' -netdev 'type=tap,id=net0,ifname=tap106i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=XX:XX:XX:XX:XX:XX,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1

I removed the line scsi1 from configuration and removed the lv as well. The system booted up fine. Then I found out the pvesm command. While the VM was stopped, I used the following:
Code:
# pvesm alloc images 106 '' 256M
  Logical volume "vm-106-disk-2" created.
successfully created 'images:vm-106-disk-2'

At this point, I expected that the vm configuration would be updated to reflect this change, but nothing happened. I had to manually edit the .conf, by adding the following:
Code:
scsi1: images:vm-106-disk-2,size=256M

Trying to start the VM throwed the following:
Code:
kvm: -device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1: bad scsi device lun: 1
start failed: command '/usr/bin/kvm -id 106 -chardev 'socket,id=qmp,path=/var/run/qemu-server/106.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/106.pid -daemonize -smbios 'type=1,uuid=94dac97d-18f6-4132-b27f-cbbef3fd315f' -name XXXXXX -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/106.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 128 -k en-us -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:f11a2b541815' -drive 'file=/var/lib/vz/images/106/vm-106-disk-1.qcow2,if=none,id=drive-ide1,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1,bootindex=100' -drive 'file=/var/lib/vz/template/iso/Hiren'\''s.BootCD.15.2.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -device 'pvscsi,id=scsihw0,bus=pci.0,addr=0x5' -drive 'file=/dev/vmstorage/vm-106-disk-1,if=none,id=drive-scsi0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0' -drive 'file=/dev/vmstorage/vm-106-disk-2,if=none,id=drive-scsi1,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1' -netdev 'type=tap,id=net0,ifname=tap106i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=XX:XX:XX:XX:XX:XX,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1

Any idea what might be wrong here?
 
Code:
scsihw: virtio-scsi-pci
Try to change your scsi controller to the above.
 
The Linux distro is TheDude which unfortunately refused to boot with its disk boot image set to something other than either IDE or PVSCSI. The bottom line is that I might be able to resolve the problem described in this thread by moving to Virtio scsi for the new disk, but I intended to clone the boot image to a SCSI boot disk. Hence for trying to attach here a second pvscsi disk.

What's very curious here is that last observation: a single pvscsi disk works just fine!
 
I'll give it a try. However, do you have any idea why the issue with my pvscsi config might occur? Could I do some troubleshooting to help you debug this?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!