# Hi. is it possible to remove a vm from opennebula without removing from vcenter?

**URL:** <https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391>\
**Category:** Product Support\
**Created:** [June 28, 2019, 5:09am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391 "2019-06-28T05:09:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 28, 2019, 5:09am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/1 "2019-06-28T05:09:19Z")

</div>

## Please, describe the problem here and provide additional information below (if applicable) … meaning, just remove it from the opennebula inventory

**Versions of the related components and OS (frontend, hypervisors, VMs):**

**Steps to reproduce:**

**Current results:**

**Expected results:**

---

<div class="post-metadata">

**Author:** ![cgonzalez](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cgonzalez/32/7096_2.png) [@cgonzalez](https://forum.opennebula.io/u/cgonzalez)\
**Post date:** [June 28, 2019, 6:53am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/2 "2019-06-28T06:53:16Z")

</div>

Hello @Liorme,

Yes, it is possible. You can use this command `onevm recover --delete-db`.

---

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 28, 2019, 6:58am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/3 "2019-06-28T06:58:57Z")

</div>

cool. what’s the full syntax?  
say that the vm is called “opennebula”

---

<div class="post-metadata">

**Author:** ![cgonzalez](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cgonzalez/32/7096_2.png) [@cgonzalez](https://forum.opennebula.io/u/cgonzalez)\
**Post date:** [June 28, 2019, 2:47pm UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/4 "2019-06-28T14:47:41Z")

</div>

In that case the command would be `onevm recover --delete-db opennebula`

Please note that you can always use the --help option to check the command parameters.

---

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 28, 2019, 2:51pm UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/5 "2019-06-28T14:51:08Z")

</div>

No such command there. Only --delete, without the db

---

<div class="post-metadata">

**Author:** ![cgonzalez](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cgonzalez/32/7096_2.png) [@cgonzalez](https://forum.opennebula.io/u/cgonzalez)\
**Post date:** [June 28, 2019, 3:09pm UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/6 "2019-06-28T15:09:44Z")

</div>

Which OpenNebula version are you using?

---

<div class="post-metadata">

**Author:** ![jamdev12](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@jamdev12](https://forum.opennebula.io/u/jamdev12)\
**Post date:** [June 28, 2019, 4:39pm UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/7 "2019-06-28T16:39:43Z")

</div>

I believe if I’m correct, if you rename the VM in vCenter, when you try to delete it from OpenNebula, it will send the command and assume vCenter deleted it, but it will still exist, but the machine will disappear from OpenNebula. I’ve done this with 5.4 and below. Just create a VM, once it’s instantiated, rename it in vCenter, then delete it from OpenNebula.

---

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 29, 2019, 6:22am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/8 "2019-06-29T06:22:33Z")

</div>

5.6.1 is the version

---

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 29, 2019, 6:24am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/9 "2019-06-29T06:24:17Z")

</div>

yeah, i know what you mean  
my workaround so far, is to limit the permissions of the vcenter user so it can’t delete vms or datastores, which works, but it’s a little “dirty”

the end result is when i trash the vm, it powers off but stays intact

---

<div class="post-metadata">

**Author:** ![Liorme](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/liorme/32/6115_2.png) [@Liorme](https://forum.opennebula.io/u/Liorme)\
**Post date:** [June 29, 2019, 7:43am UTC](https://forum.opennebula.io/t/hi-is-it-possible-to-remove-a-vm-from-opennebula-without-removing-from-vcenter/7391/10 "2019-06-29T07:43:33Z")

</div>

just installed the 5.8.1, and there i do have the db option, thank you
