Attach / detach disks to running vms under libvirt

You can hot add disks to running vm with virsh with the following command:

virsh attach-disk VMNAME /dev/mapper/VG-testdisk vdb

You can although use the parameter –persistent. This will write the new disk to the VMs config.

If you want remove the disk you can use this command:

virsh attach-disk VMNAME --target vdb

Leave a Reply

Your email address will not be published. Required fields are marked *