Feature #5197

Preallocated disk support for oVirt

Added by Nathan Lager about 4 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assigned To:Leon Strong
Category:Compute resources
Target version:Sprint 26
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/1573
Story points-
Velocity based estimate-
Release1.6.0Release relationshipAuto

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

Related to Foreman - Bug #9932: Setting 'Preallocate disk' flag for oVirt compute profile... Closed 03/27/2015
Duplicated by Foreman - Bug #5086: Virtual machines in ovirt are created with "Thin provisio... Duplicate 04/07/2014
Duplicated by Foreman - Feature #1854: Support non thin provisoned disk with oVirt Duplicate 09/06/2012

Associated revisions

Revision 2bf991a8
Added by Leon Strong almost 4 years ago

fixes #5197 - Preallocated disk support for oVirt

History

#1 Updated by Dominic Cleal about 4 years ago

  • Category set to Compute resources

#2 Updated by Leon Strong about 4 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 about 4 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 about 4 years ago

  • Duplicated by Bug #5086: Virtual machines in ovirt are created with "Thin provision" disks added

#5 Updated by Dominic Cleal about 4 years ago

  • Duplicated by Feature #1854: Support non thin provisoned disk with oVirt added

#6 Updated by Dwight Anderson about 4 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 about 4 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Amos Benari
  • Target version set to Sprint 24

#8 Updated by Dmitri Dolguikh about 4 years ago

  • Target version changed from Sprint 24 to Sprint 25

#9 Updated by Nathan Lager about 4 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 about 4 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 about 4 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 about 4 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 Dmitri Dolguikh almost 4 years ago

  • Target version changed from Sprint 25 to Sprint 26

#14 Updated by Leon Strong almost 4 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 almost 4 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 almost 4 years ago

Known issue, locked volumes seems to be problematic.

#17 Updated by Dominic Cleal almost 4 years ago

  • Assigned To changed from Amos Benari to Leon Strong
  • Release set to 1.6.0

#18 Updated by Leon Strong almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#19 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1462 added

#20 Updated by Checheta Yan over 2 years ago

Spam removed by Redmine administrator

#21 Updated by Marek Hulán over 2 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1573 added

Different PR was used to fix this issue.

#22 Updated by Marek Hulán over 2 years ago

  • Related to Bug #9932: Setting 'Preallocate disk' flag for oVirt compute profile does not stick added

Also available in: Atom PDF