Bug 1390517
| Summary: | Hot-adding disk to an VM in RHV provider does not activate it | |||
|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Prasad Mukhedkar <pmukhedk> | |
| Component: | Providers | Assignee: | Juan Hernández <juan.hernandez> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 5.7.0 | CC: | agrare, istein, itewksbu, jfrey, jhardy, juan.hernandez, obarenbo, oourfali, simaishi | |
| Target Milestone: | GA | Keywords: | TestOnly | |
| Target Release: | 5.8.0 | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | rhev | |||
| Fixed In Version: | 5.8.0.0 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1393939 (view as bug list) | Environment: | ||
| Last Closed: | 2017-06-12 16:42:30 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | RHEVM | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1393939 | |||
|
Description
Prasad Mukhedkar
2016-11-01 09:47:40 UTC
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
}
)
```
|