Ok, finally got it working, but I'm open to any simpler solution...
What I did (Please note that I'm new to Proxmox so I can't guarantee that my manipulations are "right", "safe" or "optimal") :
1) Detect the sockets qemu listening on
# qm monitor 101
qm> info chardev
which return something like
qmp: filename=unix:/var/run/qemu-server/101.qmp,server
I have only QMP socket listening, what means that I have to talk JSON to it.
2) Check the configuration created by the VE
Edit the VM config file
/etc/pve/qemu-server/101.conf
and add the disk:
virtio1: /dev/mapper/gueststorage-intrastorage,size=3500G
Hint: run
qm rescan
Run the VM normally,
ssh to the Host OS (Proxmos) and check the "footprint" of the running VM:
ps aux | grep qemu
Extract the options related to your drive. In my case it was something like:
-drive file=/dev/mapper/gueststorage-intrastorage,if=none,id=drive-virtio1,format=raw,cache=none,aio=native,detect-zeroes=on
-device virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb
3) Stop the VM, remove the drive line from the config, start the VM.
4) Try to attach the disk to the running VM
Run
socat on the socket and tell it to take the commands from stdin using "-":
socat -,echo=0,icanon=0 unix-connect:/var/run/qemu-server/101.qmp
you should get it waiting for the commands.
Feed it with JSON. The first command must be
{"execute":"qmp_capabilities"}
to switch it to the command mode. The others commands are "constructed" from the data found in (2).
Add the backend device (the physical support):
{"execute":"blockdev-add","arguments":{"driver":"raw","node-name":"drive-virtio1","file":{"driver":"file","filename":"/dev/mapper/gueststorage-intrastorage"}}}
Add the frontend device (device visible to the host):
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-virtio1","id":"virtio1","bus":"pci.0","addr":"0xb"}}
At this stage the blk/pci device should become visible in the guest OS. Check it with
lsblk, then
mount it ...
5) Put everything in a script file to automate the execution
Bash:
#!/usr/bin/sh
commands='{"execute":"qmp_capabilities"}
{"execute":"blockdev-add","arguments":{"driver":"raw","node-name":"drive-virtio1","file":{"driver":"file","filename":"/dev/mapper/gueststorage-intrastorage"}}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-virtio1","id":"virtio1","bus":"pci.0","addr":"0xb"}}'
echo "$commands" | socat - unix-connect:/var/run/qemu-server/101.qmp
Any suggestions are welcome...