[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?

Best,
Álex.

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.

Best,
Álex.

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.

Cheers,
Patrick

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>

Best,
Álex.

Hi,

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.

Best,
Álex.

hi,

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.

Regard

Hello @David_Martins,

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

Best,
Álex.