Feature #5197
Preallocated disk support for oVirt
Description
As a RHEV user, it would be nice to have the option between thin provisioned disks, and preallocated disks when creating VM's using the oVirt API.
I've tested with Foreman 1.4.2, and RHEV 3.2. There is no option presented when creating a disk, and the disk is created by default as Thin.
Related issues
Associated revisions
History
#1
Updated by Dominic Cleal almost 9 years ago
- Category set to Compute resources
#2
Updated by Leon Strong almost 9 years ago
Just on this, as far as i'm able to tell, i've not found an easy way to allow this, those users (myself included) that have thin provisioning on their san backends are in for a world of pain if they can't pre-allocate VM disks. :\
#3
Updated by Nathan Lager almost 9 years ago
If this helps, I've worked through doing this via he API. I have a perl script which i've used in the past to allocate vm's from templates. I managed to piece together the following disk allocation xml, based on Red Hat's API docs.
<disk>
<clone>true</clone>
<storage_domains>
<storage_domain id=\\"%s\\"/></storage_domains>
<size>%s</size>
<type>system</type>
<interface>virtio</interface>
<format>RAW</format>
<bootable>true</bootable>
</disk>
The format = RAW flag is the key. That tells the API to create this disk as a preallocated type, and not a thin disk.
This should be possible via foreman. I'd guess it depends on whatever library foreman uses to interact with the oVirt API.
#4
Updated by Dominic Cleal almost 9 years ago
- Has duplicate Bug #5086: Virtual machines in ovirt are created with "Thin provision" disks added
#5
Updated by Dominic Cleal almost 9 years ago
- Has duplicate Feature #1854: Support non thin provisoned disk with oVirt added
#6
Updated by Dwight Anderson almost 9 years ago
It looks like the functionality for this is there in the underlying code base, the default behavior comes from the rbovirt gems rbovirt-0.0.21/lib/ovirt/volume.rb which sets format to cow and sparse to true when no settings are being passed for those variables. The system should just need to be modified to pass the additional options for format and sparse as a part of the disk information sent by the web interface when requesting a new disk.
#7
Updated by Dominic Cleal almost 9 years ago
- Status changed from New to Ready For Testing
- Assignee set to Amos Benari
- Target version set to 1.8.2
#8
Updated by Anonymous almost 9 years ago
- Target version changed from 1.8.2 to 1.8.1
#9
Updated by Nathan Lager almost 9 years ago
I see the status sitting at ready for testing.
Are you waiting for someone to test? If so, i'd be willing to do what I can. What's involved in getting the proper version of code running to test?
Thanks!
#10
Updated by Dominic Cleal almost 9 years ago
Nathan Lager wrote:
I see the status sitting at ready for testing.
Are you waiting for someone to test? If so, i'd be willing to do what I can. What's involved in getting the proper version of code running to test?
Yep, that'd be a great help.
You can do something like: cd /usr/share/foreman && curl https://github.com/theforeman/foreman/pull/1462.patch | patch -p1
and then restart Foreman/httpd.
#11
Updated by Nathan Lager almost 9 years ago
Dominic Cleal wrote:
Nathan Lager wrote:
I see the status sitting at ready for testing.
Are you waiting for someone to test? If so, i'd be willing to do what I can. What's involved in getting the proper version of code running to test?
Yep, that'd be a great help.
You can do something like:
cd /usr/share/foreman && curl https://github.com/theforeman/foreman/pull/1462.patch | patch -p1
and then restart Foreman/httpd.
Thanks! I'll see if I can give that a shot without affecting my production foreman. Give me some time to work out the best way to do that, and I'll report back with the outcome.
#12
Updated by Nathan Lager almost 9 years ago
ok, I gave it a shot. Close, but Foreman was unable to create my vm's disk.
It gave me the option to preallocate the disk, but when I submitted it, it failed while creating the instance, with the following error:
Unable to save
Failed to create a compute Metal (oVirt) instance testprov-nonthin.dev.lafayette.edu: Cannot add Virtual Machine Disk. Disk configuration (COW Preallocated) is incompatible with the storage domain type.
The Storage domain is a RHEV Storage Pool, Fibre channel attached. Let me know what other info you need in order to troubleshoot.
Thanks!
#13
Updated by Anonymous over 8 years ago
- Target version changed from 1.8.1 to 1.8.0
#14
Updated by Leon Strong over 8 years ago
i've created a pull request that should satisfy this if someone wants to test it, based off the previous pull request. https://github.com/theforeman/foreman/pull/1568/files
Hope this isn't breaking etiquette or something, I really need this in mainline asap.
I've verified it working against my RHEV cluster.
#15
Updated by Leon Strong over 8 years ago
One thing of interest, in my development environment, I notice that the machine provisions fine, but it sometimes get rolled back after as it times out whilst waiting to power up the machine (as the disks are still locked on the rhev side), not sure what the best path forward for that is. (I just don't enable powering on the machine when thick provisioning).
Thoughts?
#16
Updated by Lukas Zapletal over 8 years ago
Known issue, locked volumes seems to be problematic.
#17
Updated by Dominic Cleal over 8 years ago
- Assignee changed from Amos Benari to Leon Strong
- Legacy Backlogs Release (now unused) set to 10
#18
Updated by Leon Strong over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 2bf991a88ea3cf4493b6da0521fa64a94ddb42a2.
#19
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/theforeman/foreman/pull/1462 added
- Pull request deleted (
)
#20
Updated by Checheta Yan about 7 years ago
Spam removed by Redmine administrator
#21
Updated by Marek Hulán about 7 years ago
- Pull request https://github.com/theforeman/foreman/pull/1573 added
- Pull request deleted (
https://github.com/theforeman/foreman/pull/1462)
Different PR was used to fix this issue.
#22
Updated by Marek Hulán about 7 years ago
- Related to Bug #9932: Setting 'Preallocate disk' flag for oVirt compute profile does not stick added
fixes #5197 - Preallocated disk support for oVirt