lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.82k stars 225 forks source link

Cannot attach block volume with custom name #1223

Closed madalinignisca closed 2 months ago

madalinignisca commented 2 months ago

Required information

Issue description

Trying to attach as per documentation instructions fails when trying to give the block volume a name. If volume is attached without a custom name, the virtual machine fails to start.

Steps to reproduce

  1. Create a dir storage pool (I do not know if it fails with other storage drivers, but since last Incus 6.5 update, lvm has not worked for me anymore when lvm is setup on NVME drives)

  2. Create a block volume incus storage volume create volumes ovs1data --type=block size=100GB

  3. Try to attach it to a virtual instance using the suggestion from documentation: incus storage volume attach <pool_name> <block_volume_name> <instance_name> <device_name> incus storage volume attach volumes custom/ovs1data ovs1 data

Result

Error: Failed add validation for device "custom/ovs1data": Custom block volumes cannot have a path defined

If I attach the volume without trying to give it a name, starting the vm fails with:

Error: Failed setting up device via monitor: Failed adding block device for disk device "custom/ovs1data": Failed adding device: The serial number can't be longer than 20 characters when it is also used as the default for device_id
Try `incus info --show-log ovs1` for more info

The log is empty.

Information to attach

madalinignisca commented 2 months ago

Forgive all the non-sense above. I did not know I can use only the volume name, after the namespace. I added the custom/ all the time as this is how they've been listed.