its throwing this error. can you please shed some light on this error message and point me to a fix?
Failed to execute virtualization driver operation: attach_disk.
[Z0][VMM][E]: ATTACHDISK: ERROR: attach_disk: Command “set -e -o pipefail virsh --connect qemu:///system attach-device 3dbd3c37-26d3-4fa5-9b08-51232f54fcb <( cat <<EOT EOT )” failed: error: Failed to attach device from /dev/fd/63 error: internal error: unable to execute QEMU command ‘blockdev-add’: ‘file’ driver requires ‘/dev/vg-nvme0n1/lv-vm1-disk1’ to be a regular file Could not attach /dev/vg-nvme0n1/lv-vm1-disk1 (sdb) to 3dbd3c37-26d3-4fa5-9b08-xxx ExitCode: 1
–
I also tried changing /dev/vg-nvme0n1/lv-vm1-disk1 to /dev/sdb (assuming that is the block device reference used for the VM itself and not the node).
getting the same error
internal error: unable to execute QEMU command ‘blockdev-add’: ‘file’ driver requires ‘/dev/sdb’ to be a regular file Could not attach /dev/sdb (sdb)
it will be helpful to understand the error itself.
what we are trying to do is adding a block device. but OpenNebula expect is to be a regular file?
keywords: “block device”, “raw”, “LVM”, “Unknown disk name”, “add additional disk to the VM”, “add additional disk to the VM while its running”
According to the CLI help, you should use --format raw instead of --driver raw:
...
## OPTIONS
-d, --datastore id|name Selects the datastore
--description description Description for the new Image
--disk_type disk_type Type of the image BLOCK, CDROM, RBD or FILE (for
others, check the documentation)
--dry Just print the template
--format format Format of the image (raw, qcow2, ...)
--fs filesystem Filesystem to format the image (ext4, xfs, ...)
--name name Name of the new image
--no_check_capacity Do not check Datastore capacity, only for admins.
--path path Path of the image file
...
Also, --disk_type BLOCK should register the device as a block device so ONE knows it should be presented to libvirt as such.