[one-users] Removing old VMs

Carlos Martín Sánchez cmartin at opennebula.org
Wed Jan 18 03:36:13 PST 2012


Hi,

I think the best way to solve it is to add some configuration option to
purge all VMs that reach the DONE state, deleting them from the DB and the
filesystem. This would break the accounting, however.

We will consider this for next versions, thanks for your feedback.
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | cmartin at opennebula.org |
@OpenNebula<http://twitter.com/opennebula><cmartin at opennebula.org>


On Wed, Dec 21, 2011 at 5:09 AM, Hutson Betts <hut101 at tamu.edu> wrote:

> I needed to forward this to the listserv.
>
> Also, on the same note, I discovered another odd behavior:
>
> Several VMs have been deleted, their state is DONE, and I manually
> removed their folders. However, when I issue a 'show' command to view
> information for VMs that have transitioned to the DONE state, a folder
> is created for them. What's odd about this behavior, is that it only
> occurs the first time I issue the 'show' command. Issuing that command a
> second time does not re-create the folder.
>
> oneadmin at opennebula-server:~$ ls
> auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin at opennebula-server:~$ onevm show 4
> VIRTUAL MACHINE 4
> INFORMATION
> ID                  : 4
> NAME                : vm-example
> USER                : oneadmin
> GROUP               : oneadmin
> STATE               : DONE
> LCM_STATE           : LCM_INIT
> START TIME          : 12/14 14:05:47
> END TIME            : 12/14 15:39:16
> DEPLOY ID           :
>
> VIRTUAL MACHINE
> MONITORING
> NET_TX              : 0
> NET_RX              : 0
> USED MEMORY         : 0
> USED CPU            : 0
>
> VIRTUAL MACHINE
> TEMPLATE
> ...
> VMID=4
> oneadmin at opennebula-server:~$ ls
> 4  auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin at opennebula-server:~$ rm -r 4
> oneadmin at opennebula-server:~$ ls
> auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin at opennebula-server:~$ onevm show 4
> VIRTUAL MACHINE 4
> INFORMATION
> ID                  : 4
> NAME                : vm-example
> USER                : oneadmin
> GROUP               : oneadmin
> STATE               : DONE
> LCM_STATE           : LCM_INIT
> START TIME          : 12/14 14:05:47
> END TIME            : 12/14 15:39:16
> DEPLOY ID           :
>
> VIRTUAL MACHINE
> MONITORING
> NET_TX              : 0
> NET_RX              : 0
> USED MEMORY         : 0
> USED CPU            : 0
>
> VIRTUAL MACHINE
> TEMPLATE
> ...
> VMID=4
> oneadmin at opennebula-server:~$ ls
> auth  config  images  oneacct.db  one.db  onequota.db  remotes
>
> This makes the clean-up scripts potentially worthless since VMs within
> the database can cause changes to content within the file system, and no
> hook can resolve that.
>
> For my network policy, a simple clean-up hook is sufficient to remove
> files and folders that will no longer be needed. However, in the future,
> some method to purge even the database would be nice. Maybe:
> 'onevm purge-done' (Or something...)
>
> --
> Hutson Betts
> Computer Science and Engineering
> Texas A&M University
>
>
> -------- Forwarded Message --------
> > From: Hutson Betts <hut101 at tamu.edu>
> > To: Carlos Martín Sánchez <cmartin at opennebula.org>
> > Subject: Re: [one-users] Removing old VMs
> > Date: Tue, 20 Dec 2011 17:48:08 -0600
> >
> > Carlos,
> >
> > Thank you for your suggestion. It will ll cover the situation in which
> > VMs transition to the DONE state, including when they are deleted. I've
> > updated request #1026 [1].
> >
> > Here's the changes to oned.conf I made, since the update to the ticket
> > wasn't saved properly:
> >
> >
> #*******************************************************************************
> > # Clean-Up Hooks
> >
> #*******************************************************************************
> > # The following VM hooks can be activated in order to manage the
> > # clean-up of log, and deployment files after a VM has transitioned to
> > # the DONE state.
> >
> #*******************************************************************************
> > #
> >
> #-------------------------------------------------------------------------------
> > # VM Clean-Up
> >
> #-------------------------------------------------------------------------------
> > #
> > # The vmdir_cleanup hook will remove the folder, and all its contents,
> > # associated with VMs that have transitioned to the DONE state. The
> > # log_cleanup hook will remove the OpenNebula log associated with the
> > # VM.
> >
> #-------------------------------------------------------------------------------
> > #
> > #VM_HOOK = [
> > #    name      = "vmdir_cleanup",
> > #    on        = "DONE",
> > #    command   = "/bin/rm",
> > #    arguments = "-r /var/lib/one/$VMID" ]
> > #
> > #VM_HOOK = [
> > #    name      = "log_cleanup",
> > #    on        = "DONE",
> > #    command   = "/bin/rm",
> > #    arguments = "/var/log/one/$VMID.log" ]
> > #
> >
> > [1] http://dev.opennebula.org/issues/1026
> >
> > --
> > Hutson Betts
> > Computer Science and Engineering
> > Texas A&M University
> >
> >
> > On Tue, 2011-12-20 at 14:56 +0100, Carlos Martín Sánchez wrote:
> > > request #1026 [1]
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120118/09253355/attachment-0002.htm>


More information about the Users mailing list