Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1061121

Summary: [engine] Extending a storage domain that is not attached to a datacenter fails with NullPointerException
Product: [Retired] oVirt Reporter: Gadi Ickowicz <gickowic>
Component: ovirt-engine-coreAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Gadi Ickowicz <gickowic>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4CC: acathrow, amureini, gklein, iheim, nlevinki, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: All   
OS: Linux   
Whiteboard: storage
Fixed In Version: ovirt-3.4.0-rc Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-31 12:23: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:
Attachments:
Description Flags
engine logs none

Description Gadi Ickowicz 2014-02-04 12:07:50 UTC
Created attachment 859102 [details]
engine logs

Description of problem:
Attempting to extend a storage domain that is not attached to a datacenter fails in engine with NullPointerException:

2014-02-04 13:42:01,424 INFO  [org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand] (ajp--127.0.0.1-8702-2) [4791a8f3] Running command: ConnectAllHostsToLunCommand internal: true. Entities affected :  ID
: ab3e493f-62bb-49c7-8048-23334f0cd362 Type: Storage
2014-02-04 13:42:01,430 ERROR [org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand] (ajp--127.0.0.1-8702-2) [4791a8f3] Command org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand throw exceptio
n: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getAllRunningVdssInPool(StorageHandlingCommandBase.java:74) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.executeCommand(ConnectAllHostsToLunCommand.java:67) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1114) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1199) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1875) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:174) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:116) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1219) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:351) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:413) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:392) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runInternalAction(Backend.java:341) [bll.jar:]
        at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) [:1.7.0_51]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]
<...exception continues...>
2014-02-04 13:42:01,681 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp--127.0.0.1-8702-2) [4791a8f3] Correlation ID: 4791a8f3, Call Stack: null, Custom Event ID: -1, Message: Failed to connect Host Non interactive user to device. (User: admin)
2014-02-04 13:42:01,691 WARN  [org.ovirt.engine.core.bll.storage.ExtendSANStorageDomainCommand] (ajp--127.0.0.1-8702-2) [4791a8f3] CanDoAction of action ExtendSANStorageDomain failed. Reasons:VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__EXTEND,ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2,$status Unknown,ERROR_CANNOT_EXTEND_CONNECTION_FAILED,$lun  
2014-02-04 13:42:01,707 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp--127.0.0.1-8702-2) Operation Failed: [Cannot extend Storage. The relevant Storage Domain's status is Unknown., Cannot extend Storage Domain. Storage device   is unreachable on ${hostName}.]


Version-Release number of selected component (if applicable):
ovirt-engine-3.4.0-0.5.beta1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Extend storage domain that is not attached to a datacenter (possible through REST for example)


Actual results:
Fails in engine with NPE

Expected results:
Should fail gracefully with appropriate message from CanDoAction

Additional info:

Comment 1 Sandro Bonazzola 2014-03-03 14:40:09 UTC
This BZ should be fixed in oVirt 3.4.0 RC

Comment 2 Gadi Ickowicz 2014-03-05 07:10:04 UTC
verified on av2 - fails with appropriate error message.

sdk output:

>>> lun_id = '360060160f4a030002a35d37fd01be311'
>>> domain_to_extend = api.storagedomains.get('iscsi_0')
>>> storage = domain_to_extend.get_storage()
>>> volume_group = storage.get_volume_group()
>>> new_lun = params.LogicalUnit(target=lun.get_target(), address=lun.get_address(), id=lun_id, portal=lun.get_portal(), port=lun.get_port())
>>> volume_group.add_logical_unit(new_lun)
>>> storage.set_volume_group(volume_group)
>>> domain_to_extend.set_storage(storage)
>>> domain_to_extend.set_host(params.Host(name='aqua-vds5.qa.lab.tlv.redhat.com'))
>>> domain_to_extend.update(correlation_id='extend_unattached_domain')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 11234, in update
    headers={"Correlation-Id":correlation_id}
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 78, in update
    return self.request('PUT', url, body, headers)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 118, in request
    persistent_auth=self._persistent_auth)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 140, in __doRequest
    persistent_auth=persistent_auth
  File "/usr/lib/python2.6/site-packages/ovirtsdk/web/connection.py", line 134, in doRequest
    raise RequestError, response
RequestError: 
status: 409
reason: Conflict
detail: Cannot extend Storage. The relevant Storage Domain's status is Unknown.


relevant engine log section:
2014-03-04 19:05:30,196 INFO  [org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand] (ajp-/127.0.0.1:8702-2) [extend_unattached_domain] Running command: ConnectStorageToVdsCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: System
2014-03-04 19:05:30,201 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand] (ajp-/127.0.0.1:8702-2) [extend_unattached_domain] START, ConnectStorageServerVDSCommand(HostName = aqua-vds5.qa.lab.tlv.redhat.com, HostId = 18f2fe99-9958-4e24-bc4d-3452d350be2d, storagePoolId = 00000000-0000-0000-0000-000000000000, storageType = ISCSI, connectionList = [{ id: null, connection: 10.35.160.106, iqn: iqn.1992-04.com.emc:cx.ckm00121000438.b6, vfsType: null, mountOptions: null, nfsVersion: null, nfsRetrans: null, nfsTimeo: null };]), log id: 79e2bfff
2014-03-04 19:05:30,501 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand] (ajp-/127.0.0.1:8702-2) [extend_unattached_domain] FINISH, ConnectStorageServerVDSCommand, return: {00000000-0000-0000-0000-000000000000=0}, log id: 79e2bfff
2014-03-04 19:05:30,524 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand] (ajp-/127.0.0.1:8702-2) START, GetDeviceListVDSCommand(HostName = aqua-vds5.qa.lab.tlv.redhat.com, HostId = 18f2fe99-9958-4e24-bc4d-3452d350be2d, storageType=ISCSI), log id: 652adb64
2014-03-04 19:05:31,165 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand] (ajp-/127.0.0.1:8702-2) FINISH, GetDeviceListVDSCommand, return: [org.ovirt.engine.core.common.businessentities.LUNs@bd7bb336, org.ovirt.engine.core.common.businessentities.LUNs@ede21726, org.ovirt.engine.core.common.businessentities.LUNs@4662b07b, org.ovirt.engine.core.common.businessentities.LUNs@3504dc2, org.ovirt.engine.core.common.businessentities.LUNs@bacdefff, org.ovirt.engine.core.common.businessentities.LUNs@a710fe89], log id: 652adb64
2014-03-04 19:05:31,190 WARN  [org.ovirt.engine.core.bll.storage.ExtendSANStorageDomainCommand] (ajp-/127.0.0.1:8702-2) [extend_unattached_domain] CanDoAction of action ExtendSANStorageDomain failed. Reasons:VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__EXTEND,ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2,$status Unknown
2014-03-04 19:05:31,195 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-2) Operation Failed: [Cannot extend Storage. The relevant Storage Domain's status is Unknown.]

Comment 3 Sandro Bonazzola 2014-03-31 12:23:06 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released