Project

General

Profile

Actions

Bug #22656

closed

ovirt vm creation fails for slow storage backend

Added by Virgil Chereches over 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - oVirt
Target version:
-
Difficulty:
trivial
Triaged:
No
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.

Actions #1

Updated by yifat makias about 5 years ago

  • Status changed from New to Assigned
  • Assignee set to yifat makias
Actions #2

Updated by The Foreman Bot about 5 years ago

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

Updated by The Foreman Bot about 5 years ago

  • Fixed in Releases 2.0.0 added
Actions #4

Updated by yifat makias about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF