CloudStack doesn’t usually remove records from db tables. If you look t 
vm_instance (or many other tables in there) you’ll see three timestamp fields: 
created, update_time, and removed. So if you want to “remove” a 
vm/disk/nic/etc, you change the removed field from null to a timestamp, e.g.

UPDATE vm_instance SET removed=now() WHERE id=105;

John

> On Dec 11, 2014, at 11:31 PM, Vadim Kimlaychuk <vadim.kimlayc...@elion.ee> 
> wrote:
> 
> Tejas,
> 
>       "Stopped" and "Destroyed" are "visible" statuses of VM at dashboard as 
> well as "Expunding". You should put "Expunded" for the VM not to be visible.  
> Entirely removing the raw in DB is not good option. CS does not ever remove 
> data for VM-s being destroyed and expunded - they always remain at database.  
>  
> 
> Vadim.
> 
> -----Original Message-----
> From: Tejas Sheth [mailto:tshet...@gmail.com] 
> Sent: Friday, December 12, 2014 9:01 AM
> To: users@cloudstack.apache.org
> Subject: Re: How to remove VM entry from CloudStack database?
> 
> Hi,
> 
>  I have tried to change the vm_instance table state value to "Stopped" and 
> "Destroied" but i was nither able to start nor destroy vm. so finally i 
> removed entire row of that perticular VM and finally that VM was removed from 
> instance deshboard.
> 
> can anyone suggest that in order to complete cleanup activity do we need to 
> delete any other entry from anyother table?
> 
> Thanks,
> Tejas
> 
> On Fri, Dec 12, 2014 at 8:30 AM, Tejas Sheth <tshet...@gmail.com> wrote:
>> 
>> Hello,
>> 
>>  Its not in production so i can test the DB modification, Let me try 
>> to modify VM entry from vm_instance table and I'll let you guyz know 
>> the result.
>> 
>> Thanks,
>> Tejas
>> 
>> On Fri, Dec 12, 2014 at 5:45 AM, Matthew Midgett < 
>> clouds...@trick-solutions.com.invalid> wrote:
>> 
>>> I have phpmyadmin running on my MariaDB server as I am no sql expert.
>>> Then is cloud > vm_instance and change the state be editing the row 
>>> for the VM ID that you need to Stopped, Destroyed or Expunging
>>> 
>>> Not responsible for your actions :)
>>> 
>>> Matthew Midgett
>>> Trick Solutions
>>> 143 Jenny Marie Rd
>>> Mooresville NC,28115
>>> 336-618-7425 Office
>>> 704-728-5644 Cell
>>> www.trick-solutions.com
>>> 
>>> CONFIDENTIAL: This electronic mail, including any attachment(s) may 
>>> contain information that is privileged, confidential, and/or 
>>> otherwise protected from disclosure to anyone other than its intended 
>>> recipient(s).
>>> Any dissemination or use of this electronic email or its contents 
>>> (including any attachments) by persons other than the intended 
>>> recipient(s) is strictly prohibited.  If you have received this 
>>> message in error, please notify me immediately by reply email so that 
>>> I may correct my internal records.  Please then delete the original 
>>> message (including any
>>> attachments) in its entirety.  Thank you.
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Tejas Sheth [mailto:tshet...@gmail.com]
>>> Sent: Thursday, December 11, 2014 9:20 AM
>>> To: users@cloudstack.apache.org
>>> Subject: How to remove VM entry from cloudstack database?
>>> 
>>> Hello,
>>> 
>>>  I was tring migrate vm to another cluster using storage migration 
>>> option in Cloudstack 4.3.1.
>>> unfortuanatly now it got stuck at migrating stage and don't know how 
>>> to recover.
>>> 
>>> since it is test environment we can remove it from database.
>>> Does anyone knows how to cleanup VM entry from cloudstack and its 
>>> database?
>>> 
>>> Thanks,
>>> Tejas
>>> 
>>> 
>> 

Reply via email to