Attach / Detach disk to VM


is it possible to re-attach already detached disk to VM ? (its the same disk - i.e. accidentaly detached) If yes how ?
Disk image is saved in VM’s directory on datastore after initial detach.



I would like to bump this topic.

It depends on the disk type, if it is persistent you will reattach the image with the same contents. If the backing image is not persistent it will be attached but on the initial state. Volatile disks will attached a clean device.

If you detached a non-persistent disk it may be in the VM folder (but this depends on the datastore type) and you could attached through the hypervisor for recovering purposes, but it will be transparent to OpenNebula.

Also, as alternative, if you have the image file you could register it as separate image (persistent is preferred) by importing it to OpenNebula.

Then attach it to the VM

Best Regards,
Anton Todorov