Re: [one-users] Removing old VMs

2012-04-18 Thread Ruben S. Montero
Hi,

The re-creation of VM directories should be fixed in 3.4. So the original
proposal (hook with rm  VM directory) should now work. Have you tried that
in 3.4?

Cheers

Ruben

On Wed, Apr 18, 2012 at 9:05 AM, Stefan Daus  wrote:

> Sorry, I want to refer at this thread:
>
> http://www.mail-archive.com/users@lists.opennebula.org/msg04999.html
>
>
>  Original-Nachricht 
> > Datum: Tue, 17 Apr 2012 15:26:00 +0200
> > Von: "Stefan Daus" 
> > An: users@lists.opennebula.org
> > Betreff: [one-users]  Removing old VMs
>
> > Can Somebody tell me the current status? I have a lot of dead IDs in my
> > Opennebula and I don't know what is good for. Old VMs with status "done"
> only
> > for accounting in my database?
> > --
> > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> > ___
> > Users mailing list
> > Users@lists.opennebula.org
> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> ___
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Ruben S. Montero, PhD
Project co-Lead and Chief Architect
OpenNebula - The Open Source Solution for Data Center Virtualization
www.OpenNebula.org | rsmont...@opennebula.org | @OpenNebula
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2012-04-18 Thread Stefan Daus
Sorry, I want to refer at this thread:

http://www.mail-archive.com/users@lists.opennebula.org/msg04999.html


 Original-Nachricht 
> Datum: Tue, 17 Apr 2012 15:26:00 +0200
> Von: "Stefan Daus" 
> An: users@lists.opennebula.org
> Betreff: [one-users]  Removing old VMs

> Can Somebody tell me the current status? I have a lot of dead IDs in my
> Opennebula and I don't know what is good for. Old VMs with status "done" only
> for accounting in my database?
> -- 
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> ___
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2012-01-18 Thread Carlos Martín Sánchez
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 | cmar...@opennebula.org |
@OpenNebula<http://twitter.com/opennebula>


On Wed, Dec 21, 2011 at 5:09 AM, Hutson Betts  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@opennebula-server:~$ ls
> auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin@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@opennebula-server:~$ ls
> 4  auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin@opennebula-server:~$ rm -r 4
> oneadmin@opennebula-server:~$ ls
> auth  config  images  oneacct.db  one.db  onequota.db  remotes
> oneadmin@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@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 
> > To: Carlos Martín Sánchez 
> > 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.
> >

Re: [one-users] Removing old VMs

2011-12-20 Thread Hutson Betts
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@opennebula-server:~$ ls
auth  config  images  oneacct.db  one.db  onequota.db  remotes  
oneadmin@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@opennebula-server:~$ ls
4  auth  config  images  oneacct.db  one.db  onequota.db  remotes  
oneadmin@opennebula-server:~$ rm -r 4
oneadmin@opennebula-server:~$ ls
auth  config  images  oneacct.db  one.db  onequota.db  remotes  
oneadmin@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@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 
> To: Carlos Martín Sánchez 
> 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&qu

Re: [one-users] Removing old VMs

2011-12-20 Thread richard -rw- weinberger
2011/12/20 Carlos Martín Sánchez :
> Hi,
>
> The feature request #1026 [1] can be easily implemented with hooks [2].
>

Fair point.
Will do so. :-)

-- 
Thanks,
//richard
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2011-12-20 Thread Carlos Martín Sánchez
Hi,

The feature request #1026 [1] can be easily implemented with hooks [2].

For instance, with these two hooks you don't even need any script file:

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" ]


If you want to create an external script, please take into account bug
#1036: Local hooks are not executed unless the full path is defined.

That means that this hook won't be triggered:

VM_HOOK = [
   name  = "cleanup",
   on= "DONE",
   command   = "cleanup.sh",
   arguments = "$VMID" ]


And you must use this one instead:

VM_HOOK = [
   name  = "cleanup",
   on= "DONE",
   command   = "/full/path/to/cleanup.sh",
   arguments = "$VMID" ]

