# \[SOLVED\] Remove imported VMs

**URL:** <https://forum.opennebula.io/t/solved-remove-imported-vms/6936>\
**Category:** Installation & Configuration\
**Tags:** solved\
**Created:** [February 26, 2019, 6:18pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936 "2019-02-26T18:18:23Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Mazzino](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorge_mazzino/32/5928_2.png) [@Jorge\_Mazzino](https://forum.opennebula.io/u/Jorge_Mazzino)\
**Post date:** [February 26, 2019, 6:18pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/1 "2019-02-26T18:18:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [February 27, 2019, 11:05am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/2 "2019-02-27T11:05:36Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Jorge\_Mazzino](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorge_mazzino/32/5928_2.png) [@Jorge\_Mazzino](https://forum.opennebula.io/u/Jorge_Mazzino)\
**Post date:** [February 28, 2019, 3:26pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/3 "2019-02-28T15:26:53Z")

</div>

Excelent! It works 😃

---

<div class="post-metadata">

**Author:** ![jean\_michel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jean_michel/32/7311_2.png) [@jean\_michel](https://forum.opennebula.io/u/jean_michel)\
**Post date:** [March 4, 2022, 2:27pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/4 "2022-03-04T14:27:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [March 7, 2022, 8:24am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/5 "2022-03-07T08:24:16Z")

</div>

Hello @jean_michel,

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

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.opennebula.io/u/Pat)\
**Post date:** [April 6, 2022, 8:34am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/6 "2022-04-06T08:34:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [April 7, 2022, 1:44pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/7 "2022-04-07T13:44:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.opennebula.io/u/Pat)\
**Post date:** [April 7, 2022, 1:53pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/8 "2022-04-07T13:53:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sudhakar](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sudhakar](https://forum.opennebula.io/u/sudhakar)\
**Post date:** [April 18, 2022, 4:59am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/9 "2022-04-18T04:59:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [April 18, 2022, 7:58am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/10 "2022-04-18T07:58:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.opennebula.io/u/Pat)\
**Post date:** [April 19, 2022, 5:02am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/11 "2022-04-19T05:02:39Z")

</div>

Hi,

this worked for me. Thank you.

---

<div class="post-metadata">

**Author:** ![sudhakar](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sudhakar](https://forum.opennebula.io/u/sudhakar)\
**Post date:** [April 19, 2022, 12:32pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/12 "2022-04-19T12:32:40Z")

</div>

> [@ahuertas](#):
>
> Remove the tag `<IMPORTED>`

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

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [April 21, 2022, 2:57pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/13 "2022-04-21T14:57:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![David\_Martins](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/david_martins/32/7019_2.png) [@David\_Martins](https://forum.opennebula.io/u/David_Martins)\
**Post date:** [April 29, 2022, 8:32am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/14 "2022-04-29T08:32:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [May 10, 2022, 7:53am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/15 "2022-05-10T07:53:30Z")

</div>

Hello @David_Martins,

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

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![David\_Martins](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/david_martins/32/7019_2.png) [@David\_Martins](https://forum.opennebula.io/u/David_Martins)\
**Post date:** [May 23, 2022, 4:21pm UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/16 "2022-05-23T16:21:17Z")

</div>

Hi,

I’ve wait 15 days LOL.

Regards

---

<div class="post-metadata">

**Author:** ![Colm\_Ennis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/colm_ennis/32/5969_2.png) [@Colm\_Ennis](https://forum.opennebula.io/u/Colm_Ennis)\
**Post date:** [June 17, 2022, 10:58am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/17 "2022-06-17T10:58:19Z")

</div>

> [@ahuertas](#):
>
> You need to wait a few monitoring cycles until the VM is available again to be imported.

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?

Colm

---

<div class="post-metadata">

**Author:** ![Colm\_Ennis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/colm_ennis/32/5969_2.png) [@Colm\_Ennis](https://forum.opennebula.io/u/Colm_Ennis)\
**Post date:** [June 18, 2022, 8:07am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/18 "2022-06-18T08:07:50Z")

</div>

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

Looking at the VM delete workaround I used which came from [here](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/10):

> 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’;

Colm

---

<div class="post-metadata">

**Author:** ![David\_Martins](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/david_martins/32/7019_2.png) [@David\_Martins](https://forum.opennebula.io/u/David_Martins)\
**Post date:** [July 5, 2022, 10:02am UTC](https://forum.opennebula.io/t/solved-remove-imported-vms/6936/19 "2022-07-05T10:02:05Z")

</div>

> [@Colm\_Ennis](#):
>
> elete from vm\_import where vmid = ‘255’;

thank a lot !!! you resolv my issue

Kind regard
