Bug 849427 - [engine-core] Activating an already active domain through REST fails with "domain inaccessible"
Summary: [engine-core] Activating an already active domain through REST fails with "do...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.4.0
Assignee: Vered Volansky
QA Contact: Carlos Mestre González
URL:
Whiteboard: storage
: 854469 (view as bug list)
Depends On:
Blocks: rhev3.4beta 1142926
TreeView+ depends on / blocked
 
Reported: 2012-08-19 12:04 UTC by Gadi Ickowicz
Modified: 2016-02-10 18:23 UTC (History)
12 users (show)

Fixed In Version: ovirt-3.4.0-alpha1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-12 09:38:06 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine logs (3.68 MB, application/x-tar)
2012-08-20 06:16 UTC, Gadi Ickowicz
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 21320 0 None None None Never

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


Note You need to log in before you can comment on or make changes to this bug.