[SOLVED] Remove imported VMs

Hi, hoping yo can give a hint!
Trying to “terminate-hard” an imported VM gives me:

“terminate-hard” is not supported for imported VMs

Any way to cleanup that imported VM?

We are using version 5.6.0 currently.

Thanks in advance!

Hi @Jorge_Mazzino

You can use onevm recover --delete <VM_ID> it will completely delete the VM. ( --delete No recover action possible, delete the VM)

Excelent! It works :smiley:

1 Like

Sorry to come back to an old post.
I have the same problem.
I always get the same error with this command for all imported vm’s.
I can import but after that nothing, neither delete, nor see via VNC.

Hello @jean_michel,

Did you get any error while importing? In what state is the VM imported?


I have the same issue now - ON 6.2.1 VM imported from VMWare - VMWare stuck in Hold

Even onevm recover -$ID --delete responds with Action “delete” is not supported for imported VMs

Hello @Pat,

Check the VM log located at /var/log/one/<VM_ID>.log and /var/log/one/oned.log to see if there are any errors related to the VM importation process. Maybe some VNC ports can’t be assigned and that’s the reason why the VM is left in HOLD state.


Thank you Alex,

unfortunately the VM_ID log is completely empty. And in the oned.log I just found the errors related to my failed deletion attempts.


couple of vm’s showing HOLD status , can you please help me how to resolve hold vms.
Always showing hold vms getting already vnc port used

Hello @Pat and @sudhakar,

If you try to import a VM with an already assigned VNC port, you need to first change the port in vCenter and then import it to OpenNebula.

In order to remove a VM in HOLD state:

  • onedb update-body vm --id <ID>
  • Remove the tag <IMPORTED>
  • onevm recover --delete-db <ID>



this worked for me. Thank you.

Hi patrick,
How to remove * Remove the tag <IMPORTED>

Hello @sudhakar,

When you run the command onedb update-body it will open an editor (VIM Nano etc) and then you just need to delete the row containing the IMPORTED tag.



I made all of the step and it’s working but i don’t see the virtual machine after on the wilds VM to re-import the virtual machine on OpenNebula.


Hello @David_Martins,

You need to wait a few monitoring cycles until the VM is available again to be imported.



I’ve wait 15 days LOL.


I’ve gone through the same process but deleted VMs are not appearing as wilds after several hours.

Any idea why they would not be appearing after many monitoring cycles?


After fiddling around for several hours, I eventually discovered a workaround here.

Looking at the VM delete workaround I used which came from here:

onedb update-body vm --id 255
Remove the tag IMPORTED
onevm recover --delete-db 255

Removal of the IMPORTED tag means that ‘–delete-db’ leaves behind a record in the the vm_import table which in turn prevents the VM from ever appearing as a wild.

To fix, I had to run the the following from the DB:

MariaDB [opennebula]> delete from vm_import where vmid = ‘255’;


1 Like

thank a lot !!! you resolv my issue

Kind regard