Bug 849427

Summary: [engine-core] Activating an already active domain through REST fails with "domain inaccessible"
Product: Red Hat Enterprise Virtualization Manager Reporter: Gadi Ickowicz <gickowic>
Component: ovirt-engineAssignee: Vered Volansky <vered>
Status: CLOSED CURRENTRELEASE QA Contact: Carlos Mestre González <cmestreg>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acanan, acathrow, amureini, bazulay, ebenahar, iheim, jkt, lpeer, nlevinki, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---Keywords: Reopened
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: ovirt-3.4.0-alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 09:38: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:
Bug Depends On:    
Bug Blocks: 1078909, 1142926    
Attachments:
Description Flags
engine logs none

Description Gadi Ickowicz 2012-08-19 12:04:16 UTC
Description of problem:
Trying to activate an active domain through REST returns HTTP 400 response, claiming the domain is inaccessible.

Request sent:
https://gadi-rhevm.qa.lab.tlv.redhat.com/api/datacenters/ae912477-ecfb-411a-843f-1512ee48f0b3/storagedomains/c699614c-134c-4d3c-a6de-53ce023a0f53/activate

application/xml

<action>
     <async>false</async>
     <grace_period>
         <expiry>10</expiry>
     </grace_period>
 </action>

response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <status>
        <state>failed</state>
    </status>
    <fault>
        <reason>Operation Failed</reason>
        <detail>[Cannot activate Storage. The relevant Storage Domain is inaccessible.
-Please handle Storage Domain issues and retry the operation.]</detail>
    </fault>
</action>



Version-Release number of selected component (if applicable):
rhevm-3.1.0-12.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Send a REST request to activate an already active storage domain
  
Actual results:
HTTP 400 response:

Expected results:
Response should reflect the status of the domain - e.g. "Domain already active"

Additional info:

Comment 1 Haim 2012-08-19 13:53:51 UTC
please attach full engine log.

Comment 2 Gadi Ickowicz 2012-08-20 06:16:08 UTC
Created attachment 605585 [details]
engine logs

relevant lines in the log:


2012-08-20 09:01:20,169 INFO  [org.ovirt.engine.core.bll.LoginUserCommand] (ajp-/127.0.0.1:8009-2) Running command: LoginUserCommand internal: false.
2012-08-20 09:01:20,218 WARN  [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8009-2) calling GetConfigurationValueQuery (ApplicationMode) with null version, using default general for version
2012-08-20 09:01:20,281 INFO  [org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand] (ajp-/127.0.0.1:8009-2) [281b8597] Lock Acquired to object EngineLock [exclusiveLocks= key: e24980ad-9f5a-4f2b-b5cb-5ed09224f9c8 value: STORAGE
, sharedLocks= ]
2012-08-20 09:01:20,281 WARN  [org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand] (ajp-/127.0.0.1:8009-2) [281b8597] CanDoAction of action ActivateStorageDomain failed. Reasons:VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__ACTIVATE,ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL
2012-08-20 09:01:20,281 INFO  [org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand] (ajp-/127.0.0.1:8009-2) [281b8597] Lock freed to object EngineLock [exclusiveLocks= key: e24980ad-9f5a-4f2b-b5cb-5ed09224f9c8 value: STORAGE
, sharedLocks= ]
2012-08-20 09:01:20,295 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8009-2) Operation Failed: [Cannot activate Storage. The relevant Storage Domain is inaccessible.
-Please handle Storage Domain issues and retry the operation.]
2012-08-20 09:01:20,295 INFO  [org.ovirt.engine.core.bll.LogoutUserCommand] (ajp-/127.0.0.1:8009-2) [7c275e45] Running command: LogoutUserCommand internal: false.
2012-08-20 09:01:57,646 INFO  [org.ovirt.engine.core.bll.LoginUserCommand] (ajp-/127.0.0.1:8009-10) Checking if user admin@internal is an admin, result true

Comment 3 Gadi Ickowicz 2012-09-05 15:05:25 UTC
*** Bug 854469 has been marked as a duplicate of this bug. ***

Comment 4 Itamar Heim 2013-03-12 09:38:06 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.

Comment 6 Vered Volansky 2013-11-13 12:40:42 UTC
I get 409 conflict response, but similar body:
<action>
<status>
<state>failed</state>
</status>
<fault>
<reason>Operation Failed</reason>
<detail>[Cannot activate Storage. The relevant Storage Domain is inaccessible.
-Please handle Storage Domain issues and retry the operation.]</detail>
</fault>
</action>

Will fix detail element.

Comment 7 Vered Volansky 2013-11-17 06:01:00 UTC
After discussion with Allon decided to allow the operation - do nothing with a proper audit log alert. We now have a 200 OK response.

Comment 8 Michael Pasternak 2013-11-17 07:12:44 UTC
(In reply to Vered Volansky from comment #7)
> After discussion with Allon decided to allow the operation - do nothing with
> a proper audit log alert. We now have a 200 OK response.

this is inconsistent with other resources in the system, take vm for instance,
it fails with CDA message "vm cannot be started, it already running".

Comment 9 Vered Volansky 2013-11-21 07:09:52 UTC
Accepted comment #8, patch is revised accordingly:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
<status>
<state>failed</state>
</status>
<fault>
<reason>Operation Failed</reason>
<detail>[Cannot activate Storage. The relevant Storage Domain's status is Active.
-Please handle Storage Domain and retry the operation.]</detail>
</fault>
</action>

Comment 10 Sandro Bonazzola 2014-01-14 08:43:55 UTC
ovirt 3.4.0 alpha has been released

Comment 11 Carlos Mestre González 2014-01-14 18:09:41 UTC
Verified, returned a 409 error with a proper message:

HTTP/1.1 409 Conflict

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <status>
        <state>failed</state>
    </status>
    <fault>
        <reason>Operation Failed</reason>
        <detail>[Cannot activate Storage. The relevant Storage Domain's status is Active.]</detail>
    </fault>
</action>

Comment 12 Itamar Heim 2014-06-12 14:09:54 UTC
Closing as part of 3.4.0