I have an qcow2 image and want to attach another disk to it.
# create new qcow2 disk
qemu-img create -f qcow2 vm-disk2 500G
Then I attach it as sdb:
virsh attach-disk myvm /var/lib/libvirt/images/vm-disk2 sdb --persistent --live --subdriver qcow2
Then reboot myvm, I don't see sdb in output:
sudo fdisk -l | grep '^Disk /dev/sd[a-z]'
#output: empty
But if I attach-disk with name vdb as below:
virsh attach-disk myvm /var/lib/libvirt/images/vm-disk2 vdb --persistent --live --subdriver qcow2
Then issue command after reboot:
sudo fdisk -l | grep '^Disk /dev/vd[a-z]'
#output:
# Disk /dev/vda: 42.2 GiB, 45311066112 bytes, 88498176 sectors
# Disk /dev/vdb: 500 GiB, XXXXXXXXX bytes, YYYYYYYYY sectors
Why I can't use sd* for attached disk? How to use sd* when attach disk to an kvm vm?