Cheers.

[1] http://dev.opennebula.org/issues/1026
[2] http://opennebula.org/documentation:rel3.0:hooks
[3] http://dev.opennebula.org/issues/1036
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | cmar...@opennebula.org |
@OpenNebula


On Fri, Dec 16, 2011 at 9:44 AM, richard -rw- weinberger <
richard.weinber...@gmail.com> wrote:

> On Fri, Dec 16, 2011 at 1:02 AM, Hutson Betts  wrote:
> > This is not necessarily an answer to your question, but if you'll
> > consider taking a look at Feature #1026 that I created on the dev site.
>
> #1026 is exactly what I want. :-)
>
> --
> Thanks,
> //richard
> ___
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2011-12-16 Thread richard -rw- weinberger
On Fri, Dec 16, 2011 at 1:02 AM, Hutson Betts  wrote:
> This is not necessarily an answer to your question, but if you'll
> consider taking a look at Feature #1026 that I created on the dev site.

#1026 is exactly what I want. :-)

-- 
Thanks,
//richard
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2011-12-16 Thread richard -rw- weinberger
On Fri, Dec 16, 2011 at 5:02 AM, Steven Timm  wrote:
> On Fri, 16 Dec 2011, richard -rw- weinberger wrote:
>
>> Hi!
>>
>> It looks like OpenNebula keeps all used VM Ids.
>> Using "onevm ID" I can see all old VMs in state "DONE".
>> And in /var/lib/one/ exists for each old VM a directory.
>>
>> How can I get rid of this?
>> Especially the directories in /var/lib/one/ are nasty.
>>
>>
>
> Two ways--
> Either don't use the "SAVE" option in your template
>
> or
>
> use VM's from the image repository and then opennebula
> will save them back to the image repository instead of the
> /var/lib/one/directory.
>

This does not answer my question.
I don't have a fixed set of VMs.
They come and go

-- 
Thanks,
//richard
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2011-12-15 Thread Steven Timm

On Fri, 16 Dec 2011, richard -rw- weinberger wrote:


Hi!

It looks like OpenNebula keeps all used VM Ids.
Using "onevm ID" I can see all old VMs in state "DONE".
And in /var/lib/one/ exists for each old VM a directory.

How can I get rid of this?
Especially the directories in /var/lib/one/ are nasty.




Two ways--
Either don't use the "SAVE" option in your template

or

use VM's from the image repository and then opennebula
will save them back to the image repository instead of the
/var/lib/one/directory.

Steve


--
--
Steven C. Timm, Ph.D  (630) 840-8525
t...@fnal.gov  http://home.fnal.gov/~timm/
Fermilab Computing Division, Scientific Computing Facilities,
Grid Facilities Department, FermiGrid Services Group, Group Leader.
Lead of FermiCloud project.
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Removing old VMs

2011-12-15 Thread Hutson Betts
Dear Richard,

This is not necessarily an answer to your question, but if you'll
consider taking a look at Feature #1026 that I created on the dev site.

I can understand that all reference material associated with a VM would
remain even when the VM is in the "DONE" state since technically that is
an acceptable state for the VM to exist. There could exist a scenario
where the user would like access to deployment files, logs, etc.

However, it would be nice if there was a method to clear-out all data
related to VMs. That's where Feature #1026 comes in. Currently, even
deleting a VM leaves all its files laying around.

-- 
Hutson Betts
Computer Science and Engineering
Texas A&M University


On Fri, 2011-12-16 at 00:12 +0100, richard -rw- weinberger wrote:
> Hi!
> 
> It looks like OpenNebula keeps all used VM Ids.
> Using "onevm ID" I can see all old VMs in state "DONE".
> And in /var/lib/one/ exists for each old VM a directory.
> 
> How can I get rid of this?
> Especially the directories in /var/lib/one/ are nasty.
> 


signature.asc
Description: This is a digitally signed message part
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org