[one-users] Removing old VMs
Hutson Betts
hut101 at tamu.edu
Tue Dec 20 20:09:17 PST 2011
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]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20111220/0249d476/attachment.pgp>
More information about the Users
mailing list