How to skip some disk on vm boot

farahei14

New Member
Jul 20, 2013
4
0
1
Hi,

I've been testing proxmox ve 3.0 for about 2 weeks. I have solve most problems with the help of internet.
Unfortunately, I'm hitting a wall and I can't find any solution to my problem. I've got all the latest stable updates.

I'm testing proxmox on a Dell t310 with an RD1000 as backup (you can mount it like a hard drive).
I need to make the RD1000 available to my vm, so I add it with the following command:
# qm set 100 -sata1 /dev/sdb,media=disk,backup=no

Is there a command to remove the entry made by the previous command or do you have to manually remove it by hand in <vmid>.conf?


Everything work fine except, when I eject the RD1000 and start the vm. It refuse to boot because it can't find /dev/sdb.
Here is my <vmid>.conf:

boot: cdn
bootdisk: virtio0
cores: 1
cpuunits: 1500
ide2: local:iso/eole-2.3.9-alternate-amd64.iso,media=cdrom,size=665726K
keyboard: fr
machine: pc-i440fx-1.4
memory: 1024
name: amonecole
net0: virtio=3A:4D:99:02:89:4D,bridge=vmbr0
net1: virtio=16:FD:19:07:78:E2,bridge=vmbr1
onboot: 1
ostype: l26
parent: after_gen_conteneurs
sata0: /dev/sdb,media=disk,backup=no,size=488382488K
sockets: 1
virtio0: local:100/vm-100-disk-1.qcow2,format=qcow2

This is the error returned:
kvm: -drive file=/dev/sdb,if=none,id=drive-sata0,media=disk,aio=native,cache=none: could not open disk image /dev/sdb: No medium found
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -vnc unix:/var/run/qemu-server/100.vnc,x509,password -pidfile /var/run/qemu-server/100.pid -daemonize -name amonecole -smp 'sockets=1,cores=1' -nodefaults -boot 'menu=on' -vga cirrus -k fr -m 1024 -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' -drive 'file=/dev/sdb,if=none,id=drive-sata0,media=disk,aio=native,cache=none' -device 'ide-drive,bus=ahci0.0,drive=drive-sata0,id=sata0' -drive 'file=/var/lib/vz/template/iso/eole-2.3.9-alternate-amd64.iso,if=none,id=drive-ide2,media=cdrom,aio=native' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,aio=native,cache=none' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=101' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,vhost=on' -device 'virtio-net-pci,mac=3A:4D:99:02:89:4D,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' -netdev 'type=tap,id=net1,ifname=tap100i1,script=/var/lib/qemu-server/pve-bridge,vhost=on' -device 'virtio-net-pci,mac=16:FD:19:07:78:E2,netdev=net1,bus=pci.0,addr=0x13,id=net1,bootindex=301' -machine 'type=pc-i440fx-1.4'' failed: exit code 1

Is there a way to skip this drive at boot if it's not in the device and continue booting process on the system disk (virtio0)?

Is there a way to execute some preboot/afterstop script when a vm start or is shutdown?

Best regards,
 
quote_icon.png
Originally Posted by farahei14

Is there a way to skip this drive at boot if it's not in the device and continue booting process on the system disk (virtio0)?

# qm set 100 -delete sata1

Thank you for your help. I just poorly explain what I want to do.
I need to keep the sata1 device in the vm to be able to do backup, so it have to be there after boot of the vm (can't delete it). But just in case the guy who's in charge to replace the drive (RD1000 know as sata1 in vm) forgot to put back one in the device, I want to be able to still boot the virtual machine (Something like an usb drive who can be there or not and don't interfere with the boot).

I'm looking for a way to bypass the check of this device at boot and continu booting on the system disk know as virtio0.
Is it technically possible?

Best regards,
 
Maybe you can use 'virtio1' instead of 'sata1', so 'virtio0' is always considered first at boot.
 
Putting the drive on virtio1 doesn't work. It still need to have a drive in slot to boot or else it failed.
Thank you anyway.
 
maybe hotplug can help here (search forum), but this is not enabled by default (not 100% stable on all OS)
 

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!