# A USER\_INPUTS entry for a disk's size

**URL:** <https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483>\
**Category:** Product Support\
**Created:** [December 26, 2016, 1:59am UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483 "2016-12-26T01:59:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wind0204](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/wind0204/32/5182_2.png) [@wind0204](https://forum.opennebula.io/u/wind0204)\
**Post date:** [December 26, 2016, 1:59am UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/1 "2016-12-26T01:59:10Z")

</div>

Hi, Can you write a USER\_INPUTS entry for a disk’s size in a VM template? -the size on an instantiation-

some thing like:

> USER\_INPUTS=[  
> DISK0\_SIZE=“M|range||4096…32768|8192”  
> ]

I just thought it would make my test jobs easier.

Best Wishes  
From Korea

---

<div class="post-metadata">

**Author:** ![wind0204](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/wind0204/32/5182_2.png) [@wind0204](https://forum.opennebula.io/u/wind0204)\
**Post date:** [December 28, 2016, 7:55am UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/2 "2016-12-28T07:55:55Z")

</div>

I’ve tested this in vain, can I even resize an image on an instantiation? the images are on a tiny ceph cluster

> USER\_INPUTS=[  
> DISK0\_SIZE=“M|range||4096…32768|8192”  
> ]  
> DISK=[  
> DEV\_PREFIX=“vd”,  
> CACHE=“none”,  
> DRIVER=“raw”,  
> SIZE=“$DISK0\_SIZE”,  
> #IMAGE=“my-debian-8-5-contextualized”,  
> IMAGE=“Ubuntu-16-10-c-161118”,  
> #IMAGE=“CentOS-7-c-161124”,  
> IMAGE\_UNAME=“oneadmin” ]

---

<div class="post-metadata">

**Author:** ![dot](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dot/32/4971_2.png) [@dot](https://forum.opennebula.io/u/dot)\
**Post date:** [January 1, 2017, 4:52pm UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/3 "2017-01-01T16:52:43Z")

</div>

Hi,

there is already an input field to specify the size of the new instance. You can find it in the instantiation dialog:  
 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/1/1b9d5b4a90ab7d71ac4a68d8f1ae69930f56eb29.png)  
Unfortunately it is not possible to specify an allowed MB/GB range AFAIK.

But hopefully this already solves your question.

BTW you are writing that you like to run test jobs. Maybe the command line interface of OpenNebula is of great help then:

```
onevm create --name "test-vm" --memory 128 --cpu 1 --disk 0:size=800

```

This command generates a new VM based on the image with the id 0 (ttylinux in my case). Prior to instantiation OpenNebula resizes the disk of the new instance to 800 MB.

Nice, isn’t it?

Best regards,

Bernhard J. M. Grün

---

<div class="post-metadata">

**Author:** ![wind0204](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/wind0204/32/5182_2.png) [@wind0204](https://forum.opennebula.io/u/wind0204)\
**Post date:** [January 2, 2017, 1:58am UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/4 "2017-01-02T01:58:44Z")

</div>

Thank you very much Bernhard.

I unfortunately don’t use Sunstone much though. but I will use it when I need to instantiate a template resizing the size of a disk -I haven’t managed to find a ‘onetemplate’ equivalent-

I didn’t think about the command ‘onevm create’ and used ‘onetemplate instantiate’ every time; I think I will use it soon or later for some quick tests.

Best Wishes  
Gunwoo Gim

---

<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:** [January 2, 2017, 1:53pm UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/5 "2017-01-02T13:53:07Z")

</div>

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

> Hi, Can you write a USER\_INPUTS entry for a disk’s size in a template? -the size on an instantiation-

I think it’s not needed, the Sunstone interface permit to change the  
size of the disk when you instanciate the VM.

Regards.

---

<div class="post-metadata">

**Author:** ![dot](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dot/32/4971_2.png) [@dot](https://forum.opennebula.io/u/dot)\
**Post date:** [January 2, 2017, 8:13pm UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/6 "2017-01-02T20:13:25Z")

</div>

Hi Gunwoo,

the `onetemplate` command also supports a resize of the disk at instantiation time.  
This way don’t need to change anything on your existing scripts.

Best regards,

Bernhard J. M. Grün

---

<div class="post-metadata">

**Author:** ![wind0204](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/wind0204/32/5182_2.png) [@wind0204](https://forum.opennebula.io/u/wind0204)\
**Post date:** [January 3, 2017, 5:26am UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/7 "2017-01-03T05:26:40Z")

</div>

Hi Bernhard,

I just experimented with the option `--disk` of `onetemplate` command, and found out that it just removes all DISK entries prescribed in the template and add all the arguments of it. is it what you were talking about?

Best regards,  
Gunwoo Gim

---

<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 16, 2021, 7:57pm UTC](https://forum.opennebula.io/t/a-user-inputs-entry-for-a-disks-size/3483/8 "2021-09-16T19:57:21Z")

</div>

Hello @dot  
How to Disable a user input Field to Prevent User Inputs.  
I have made it restrictive but want to disable, and in addition how to update the value of User-input of a running VM using CLI or API any example you can provide for the same.  
Much appreciated!
