physical disk to vm (kvm) error on encrypted disk

G

gandalfk7

Guest
hi!
I wanted to map a physical disk to one of my vms, a kvm one.
I used the command
Code:
qm set 100 -sata0 /dev/disk/by-uuid/MYUUID
the usb disk is encrypted with luks

the error I get is:
Code:
[FONT=tahoma]kvm:[/FONT][FONT=tahoma] -drive file=/dev/disk/by-uuid/MYUUID,if=none,id=drive-sata0,aio=native,cache=none: could not open disk image /dev/disk/by-uuid/MYUUID: Invalid argument
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 gnd-deb02 -smp 'sockets=1,cores=1' -nodefaults -boot 'menu=on' -vga cirrus -k it -m 2048 -cpuunits 1000 -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' -drive 'file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,aio=native,cache=none' -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100' -device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' -drive 'file=/dev/disk/by-uuid/MYUUID,if=none,id=drive-sata0,aio=native,cache=none' -device 'ide-drive,bus=ahci0.0,drive=drive-sata0,id=sata0' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge' -device 'e1000,mac=MYMACADDRESS,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1
[/FONT]

I can't understand what I am doing wrong,
on another host I already did it with a non encrypted disk,
the operation above should map the UUID to the vm and I should do all the encryption tasks on the vm, right?

I already tried virtio0 and ide1, my configfile of the vm:
Code:
bootdisk: ide0
cores: 1
ide0: local:100/vm-100-disk-1.qcow2,format=qcow2,size=32G
memory: 2048
name: gnd-deb02
net0: e1000=MYMACADDRESS,bridge=vmbr0
ostype: l26
sockets: 1
sata0: /dev/disk/by-uuid/MYUUID,size=2861556M

thank you very much

Matteo
 
Please try another cache setting (writeback) for that disk.

the setting I have to change is "cache=writeback",
would it be ok to do:
Code:
sata0: /dev/disk/by-uuid/MYUUID,[B]cache=writeback[/B],size=2861556M

thank you


Matteo
 
You can change that on the GUI.

hi!
I changed the cache to cache=writeback via GUI and now it works correctly!
thank you very much!!

before it was in default = none,
do you know why it wasn't working?

thank you again!


Matteo
 

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!