Instance Volume Size


Looking forward to customize provisioning dialogs, I’m trying to allow user specifying the system volume size of the deployed instance.

Is there any way to customize the dialog and the provisioning process to do this kind of thing ?

I’m currently able to expand dialog and retrieve existing options in my method, but I do not succeed at creating a custom option nor finding where to specify the expected volume size.

Thanks in advance for your feedback.

we had similar requirement here. We solved it by adding additional disk with a customized size (size in GB given as input field from the service dialog)
We are using some piece of code from Kevin Morey available on github:
And we have developped a sat6 kickstart that mounts the added disk on a specific filesystem.
Hope it helps !


Thank you very much for your reply.

Indeed it helps, glad we are not facing this issue alone :smile:

Unfortunately, despite we investigated the same workaround, this doesn’t fit with our requirements…

@pemcg @ramrexx any help you could give here?

It can depend on the provider you’re provisioning into, the operating system being deployed, and whether you’re running an unattended installation such as kickstart, or cloning from ‘fat’ template.

Expanding the volume size before running a kickstart is probably the simplest, but how you do this is provider-specific. Can you give any more details?



Well we are working with AWS for a start and planning to provide an equivalent behavior with Azure (as soon as it’s available) and openstack.

The requested OS are Linux and Windows. Deployment is made from custom AMI. Post configuration will be automated using Chef.

Expanding the volume size is quite complicated on AWS (It require a snapshot / volume detach / volume attach / volume destroy). It would be easier to be able to specify the first volume size in the provisioning request/orchestration.

Unfortunately, it look like this is not handled in the current orchestration as instances are deployed with a volume configured with the default AWS volume size (8GB for Linux).

Thanks for your feedback.

Sorry to dig up the old post. I am too looking into adding disk to the AWS instance so I can use cloud-init to expand the volume when it boot up. How do you specify additional disk when generating provision request for AWS?

Thanks for your help.

Hi @ecchong
I use preprovision stage of Cloud VM provisioning statemachine for this purpose. I use openstack provider and my method is openstack_preprovision.rb. In the service dialog I use custom options such a :dialog_new_volume and :dialog_volume_persistent and then I create :volumes Array for new volumes in this snippet:

# Cinder Volume configuration -------------------
@prov = $evm.root['miq_provision']
new_volume        = @prov.get_option(:dialog_new_volume)
vm_name           = @prov.get_option(:vm_name)
volume_persistent = @prov.get_option(:dialog_volume_persistent)

unless new_volume.nil? or

  persistent = if volume_persistent == 'f'

  volume = {
    :name                  => vm_name.to_s,
    :size                  => new_volume.to_i,
    :delete_on_termination => persistent

  volumes = [] if volumes.nil?
  volumes << volume

  @prov.set_option(:volumes, volumes)
# -----------------------------------------------

Volumes are created with the same name as VM name. :dialog_new_volume is is just volume size in Gb and if it zero or not specified than I dont create any additional volume.

1 Like

Hi Igor,

I am trying t use ypur method to attach a volume but getting below error,

[----] E, [2018-01-31T18:29:53.103188 #7210:10db6b8] ERROR – : Q-task_id([miq_provision_1000000000195]) The following error occurred during method evaluation:
[----] E, [2018-01-31T18:29:53.107761 #7210:10db6b8] ERROR – : Q-task_id([miq_provision_1000000000195]) NoMethodError: undefined method `get_option’ for nil:NilClass

Any help would be appreciated


Hi. This method is used during VM provisioning and should be placed during PrePorvision phase - before provision task:

I have added the new method as showed in the picture, but still getting “NoMethodError: undefined method `get_option’ for nil:NilClass” error. Could you provide the names that you have used in the dialogue boxes.


The error about @prov = $evm.root[‘miq_provision’], looks like for some reason this object is nil:

new_volume = @prov.get_option(:dialog_new_volume)

The PreProvision stage have run before Provision stage:


Can you check your provision method ? How the @prov object are named ?