Re: [one-users] IOPS in quota section for 4.12

2014-11-28 Thread Thomas Stein
Am 27.11.14 22:29, schrieb Ruben S. Montero:
 Forgot to share that this was already in our roadmap, the issue is here:
 
 http://dev.opennebula.org/issues/3210

Nice. I would love to see that feature.

cheers
t.

 Thanks for your feedback,
 
 Ruben
 
 On Sat Nov 15 2014 at 12:55:19 PM kiran ranjane kiran.ranj...@gmail.com
 wrote:
 
 Yeah, both IOPS and Network Bandwidth should be in quota section. This
 would really be useful.

 Regards
 Kiran Ranjane

 On Fri, Nov 14, 2014 at 5:10 AM, Steven C Timm t...@fnal.gov wrote:

  Good idea.  In general it would be nice to be able to set the various
 quantities which can
 be controlled by the RHEV extended libvirt functions which include IOPS
 but also network bandwidth.

  Steve

  --
 *From:* Users [users-boun...@lists.opennebula.org] on behalf of kiran
 ranjane [kiran.ranj...@gmail.com]
 *Sent:* Thursday, November 13, 2014 5:16 PM
 *To:* users
 *Subject:* [one-users] IOPS in quota section for 4.12

   Hi Team,

  I think we should add IOPS in quota section where in oneadmin can
 assign IOPS at user and group level.

  For example :

  -- Oneadmin assigns 2000 IOPS to a particular user, which means that
 particular user should not exceed 2000 IOPS on his total number of VM that
 he is running.

  -- After IOPS is assigned to user/group through quota section, Cloud
 view user should be able to assign IOPS at VM disks level as per his
 choice. (eg: if a user/group is assigned quota of 2000 IOPS then he should
 have the ability to set IOPS of the VM disk before starting the VM.)

  User/Group have total IOPS Quota = 2000

  User Sets IOPS at Disk Level :
 Virtual Machine OS disk = 300 IOPS
 Virtual Machine Data Disk  = 300 IOPS

  Total remaining IOPS = 1400 IOPS

  I really think this feature should be a must add in quota section as it
 will easy many things related to default way of assigning IOPS to VM.

  Regards
 Kiran Ranjane


 ___
 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
 

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


Re: [one-users] Run bash script in vm on spin-up

2014-11-28 Thread Pavel Tankov

Hello Kerry,

I am having the same problem. I think I discovered why your test.sh 
script doesn't get executed:


!!! Opennebula completely disregards the INIT_SCRIPTS=test.sh entry in 
your CONTEXT=[...] section of the template !!!


How to verify? After your VM spins up, login and mount the CONTEXT image 
like so:


mount -t iso9660 /dev/sr0 /mnt

Enter /mnt and you will find your test.sh file there. So far so good. 
There is one more file there - context.sh. You can see that it contains 
the variables from your CONTEXT=[...] section of the template. You can 
see that it contains an entry like FILES_DS='...' or 
FILES='/var/lib/one/datastores/2/test.sh' that mentions your script. 
HOWEVER, it does NOT contain an entry like INIT_SCRIPTS=test.sh. OK, 
so now open /etc/one-context.d/99-execute-scripts. That script is 
responsible for executing your custom scripts. Here it is:


#!/bin/bash

MOUNT_DIR=/mnt
TMP_DIR=/tmp/one-context-tmp

if [ -z $INIT_SCRIPTS ]; then
if [ -f $MOUNT_DIR/init.sh ]; then
INIT_SCRIPTS=init.sh
fi
fi

mkdir -p $TMP_DIR
cd $MOUNT_DIR

for f in $INIT_SCRIPTS; do
cp $f $TMP_DIR
chmod +x $TMP_DIR/$f
$TMP_DIR/$f
done

In the beginning it checks to see if there is an environment 
variableINIT_SCRIPTS defined. It is never defined, no matter whether you 
put INIT_SCRIPTS=test.sh in your CONTEXT=[...] or not because, as it 
seems, Opennebula silently disregards it. So, in that case the 
99-execute-scripts script continues with the default, which is init.sh.


TL; DR;
Name your script init.sh and it will be executed.

