Recover a VM when missing its definition

In the case that, for whatever reason that might involve an unrecoverable hardware fault, you lost a VM definition for a virtual machine but you still have the VMs root disk in a shared datastore, you can still recover it using this general approach.

Abiquo creates a new VM definition whenever the VM is deployed, but if you are reading disk, you might want to recover a VM that was already deployed. To do so, you need to force a "DEPLOY" operation over the VM, but as you can't undeploy it (because it does not exists in you hypervisors), you need to do so through database updates.

First thing, you need to locate the VM's UUID:


With this, you can go to your shared datastore and rename the disk it is using, that will be named:


if it is a KVM or


If it is ESX. Note that for ESX you might will have to save ABQ_<uuid>.vmdk and ABQ_<uuid>-flat.vmdk. Just rename the files so they don't get overwritten.

Then, you need to change the state of the VM in the MySQL database to 'NOT_ALLOCATED':

mysql> UPDATE virtualmachine SET state = 'NOT_ALLOCATED' WHERE uuid = '8820b74c-f0a4-4969-b9bc-f1c5ed02303c';

And now you will be able to deploy the VM again (just deploy de vApp if it is the only VM in it or update running appliance if there are more VMs).

When the VM has deployed successfully, just power it off, rename the original disk files to its original name, and power on the VM again.


Please sign in to leave a comment.