A USER_INPUTS entry for a disk's size

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

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

Hi,

there is already an input field to specify the size of the new instance. You can find it in the instantiation dialog:

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

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

Gunwoo Gim 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.

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

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

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!