Opennebula devs, please, fix this!

P.S.: Kerry, you say:

/ I have created test.sh and put it into the files datastore on the//head 
node./

Please, explain how you did it, because I can't seem to find a 
step-by-step explanation about this in the documentation.


Thanks,
-- Pavel Tankov

On 12.09.2014 02:28, kerryhall . wrote:

Hi Valentin,

I appreciate the help! I managed to create a new CONTEXT image, which 
copied my test.sh to the datastore successfully, and I updated my 
template to include those two lines you specified.


However, it looks like test.sh is not executing on vm spin up. 
Currently all it does is touch /root/test.tmp to confirm execution. 
However when I booted my vm, this file was not created. Also tried 
doing useradd tmp as well, with no luck. test.sh has executable flag 
set for user, group, and other. I also tried setting permissions of 
test.sh to 777, still no luck.


Thanks!!
Kerry




On Mon, Sep 8, 2014 at 11:27 PM, Valentin Bud valentin@gmail.com 
mailto:valentin@gmail.com wrote:


Hello Kerry,

Do you have a registered image of type CONTEXT with the name of
`test.sh`
in the files datastore?

The file you specify in FILES_DS can be found in the
contextualization CDROM
on the VM (/dev/disk/by-label/CONTEXT).

The following would run a `test.sh` script when the VM is spun up
at the end
of the contextualization routine [1].

CONTEXT = [
FILES_DS=$FILE[IMAGE=\test.sh\],
INIT_SCRIPTS=test.sh,
...
]

[1]:

https://github.com/OpenNebula/addon-context-linux/blob/master/base/etc/one-context.d/99-execute-scripts

Best,
Valentin


On Mon, Sep 8, 2014 at 11:09 PM, kerryhall . kerryh...@gmail.com
mailto:kerryh...@gmail.com wrote:

Thanks! I'm still having issues here unfortunately. I tried
putting:

FILES_DS=$FILE[IMAGE=\test.sh\]

into my template context section, but I get:

User 0 does not own an image with name: test.sh

I'm not trying to include an image, I just want test.sh (a
file in my file datastore) to get copied to anywhere on my
vm's filesystem. (And eventually, I want test.sh to get run on
vm creation, or failing that, every time the vm starts)

Thanks!!

On Fri, Jul 25, 2014 at 11:18 PM, Valentin Bud
valentin@gmail.com mailto:valentin@gmail.com wrote:

Hello Kerry,

Under Defining Context [1] there is an example how to
use FILES_DS.

FILES_DS=$FILE[IMAGE=\test.sh\]

[1]:
http://docs.opennebula.org/4.6/user/virtual_machine_setup/cong.html

Best,
Valentin



On Fri, Jul 25, 2014 at 11:29 PM, kerryhall .
kerryh...@gmail.com mailto:kerryh...@gmail.com wrote:

Hi folks,

I am trying to run a bash script on a vm as it gets
spun up. I've read:

http://docs.opennebula.org/4.6/user/virtual_machine_setup/cong.html

but there isn't too much to go on there.

I have created test.sh and put it into the files
datastore on the head node.

The issue I am having is that the syntax in the
Defining Context section of


Re: [one-users] Run bash script in vm on spin-up

2014-11-28 Thread Pavel Tankov

OK, it seems I wasn't right. Opennebula DOES honor the INIT_SCRIPTS entry.

I am sorry for blaming you!

Why I got confused, though? Well, I was testing with a VM and its 
template. With every new change that I made to the template I went to 
the VM (via Sunstone GUI) and chose from the toolbar the button that 
says Delete recreate, thinking that it will do what it says - namely 
it will delete the VM and then recreate it. Appears that wasn't quite 
the case. When I clicked the rightmost red button and chose Delete and 
then deployed the template again, the changes that I had made to the 
template actually took effect.


Question: Why Delete recreate doesn't do just like when you manually 
delete the VM and then re-deploy from template?


P.S.: Kerry, I discovered how to create CONTEXT files and put them to 
the files datastore, don't need to answer me. There is a nice menu in 
Sunstone called Files  Kernels which I somehow kept skipping. :)
About your problem with test.sh - see if you have fallen in the same 
trap as me - try to first manually delete the VM and then re-deploy it 
from template for your changes to take effect. Other than that, all 
settings work like expected.


