Bug 1059125

Summary: Element '<ovirtsdk.infrastructure.brokers.Cluster object at 0x7b5ee90>' has no attribute 'ha_reservation'
Product: [Retired] oVirt Reporter: Meital Bourvine <mbourvin>
Component: ovirt-engine-sdkAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED DUPLICATE QA Contact: Ondra Machacek <omachace>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.4CC: acathrow, gklein, iheim, juan.hernandez, nlevinki, omachace, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-engine-sdk-python-3.4.0.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-18 15:41:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Meital Bourvine 2014-01-29 08:44:52 UTC
Description of problem:
Creating ISCSI cluster from SDK fails:
Element '<ovirtsdk.infrastructure.brokers.Cluster object at 0x7b5ee90>' has no attribute 'ha_reservation'

Version-Release number of selected component (if applicable):
oVirt 3.4.0-3 beta1

How reproducible:
100%

Steps to Reproduce:
1. Create ISCSI DC via REST
2. Add a cluster via REST
3.

Actual results:
Fails with Element '<ovirtsdk.infrastructure.brokers.Cluster object at 0x7b5ee90>' has no attribute 'ha_reservation'

Expected results:
Will succeed creating a cluster.

Additional info:

2014-01-28 20:09:14,081 - MainThread - datacenters - INFO - New entity was added successfully
2014-01-28 20:09:14,085 - MainThread - datacenters - INFO - Property 'data_center->storage_type' has correct value: iscsi
2014-01-28 20:09:14,087 - MainThread - datacenters - INFO - Property 'data_center->version->major' has correct value: 3
2014-01-28 20:09:14,089 - MainThread - datacenters - INFO - Property 'data_center->version->minor' has correct value: 4
2014-01-28 20:09:14,091 - MainThread - datacenters - INFO - Property 'data_center->name' has correct value: datacenter_iscsi_storage_cov
2014-01-28 20:09:14,092 - MainThread - plmanagement.trace - INFO - art.rhevm_api.tests_lib.low_level.datacenters.checkSupportedVersions(name=datacenter_iscsi_storage_cov)
2014-01-28 20:09:15,064 - MainThread - datacenters - INFO - Validated supported versions of data center datacenter_iscsi_storage_cov
2014-01-28 20:09:15,066 - MainThread - art.rhevm_api.tests_lib.high_level.datacenters - INFO - Datacenter datacenter_iscsi_storage_cov was created successfully
2014-01-28 20:09:15,068 - MainThread - plmanagement.trace - INFO - art.rhevm_api.tests_lib.low_level.clusters.addCluster(positive=True, kwargs={'data_center': 'datacenter_iscsi_storage_cov', 'name': 'cluster_iscsi_storage_cov', 'version': '3.4', 'cpu': 'Intel Conroe Family'})
2014-01-28 20:09:15,069 - MainThread - plmanagement.trace - INFO - art.rhevm_api.tests_lib.low_level.clusters._prepareClusterObject(kwargs={'cpu': 'Intel Conroe Family', 'version': '3.4', 'name': 'cluster_iscsi_storage_cov', 'data_center': 'datacenter_iscsi_storage_cov'})
2014-01-28 20:09:16,311 - MainThread - clusters - DEBUG - CREATE api content is --  collection:clusters element:<cluster>
    <name>cluster_iscsi_storage_cov</name>
    <cpu id="Intel Conroe Family"/>
    <data_center href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e" id="d9fcb783-857b-483a-96a1-791e2597802e">
        <name>datacenter_iscsi_storage_cov</name>
        <link href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e/storagedomains" rel="storagedomains"/>
        <link href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e/clusters" rel="clusters"/>
        <link href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e/networks" rel="networks"/>
        <link href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e/permissions" rel="permissions"/>
        <link href="/api/datacenters/d9fcb783-857b-483a-96a1-791e2597802e/quotas" rel="quotas"/>
        <storage_type>iscsi</storage_type>
        <version major="3" minor="4"/>
        <supported_versions>
            <version major="3" minor="4"/>
        </supported_versions>
        <status>
            <state>uninitialized</state>
        </status>
    </data_center>
    <version major="3" minor="4"/>
</cluster>
 
