Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1624630

Summary: While a host is in 'preparing for maintenance', data domain import fails with a validation error which seems unrelated
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: BLL.StorageAssignee: Nobody <nobody>
Status: CLOSED DEFERRED QA Contact: Avihai <aefrat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.6.2CC: bugs, eshenitz, tnisan
Target Milestone: ---Keywords: Automation
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-29 11:33:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
logs none

Description Elad 2018-09-02 15:52:13 UTC
Created attachment 1480365 [details]
logs

Description of problem:
While there is a host stuck in preparing for maintenance in the DC and trying to import a data domain to this DC, the import fails with a validation error, which seems unrelated.


Version-Release number of selected component (if applicable):
ovirt-engine-4.2.6.4-0.1.el7ev.noarch
vdsm-4.20.39-1.el7ev.x86_64

How reproducible:
The reason seems to be that there is another host in the DC which is in 'preparing for maintenance'.

Steps to Reproduce:
1. Create an iSCSI domain
2. Detach the iSCSI domain from the DC
3. Cause a host in the DC to be 'preparing for maintenance', for example, by putting in maintenance a host that has a hosted engine VM running on. 
4. Try to import the domain to the DC using a different host (not the one in 'preparing for maintenance'):

2018-08-30 16:52:07,380 - MainThread - storagedomains - DEBUG - CREATE request content is --  url:https://hosted-engine-01.lab.eng.tlv2.redhat.com/ovirt-engine/api/storagedomains body:<storage_domain id="5729a7d1-45f2-418b-b397-eabd1ef51be6">
    <import>true</import>
    <storage>
        <type>iscsi</type>
    </storage>
    <type>data</type>
    <host id="c56260c4-4b43-4f07-8f7a-e62ecc26c55d"/>
</storage_domain>


Correlation id - storagedomains_create_ffdda60c-5cba-400e


As seen the in POST request, storage domain name wasn't specified.
The domain actual name doesn't contain any special characteristics has a few letters in its name (storagedomains GET from before domain detach from the DC) - in art_test_runner.log (which has all the REST calls and responses):


2018-08-30 16:45:51,549 - MainThread - storagedomains - DEBUG - GET request content is --  url:https://hosted-engine-01.lab.eng.tlv2.redhat.com/ovirt-engine/api/storagedomains 
2018-08-30 16:45:51,721 - MainThread - storagedomains - DEBUG - Response code is valid: [200, 201] 
2018-08-30 16:45:51,725 - MainThread - storagedomains - DEBUG - Response body for GET request is:

<storage_domain href="/ovirt-engine/api/storagedomains/5729a7d1-45f2-418b-b397-eabd1ef51be6" id="5729a7d1-45f2-418b-b397-eabd1ef51be6">

<name>iscsi_2</name>



Actual results:


REST response body for domain import:


        Status: 400
        Reason: Bad Request
        Detail: [size must be between 1 and 250, Attribute: privateStorageDomain.name, Storage Domain name must be formed of 'a-z', 'A-Z', '0-9', '_' or '-' characters, Attribute: privateStorageDomain.name]



engine.log:

2018-08-30 16:52:34,095+03 WARN  [org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommand] (default task-51) [storagedomains_create_ffdda60c-5cba-] Validation of action 'AddExistingBlockSto
rageDomain' failed for user admin@internal-authz. Reasons: VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__ADD,size must be between 1 and 250,$groups [Ljava.lang.Class;@4293b25e,$min 1,$message {javax.validation.constra
ints.Size.message},$payload [Ljava.lang.Class;@1b19a5d,$max 250,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path privateStorageDomain.name,$validatedValue ,VALIDATION_STORAGE_DOMAIN_NAME_INVALID,$message VALIDATION_STORA
GE_DOMAIN_NAME_INVALID,$payload [Ljava.lang.Class;@21e55b5,$groups [Ljava.lang.Class;@75597e69,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path privateStorageDomain.name,$validatedValue 
2018-08-30 16:52:34,110+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-51) [] Operation Failed: [size must be between 1 and 250, Attribute: privateStorageDomain.name, Storage Domain name must be formed of 'a-z', 'A-Z', '0-9', '_' or '-' characters, Attribute: privateStorageDomain.name]



Expected results:


Additional info:


Host id f72546a2-49cf-4323-bfc2-331092e16e1c is in preparing for maintenance in art_test_runner.log (which has all the REST calls and responses):

<host href="/ovirt-engine/api/hosts/f72546a2-49cf-4323-bfc2-331092e16e1c" id="f72546a2-49cf-4323-bfc2-331092e16e1c">
.
.
<status>preparing_for_maintenance</status>

Comment 1 Elad 2018-09-02 15:54:24 UTC
The uploaded logs are from the exact time of the test execution, full logs can be found here:
https://drive.google.com/open?id=1Iee7jqNnqMu8PqQp2kLbQ42VhiymL7sV

Comment 2 Tal Nisan 2018-09-04 07:01:40 UTC
That's a real corner case with little to no impact, perhaps we can make sure in the test that we try to import only with hosts in up status?

Comment 3 Elad 2018-09-16 13:02:36 UTC
Yes, it's possible, but shouldn't it be better to fix it in engine side? This seems pretty straightforward.

Comment 4 Tal Nisan 2018-09-16 13:05:47 UTC
Not sure we'll have the capacity, I'll have to review it again during the 4.3 development cycle

Comment 5 Sandro Bonazzola 2019-01-28 09:34:45 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 6 Michal Skrivanek 2021-08-20 08:27:16 UTC
This bug/RFE is more than 2 years old and it didn't get enough attention so far, and is now flagged as pending close. 
Please review if it is still relevant and provide additional details/justification/patches if you believe it should get more attention for the next oVirt release.

Comment 7 Michal Skrivanek 2021-09-29 11:33:06 UTC
This bug didn't get any attention in a long time, and it's not planned in foreseeable future. oVirt development team has no plans to work on it.
Please feel free to reopen if you have a plan how to contribute this feature/bug fix.