Project

General

Profile

Bug #22656

ovirt vm creation fails for slow storage backend

Added by Virgil Chereches over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - oVirt
Target version:
-
Difficulty:
trivial
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

We encountered the following kind of errors when trying to create VM on ovirt 4.1 via Foreman:
Failed to create a compute xxx (oVirt) instance xxx: Cannot remove VM: The following disks are locked: xxx_Disk2, xxx_Disk1. Please try again in a few minutes. | | OVIRT::OvirtException: Cannot remove VM: The following disks are locked: xxx_Disk2, xxx_Disk1. Please try again in a few minutes

The error only occurred on slow storage devices as volumes backend.
Looking through app/models/compute_resources/foreman/model/ovirt.rb model I saw that it is destroying the vm if either interfaces or volumes creation fails.
I also identified the following piece of code for volume creation:

def create_volumes(vm, attrs)
#add volumes
volumes = nested_attributes_for :volumes, attrs
volumes.map do |vol|
set_preallocated_attributes!(vol, vol[:preallocate])
#The blocking true is a work-around for ovirt bug fixed in ovirt version 3.1.
vm.add_volume({:bootable => 'false', :quota => ovirt_quota, :blocking => api_version.to_f < 3.1}.merge(vol)) if vol[:id].blank?
end
vm.volumes.reload
end

Changing 3.1 with 5.1 (actually enforcing blocking behavior) solved the issue.
So it seems that for ovirt 4.1 and slow storage devices the code must wait until the volume is added.

Associated revisions

Revision 1a090f9b (diff)
Added by yifat makias 7 months ago

Fixes #22656 - Fixed ovirt vm creation for slow storage

History

#1 Updated by yifat makias 7 months ago

  • Assignee set to yifat makias
  • Status changed from New to Assigned

#2 Updated by The Foreman Bot 7 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7169 added

#3 Updated by The Foreman Bot 7 months ago

  • Fixed in Releases 2.0.0 added

#4 Updated by yifat makias 7 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF