Zombie recovery

I didn’t backup the sqlite one.db database properly and lost some data during recovery. Currently 1 of the VM’s I need shows up as a zombie on the host (“one-187”) as viewed in Sunstone or with “onehost show 4”. The VM is still functioning but does not appear with “onevm list”. I get an error running “onevm show 187”. However, I can go to the host in question and run the probe directly:

ubuntu@host4:/var/tmp/one/im/kvm-probes.d$ ./poll.sh
… [other VMs]…
POLL="STATE=a CPU=158.7 MEMORY=4757376 NETRX=397398327199 NETTX=96058190778 DISK_SIZE=[ ID=0, SIZE=4096 ] DISK_SIZE=[ ID=65, SIZE=20480 ] DISK_SIZE=[ ID=1, SIZE=0 ] SNAPSHOT_SIZE=[ ID=0, DISK_ID=0, SIZE=4096 ] " ]

My question is: I have an old one.db with the VM deployment information in vm_pool. Would it be possible to add this information to the current one.db? Does anyone know how to add the entries and would that fix the zombie issue?



We don’t have a procedure for this specific use case. Zombie VMs are meant to be a warning of a VMs that need manual clean-up, not to be re-imported. Ideally, you should create a new VM from scratch.

Having said that, you could try 2 things to recover that old VM:

Change the vm name in the hypervisor to anything other than ‘one-*’. This way, OpenNebula will detect it as a wild VM instead of a zombie VM. A wild VM can be imported, but it will have limited support. The images and vnets will not be associated to it, you will have limited life-cycle control, etc.

Edit the database to insert the individual row into the ‘vm_poll’ table. The onedb fsck tool will try to fix some common inconsistencies, but you should plan for the worst: do backups.

Again, let me be clear on this: this is not supported, things are likely to break. Do not modify or backup the DB while OpenNebula is running. Don’t forget to backup!

Good luck