# Create User Attribute

**URL:** <https://forum.opennebula.io/t/create-user-attribute/5276>\
**Category:** Product Support\
**Created:** [November 16, 2017, 8:10pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276 "2017-11-16T20:10:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [November 16, 2017, 8:10pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/1 "2017-11-16T20:10:15Z")

</div>

I would like to add a UMASK=“117” attribute to each user as they are being created. Is there a default USER TEMPLATE that can be modified to automatically include this attribute as the user is created?

Thanks

---

<div class="post-metadata">

**Author:** ![DaD](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dad/32/8466_2.png) [@DaD](https://forum.opennebula.io/u/DaD)\
**Post date:** [November 20, 2017, 12:01pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/2 "2017-11-20T12:01:55Z")

</div>

Bob [opennebula@discoursemail.com](mailto:opennebula@discoursemail.com) writes:

> I would like to add a UMASK=“117” attribute to each user as they are being created. Is there a default USER TEMPLATE that can be modified to automatically include this attribute as the user is created?

I think one option is to use a hook:

```
http://docs.opennebula.org/5.4/integration/infrastructure_integration/hooks.html#other-hooks

```

Regards.

---

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [November 21, 2017, 3:42pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/3 "2017-11-21T15:42:50Z")

</div>

I did not stop to think about using hooks. I believe a VM hook will actually do what I am ultimately want to achieve which is set the Use & Manage flags for Groups when members of a specific group instantiate a new VM.

Configuring the VM\_HOOK stanza in oned.conf is pretty straight forward. But I have been unable to find a good sample script online that sets permission flags for users in a specific group.

Any recommendations to where I could look?

Thanks

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [September 2, 2021, 9:42am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/4 "2021-09-02T09:42:42Z")

</div>

Hi @DaD @amarti  
Is there hook for user as hook-vm.  
I want to do some action on oneuser create.  
Please help on the same.

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [September 7, 2021, 7:38am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/5 "2021-09-07T07:38:19Z")

</div>

Hello @Rahul_Sharma,

You can use API hook on call `one.user.allocate`, check [this](https://docs.opennebula.io/6.0/integration_and_development/system_interfaces/hook_driver.html#api-hooks).

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [September 7, 2021, 10:23am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/6 "2021-09-07T10:23:48Z")

</div>

Thanks @ahuertas !!

As suggested I have used API hook added below lines in oned.config  
USER\_HOOK = [  
NAME = hook-API  
TYPE = api  
COMMAND = “log\_new\_user.rb”  
ARGUMENTS = $API  
CALL = “one.user.allocate”  
ARGUMENTS\_STDIN = yes]

I am getting the error message on allocating user from Sunstone/API:  
Internal error No such file or directory - /var/lib/one/remotes/hooks/log\_new\_user.rb  
Even though I am having file at the defined location.  
Please guide me where I am going in wrong direction.

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [September 8, 2021, 6:39pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/7 "2021-09-08T18:39:32Z")

</div>

Hello @perrfect ,  
Could you please suggest on the above issue, if you have encountered or worked successfully on Hook?

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [September 9, 2021, 7:40am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/8 "2021-09-09T07:40:52Z")

</div>

Hello @Rahul_Sharma,

Please check that the file have the right permissions and that it can be executed by oneadmin user.

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [September 15, 2021, 11:46am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/9 "2021-09-15T11:46:41Z")

</div>

Thanks @ahuertas !  
The issue got resolved by right permissions to the file.

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [October 11, 2021, 10:54am UTC](https://forum.opennebula.io/t/create-user-attribute/5276/10 "2021-10-11T10:54:20Z")

</div>

Hello @ahuertas  
I am trying to create template with User inputs using CLI but it is not accepting --user-inputs. Template is created without user inputs.

Could you please verify or correct the below onetemplate CLI command:  
onetemplate create --name “VMTemplate” --cpu 0.1 --user-inputs name=“userinput”

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [October 13, 2021, 1:32pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/11 "2021-10-13T13:32:42Z")

</div>

Hello @Rahul_Sharma,

Please take in account that `--user-inputs` is used when instantiating a template, not when creating it.

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![Rahul\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/rahul_sharma/32/7093_2.png) [@Rahul\_Sharma](https://forum.opennebula.io/u/Rahul_Sharma)\
**Post date:** [October 18, 2021, 8:44pm UTC](https://forum.opennebula.io/t/create-user-attribute/5276/12 "2021-10-18T20:44:41Z")

</div>

Thanks @ahuertas !!