2014-01-28 20:09:19,422 - MainThread - clusters - INFO - New entity was added successfully
2014-01-28 20:09:19,425 - MainThread - clusters - ERROR - Element '<ovirtsdk.infrastructure.brokers.Cluster object at 0x7b5ee90>' has no attribute 'ha_reservation'
2014-01-28 20:09:19,428 - MainThread - clusters - WARNING - Attribute 'cluster->data_center->supported_versions' doesn't exist in actual results
2014-01-28 20:09:19,430 - MainThread - clusters - INFO - Property 'cluster->data_center->id' has correct value: d9fcb783-857b-483a-96a1-791e2597802e
2014-01-28 20:09:19,431 - MainThread - clusters - WARNING - Attribute 'cluster->data_center->storage_type' doesn't exist in actual results
2014-01-28 20:09:19,433 - MainThread - clusters - WARNING - Attribute 'cluster->data_center->version' doesn't exist in actual results
2014-01-28 20:09:19,435 - MainThread - clusters - WARNING - Attribute 'cluster->data_center->name' doesn't exist in actual results
2014-01-28 20:09:19,437 - MainThread - clusters - INFO - Property 'cluster->name' has correct value: cluster_iscsi_storage_cov
2014-01-28 20:09:19,440 - MainThread - clusters - INFO - Property 'cluster->cpu->id' has correct value: Intel Conroe Family
2014-01-28 20:09:19,442 - MainThread - clusters - INFO - Property 'cluster->version->major' has correct value: 3
2014-01-28 20:09:19,444 - MainThread - clusters - INFO - Property 'cluster->version->minor' has correct value: 4
2014-01-28 20:09:19,445 - MainThread - clusters - ERROR - Element '<ovirtsdk.infrastructure.brokers.Cluster object at 0x7b5ee90>' has no attribute 'ksm'
2014-01-28 20:09:19,448 - MainThread - plmanagement.unittest_loader - ERROR - TEST SUITE setUp ERROR: addCluster cluster_iscsi_storage_cov with cpu_type Intel Conroe Family and version 3.4 to datacenter datacenter_iscsi_storage_cov failed: storage_bug_coverage.test_create_template_from_vm_non_ascii_name
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/3.4-storage_bug_cov_ascii-iscsi-sdk/automation/ART/art/test_handler/plmanagement/plugins/unittest_test_runner_plugin.py", line 214, in __iter__
    self.context.setUp()
  File "/usr/lib/python2.6/site-packages/nose/suite.py", line 202, in setUp
    self.setupContext(ancestor)
  File "/usr/lib/python2.6/site-packages/nose/suite.py", line 225, in setupContext
    try_run(context, names)
  File "/usr/lib/python2.6/site-packages/nose/util.py", line 453, in try_run
    return func()
  File "/var/lib/jenkins/workspace/3.4-storage_bug_cov_ascii-iscsi-sdk/automation/ART/art/tests/rhevm/unittests/storage/storage_bug_coverage/test_create_template_from_vm_non_ascii_name.py", line 34, in setup_module
    storage_type=config.DATA_CENTER_TYPE, basename=config.BASENAME)
  File "/var/lib/jenkins/workspace/3.4-storage_bug_cov_ascii-iscsi-sdk/automation/ART/art/rhevm_api/tests_lib/high_level/datacenters.py", line 50, in build_setup
    datacenter_name))
ClusterException: addCluster cluster_iscsi_storage_cov with cpu_type Intel Conroe Family and version 3.4 to datacenter datacenter_iscsi_storage_cov failed

Comment 1 Juan Hernández 2014-01-29 12:38:41 UTC
The "ha_reservation" field has been added recently, so the SDK needed to be refreshed. The fix is available since release 3.4.0.3 of the SDK.

Builds of the packages containing the fix for Fedora 19 and CentOS 6 are available here:

http://jhernand.fedorapeople.org/rpms/ovirt-engine-sdk-python/3.4.0.3-1

Comment 2 Juan Hernández 2014-01-29 12:40:11 UTC
The URL in comment 1 is incorrect, the correct one is this:

http://jhernand.fedorapeople.org/rpms/ovirt-engine-sdk-java/3.4.0.3-1

Comment 3 Juan Hernández 2014-01-29 12:51:17 UTC
Sorry again, I keep confusing the URLs of the Python and Java SDKs. The correct one is the one is the one in comment 1, with -python at the end.

Comment 4 Ondra Machacek 2014-02-18 08:49:05 UTC
From version 3.4 there is no option to select dc_type isci, but only 
local/shared. I tested creating of both and both are working OK.

dc_local = api.datacenters.add(params.DataCenter(name='dc_local', local=True, version=params.Version(major='3', minor='4')))
api.clusters.add(params.Cluster(name='cl_local', cpu=params.CPU(id='Intel Conroe Family'), data_center=dc_local, ha_reservation=True))

dc_shared = api.datacenters.add(params.DataCenter(name='dc_shared', local=False, version=params.Version(major='3', minor='4')))
api.clusters.add(params.Cluster(name='cl_shared', cpu=params.CPU(id='Intel Conroe Family'), data_center=dc_shared, ha_reservation=True))

OK in rhevm-sdk-python-3.4.0.4-1.el6ev.noarch.

Comment 5 Ondra Machacek 2014-02-18 11:22:29 UTC
Moving back to assigned, because not working for upstream ovirt-engine-sdk-python-3.4.0.3-1.

There is still no ha_reservation attribute for class Cluster.

>>> d = api.datacenters.add(params.DataCenter(name='dc_iscsi34', storage_type='iscsi', version=params.Version(major='3', minor='4')))

>>> api.clusters.add(params.Cluster(name='cl_iscsi34', cpu=params.CPU(id='Intel Conroe Family'), data_center=d, ha_reservation=True))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'ha_reservation'

Comment 6 Ondra Machacek 2014-02-18 15:31:46 UTC
I think this is duplicate of bug 1059892.

Comment 7 Juan Hernández 2014-02-18 15:41:39 UTC
Yes, it is, I'm closing it.

*** This bug has been marked as a duplicate of bug 1059892 ***