Bug 1146073

Summary: Failing to Attach a Storage Domain without Disk Profiles to a Data Center 3.5
Product: [Retired] oVirt Reporter: Federico Simoncelli <fsimonce>
Component: ovirt-engine-coreAssignee: Gilad Chaplik <gchaplik>
Status: CLOSED CURRENTRELEASE QA Contact: Nikolai Sednev <nsednev>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.5CC: amureini, dfediuck, ecohen, gchaplik, gklein, iheim, laravot, lsurette, mavital, mlipchuk, rbalakri, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: ovirt-3.5.0_rc4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:21:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1073943    
Attachments:
Description Flags
attach-sd-to-pool-failure.log.gz none

Description Federico Simoncelli 2014-09-24 11:58:58 UTC
Description of problem:
It seems that some old Storage Domains don't have a "Disk Profile". For example the "Unattached" Storage Domains or the ones in a Data Center < 3.5 (IIUC).

According to (03_06_0250_disk_profile_for_disk_image.sql):

-- Add disk profile for each SD, if compat version >= 3.5
INSERT INTO disk_profiles(id, name, storage_domain_id)
  SELECT uuid_generate_v1(),
    storage_domain_static.storage_name,
    storage_domain_static.id
  FROM storage_pool LEFT OUTER JOIN storage_pool_iso_map ON storage_pool.id = storage_pool_iso_map.storage_pool_id
  LEFT OUTER JOIN storage_domain_static ON storage_pool_iso_map.storage_id = storage_domain_static.id
  WHERE (storage_domain_static.storage_domain_type = 0 OR
    storage_domain_static.storage_domain_type = 1) AND
    cast(storage_pool.compatibility_version as float) >= 3.5;


Later when we try to attach those Storage Domains to a Data Center 3.5 we fail with:

2014-09-24 11:05:54,010 INFO  [org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand] (org.ovirt.thread.pool-6-thread-35) [4c431155] Register new floating OVF_STORE disk with disk id 3145168f-f1f6-4ada-b222-55d5160e2bba for storage domain a1f1ba36-4416-4e0b-9d77-947af011b3d4 has failed

Because setAndValidateDiskProfiles in RegisterDiskCommand fails to find the Disk Profile of the Storage Domain.


Version-Release number of selected component (if applicable):
Upstream master git hash: 2c12a39

How reproducible:
100%

Steps to Reproduce:
1. Try to attach an Unattached Storage Domain without a Disk Profile to a Data Center 3.5

Actual results:
Failure

Expected results:
Success

Comment 1 Federico Simoncelli 2014-09-24 12:00:34 UTC
Created attachment 940757 [details]
attach-sd-to-pool-failure.log.gz

Comment 2 Sandro Bonazzola 2014-10-17 12:21:22 UTC
oVirt 3.5 has been released and should include the fix for this issue.

Comment 3 Nikolai Sednev 2015-02-17 13:49:06 UTC
Works for me on rhevm-3.5.0-0.32.el6ev.noarch.