Description of problem: Support for adding and removing disks from virtual machines is added 4.2 (5.7), For rhv provider, You can add a disk to a powered on vm. If you do this via cloudforms the disk is not activated after it is created and there is no way to activate it. You end up having to go into the RHEV UI and activating it manually. Version-Release number of selected component (if applicable): 5.7.0.3.20160927165516_075d0f3 How reproducible: Always Steps to Reproduce: 1.Navigate to Infrastructure -> Virtual Machines->Select VM 2.Click "Reconfigure Virtual Machine" from Configuration tab. 3. Add new disk. Actual results: Disk is added, but it is not activated and there is no way to activate it Expected results: It would be nice to get the disk activated by default or a radio button provided to user to decided whether they he wants disk in active state or not. Additional info: Passing following with the disk creation request should get the disk activated. <active>true</active>
Juan - does the option to activate appear in the ruby SDK? I think it exists in the python one.
The option to activate the disk is an attribute of the DiskAttachment type: http://www.rubydoc.info/gems/ovirt-engine-sdk/OvirtSDK4/DiskAttachment#active-instance_method Apparently the backend automatically activates the disk when the virtual machine is down, but not when the virtual machine is up. This should probably be fixed in the engine, or in the documentation of the API. Meanwhile it can be solved in ManageIQ as follows: diff --git a/app/models/manageiq/providers/redhat/infra_manager.rb b/app/models/manageiq/providers/redhat/infra_manager.rb index 6e20e69..c584db3 100644 --- a/app/models/manageiq/providers/redhat/infra_manager.rb +++ b/app/models/manageiq/providers/redhat/infra_manager.rb @@ -106,6 +106,7 @@ class ManageIQ::Providers::Redhat::InfraManager < ManageIQ::Providers::InfraMana { :bootable => disk_spec["bootable"], :interface => "VIRTIO", + :active => true, :disk => { :provisioned_size => disk_spec["disk_size_in_mb"].to_i * 1024 * 1024, :sparse => disk_spec["thin_provisioned"], That will activate the disk regardless of the status of the virtual machine. I have submitted the following pull request containing that change:
Forgot to include the reference to the pull request: Explicitly activate disks added to oVirt VMs https://github.com/ManageIQ/manageiq/pull/12532
Verified on CFME-5.8.0.13 & RHV-4.1.1.8 Disk added is activated as well.
When I do the following the disk still gets added deactivated, but using the UI it gets added activated. This a bug, or just me being an idiot? ``` vm.add_disk( nil, # API want's this to be nil, why it asks for it is unknown.... size_mb, { :thinProvisioned => thin_provisioned, :dependent => dependent, :persistent => persistent, :bootable => bootable } ) ```