Bug 1136061
Summary: | updating SPM level for host using ovirt-shell fails due to wrong expected value type | ||
---|---|---|---|
Product: | [Retired] oVirt | Reporter: | sefi litmanovich <slitmano> |
Component: | ovirt-engine-api | Assignee: | Juan Hernández <juan.hernandez> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Petr Matyáš <pmatyas> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.5 | CC: | bugs, ecohen, gklein, istein, omachace, rbalakri, slitmano, yeylon |
Target Milestone: | --- | ||
Target Release: | 3.6.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | infra | ||
Fixed In Version: | 3.6.0-12 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-04 11:43:18 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: | 1146457 |
Description
sefi litmanovich
2014-09-01 14:41:31 UTC
This happens because the "storage_manager" property is defined in the XML schema with both attributes and text content (it is the only property defined in this way): <xs:complexType name="StorageManager"> <xs:simpleContent> <xs:extension base="xs:boolean"> <xs:attribute name="priority" type="xs:int"/> </xs:extension> </xs:simpleContent> </xs:complexType> As a result it is impossible to create a XML document that contains the "priority" attribute but not the text content. When the command "update host myhost --storage_manager-priority 2" is executed it will generate the following XML document: <host> <storage_manager priority="2"/> </host> This isn't correct, as the value of text content is empty instead of a valid boolean, thus the complain from the engine. A correct XML document would look like this: <host> <storage_manager priority="2">true</storage_manager> </host> But the CLI can't invent the the value, as it doesn't have any way to decide if it should be "true" or "false". The solution to this problem would be to model the "storage_manager" element with nested elements instead of attributes, for example: <xs:complexType name="StorageManager"> <xs:sequence> <xs:element name="enabled" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element name="priority" type="xs:int" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> That way the CLI could send values separately. But this breaks backwards compatibility, so it isn't feasible in 3.x. The proposed solution is to add a new "spm" element that contains the priority and the status as nested elements: <host> <spm> <priority>5</priority> <status> <state>spm</state> </status> </spm> </host> The existing "storage_manager" element will be preserved, but it won't be documented in the RSDL metadata, so the CLI won't see it. Once the proposed patch is merged the Python SDK will need to be regenerated. No change is needed in the CLI, but the command to use will be different: Old: update host myhost --storage_manager-priority 2 New: update host myhost --spm-priority 2 *** Bug 1146447 has been marked as a duplicate of this bug. *** Verified in build 3.6.0-1 update host myhost --spm-priority 2 spm-priority : 2 storage_manager-priority : 2 I just realized that there is a bug in the implementation of this change. The SPM status isn't reported correctly. This is what we get: <spm> <priority>5</priority> <-- Note the missing "state" </spm> And this is what we should get: <spm> <priority>5</priority> <status> <state>whatever</state> </status> </spm> Can we re-open the bug to handle this? oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue. If problems still persist, please open a new BZ and reference this one. |