Bug 1099903

Summary: After adding two power management agents to a host, impossible to remove/override second agent
Product: Red Hat Enterprise Virtualization Manager Reporter: sefi litmanovich <slitmano>
Component: ovirt-engine-restapiAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Shai Revivo <srevivo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: aberezin, bazulay, emesika, gklein, iheim, oourfali, oramraz, pstehlik, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-3.5.0-alpha2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 17:16:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1142923, 1156165    

Description sefi litmanovich 2014-05-21 12:57:30 UTC
Description of problem:

1) add two power management to host:

--insecure \
--request PUT \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "

url:https://10.35.xx.xx:8443/ovirt-engine/api/hosts/[host_id]
<host>
    <power_management type="ipmilan">
        <enabled>true</enabled>
        <address>{agent1_address}</address>
        <username>{agent_username}</username>
        <password>{agent_password}</password>
        <pm_proxies>
            <pm_proxy>
                <type>cluster</type>
            </pm_proxy>
            <pm_proxy>
                <type>dc</type>
            </pm_proxy>
        </pm_proxies>
        <agents>
            <agent type="ipmilan">
                <address>{agent1_address}</address>
                <username>{agent1_username}</username>
                <password>{agent1_password}</password>
                <concurrent>false</concurrent>
                <order>1</order>
            </agent>
            <agent type="apc_snmp">
                <address>{agent2_address}</address>
                <username>{agent2_username}</username>
                <password>{agent2_password}</password>
                <concurrent>false</concurrent>
                <order>2</order>
            </agent>
        </agents>
    </power_management>
</host>

two PM agents successfully added to the host.

2) now let's say I want only the first agent without the second. issued:

--insecure \
--request PUT \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "

url:https://10.35.xx.xx:8443/ovirt-engine/api/hosts/[host_id]

<host>    
<power_management type="ipmilan">
            <enabled>true</enabled>
            <address>{agent1_address}</address>
            <username>{agent_username}</username>
            <password>{agent_password}</password>
            <pm_proxies>
                <pm_proxy>
                    <type>cluster</type>
                </pm_proxy>
                <pm_proxy>
                    <type>dc</type>
                </pm_proxy>
            </pm_proxies>
            <agents>
                <agent type="ipmilan">
                     <address>{agent1_address}</address>
                    <username>{agent1_username}</username>
                    <password>{agent1_password}</password>
                    <concurrent>false</concurrent>
                    <order>1</order>
                </agent>
            </agents>
        </power_management>
</host>

this had no effect at all, the second agent was still there with all it's credentials.

3) now let's say I want to try to remove both (disable power_management on the host) and then add only one pm agent:

a)
--insecure \
--request PUT \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "

url:https://10.35.xx.xx:8443/ovirt-engine/api/hosts/[host_id]

<host>    
<power_management type="ipmilan">
        <enabled>false</enabled>
        </power_management>
</host>

b)
--insecure \
--request PUT \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "

url:https://10.35.xx.xx:8443/ovirt-engine/api/hosts/[host_id]

<host>    
<power_management type="ipmilan">
            <enabled>true</enabled>
            <address>{agent1_address}</address>
            <username>{agent1_username}</username>
            <password>{agent1_password}</password>
            <pm_proxies>
                <pm_proxy>
                    <type>cluster</type>
                </pm_proxy>
                <pm_proxy>
                    <type>dc</type>
                </pm_proxy>
            </pm_proxies>
          </power_management>
</host>

this also results with last added pm as first agent and with the original second agent still there.



How reproducible:

always


Expected results:

There should be a way to remove the credentials of previously configured agent.
I would expect that a new request with new configurations will run over the old one.


Additional info:

Comment 1 sefi litmanovich 2014-06-24 16:00:04 UTC
Verified on ovirt-engine-3.5.0-0.0.master.20140605145557.git3ddd2de.el6.noarch.

Comment 2 Eyal Edri 2015-02-17 17:16:03 UTC
rhev 3.5.0 was released. closing.