Service Dialog - extra disk on RHEV/Ovirt

H All,

I am just starting with CloudForms/ManageIQ so apologies in advance if I have missed something obvious here…

I am working on a simple Service Dialog (RHEL template in Ovirt) and after reading #PEMCG - customising_vm_provisioning chapter I though I would give it a try but I am getting only half way through…

I am running gaprindashvili-3 + ovirt4.2.3

I can successfully deploy VM from template on its own (both via life cycle or service dialog without extra changes needed for additional disk) when I tried to follow Peter’s steps I am ending up with:

  • failed service deployment:
    Server [EVM] Service [rhel7-miq2-ss10] Step [checkprovisioned] Status [Error Creating Service] Message [Applied PostProvision Customizations]

  • VM in ovirt:
    in powered off state
    2nd vdisk created and activated

And this from automation log:

INFO – : Q-task_id([miq_provision_1000000000061]) Next State=[AddDisk]
INFO – : Q-task_id([miq_provision_1000000000061]) Processing State=[AddDisk]
INFO – : Q-task_id([miq_provision_1000000000061]) Following Relationship [miqaedb:/Testing/TZ_Customization/RedHat/Methods/AddDisk#create]
INFO – : Q-task_id([miq_provision_1000000000061]) Updated namespace [TZ_Customization/RedHat/Methods/add_disk Testing/TZ_Customization/RedHat]
INFO – : Q-task_id([miq_provision_1000000000061]) Invoking [inline] method [/Testing/TZ_Customization/RedHat/Methods/add_disk] with inputs [{}]
INFO – : Q-task_id([miq_provision_1000000000061]) <AEMethod [/Testing/TZ_Customization/RedHat/Methods/add_disk]> Starting
INFO – : Adding 10 GByte disk to VM: rhel7-miq2-ss10
ERROR – : [undefined method []' for nil:NilClass] /Testing/TZ_Customization/RedHat/Methods/add_disk:112:in
INFO – : Q-task_id([miq_provision_1000000000061]) <AEMethod [/Testing/TZ_Customization/RedHat/Methods/add_disk]> Ending
INFO – : Q-task_id([miq_provision_1000000000061]) Stopping instantiation because [Method exited with rc=MIQ_STOP]
INFO – : Q-task_id([miq_provision_1000000000061]) Followed Relationship [miqaedb:/Testing/TZ_Customization/RedHat/Methods/AddDisk#create]

Any ideas?

I have checked the add_disk method around line 112 but I am unsure about it:

110 # Pull out some re-usable href's from the initial response
111 #
112    creation_status_href = doc.at_xpath("/disk_attachment/link")['href']
113    disk_href = doc.at_xpath("/disk_attachment/disk")['href']
114    attachment_href = doc.at_xpath("/disk_attachment")['href']


Are you using the RHV 4.x version of the script? (

Hi Peter,

yes, I am using updated script and I can see 2nd disk created ok on ovirt side. It’s just service deployment that’s failing rather then complete ok.


Ignore my earlier comment (to be deleted) - I did in fact tested this in cloudforms but I have not used raw script. One using script provided on github I have exactly same error:

ERROR : [undefined method []' for nil:NilClass] /Testing/Methods/Disk_Autostart/add_disk:112:in

in case anyone had similar issue - latest version of script (add_disk_rhv_42_cf_46.rb) shared by Peter ( seems to work ok.

Many thanks for updating the script,