Thanks,
Pavel Tankov

On 28.11.2014 12:44, Pavel Tankov wrote:

Hello Kerry,

I am having the same problem. I think I discovered why your test.sh 
script doesn't get executed:


!!! Opennebula completely disregards the INIT_SCRIPTS=test.sh entry 
in your CONTEXT=[...] section of the template !!!


How to verify? After your VM spins up, login and mount the CONTEXT 
image like so:


mount -t iso9660 /dev/sr0 /mnt

Enter /mnt and you will find your test.sh file there. So far so good. 
There is one more file there - context.sh. You can see that it 
contains the variables from your CONTEXT=[...] section of the 
template. You can see that it contains an entry like FILES_DS='...' or 
FILES='/var/lib/one/datastores/2/test.sh' that mentions your script. 
HOWEVER, it does NOT contain an entry like INIT_SCRIPTS=test.sh. OK, 
so now open /etc/one-context.d/99-execute-scripts. That script is 
responsible for executing your custom scripts. Here it is:


#!/bin/bash

MOUNT_DIR=/mnt
TMP_DIR=/tmp/one-context-tmp

if [ -z $INIT_SCRIPTS ]; then
if [ -f $MOUNT_DIR/init.sh ]; then
INIT_SCRIPTS=init.sh
fi
fi

mkdir -p $TMP_DIR
cd $MOUNT_DIR

for f in $INIT_SCRIPTS; do
cp $f $TMP_DIR
chmod +x $TMP_DIR/$f
$TMP_DIR/$f
done

In the beginning it checks to see if there is an environment 
variableINIT_SCRIPTS defined. It is never defined, no matter whether 
you put INIT_SCRIPTS=test.sh in your CONTEXT=[...] or not because, 
as it seems, Opennebula silently disregards it. So, in that case the 
99-execute-scripts script continues with the default, which is init.sh.


TL; DR;
Name your script init.sh and it will be executed.

Opennebula devs, please, fix this!

P.S.: Kerry, you say:
/ I have created test.sh and put it into the files datastore on the//head 
node./
Please, explain how you did it, because I can't seem to find a 
step-by-step explanation about this in the documentation.


Thanks,
-- Pavel Tankov

On 12.09.2014 02:28, kerryhall . wrote:

Hi Valentin,

I appreciate the help! I managed to create a new CONTEXT image, which 
copied my test.sh to the datastore successfully, and I updated my 
template to include those two lines you specified.


However, it looks like test.sh is not executing on vm spin up. 
Currently all it does is touch /root/test.tmp to confirm execution. 
However when I booted my vm, this file was not created. Also tried 
doing useradd tmp as well, with no luck. test.sh has executable 
flag set for user, group, and other. I also tried setting permissions 
of test.sh to 777, still no luck.


Thanks!!
Kerry




On Mon, Sep 8, 2014 at 11:27 PM, Valentin Bud valentin@gmail.com 
mailto:valentin@gmail.com wrote:


Hello Kerry,

Do you have a registered image of type CONTEXT with the name of
`test.sh`
in the files datastore?

The file you specify in FILES_DS can be found in the
contextualization CDROM
on the VM (/dev/disk/by-label/CONTEXT).

The following would run a `test.sh` script when the VM is spun up
at the end
of the contextualization routine [1].

CONTEXT = [
FILES_DS=$FILE[IMAGE=\test.sh\],
INIT_SCRIPTS=test.sh,
...
]

[1]:

https://github.com/OpenNebula/addon-context-linux/blob/master/base/etc/one-context.d/99-execute-scripts

Best,
Valentin


On Mon, Sep 8, 2014 at 11:09 PM, kerryhall . kerryh...@gmail.com
mailto:kerryh...@gmail.com wrote:

Thanks! I'm still having issues here unfortunately. I tried
putting:

FILES_DS=$FILE[IMAGE=\test.sh\]

into my template context section, but I get:

User 0 does not own an image with name: test.sh

I'm not trying to include an image, I just want test.sh (a
file in my file datastore) to get copied to anywhere on my