Created attachment 1322666 [details] server.log Description of problem: Extending a storage domain via rest api is failing with: <html> <head> <title>Error</title> </head> <body>Internal Server Error</body> </html> in server.log: 2017-09-06 16:15:22,815+03 ERROR [io.undertow.request] (default task-6) UT005023: Exception handling request to /ovirt-engine/api/v4/storagedomains/6f8d8a11-71d3-4b19-b8e0-e33ed0834b95: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: org.ovirt.api.metamodel.server.ValidationException: Parameter 'storage_domain.storage.logical_units.vendor_id' is mandatory but was not provided. which is a new mandatory parameter as in 4.1 everything is working fine. The request: POST to /api/storagedomains/6f8d8a11-71d3-4b19-b8e0-e33ed0834b95 <storage_domain> <storage> <logical_units> <logical_unit id="{LUN_ID}"> <address>{SERVER_IP}</address> <port>3260</port> <target>{TARGET_IQN}</target> </logical_unit> </logical_units> <override_luns>true</override_luns> <type>iscsi</type> </storage> <host> <name>host_mixed_3</name> </host> </storage_domain> Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create a storage domain 2. Attach it to a data center (already initialized) 3. Activate it 4. Extend it via rest api - command above Actual results: Expected results: Additional info:
Juan, I don't see anything that was changed in the code that may have caused it, where is this validation taking place?
We have recently enabled a mechanism that enforces the constraints that are described in the specification of the API. In this particular case it is enforcing the following constraints: https://github.com/oVirt/ovirt-engine-api-model/blob/867812110f93cb168221ce1e747009690a5d5825/src/main/java/services/StorageDomainsService.java#L141-L160 That description was copied from the old "rsdl_metadata.yaml" file, which wasn't really checked or enforced. To fix this issue we need to fix the constraints in the specification of the API. I, release a new version and then update the engine to use it. The fix is to replace "mandatory" with "optional" for the attributes that aren't really mandatory.
Raz, I assume that with storage_domain.storage.logical_units.vendor_id set, it works?
With th vendor_id I now get: 2017-09-11 12:28:05,257+03 ERROR [io.undertow.request] (default task-10) UT005023: Exception handling request to /ovirt-engine/api/v4/storagedomains/68b2d50f-bc9d-4e41-bc41-ab7532449ee9: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: org.ovirt.api.metamodel.server.ValidationException: Parameter 'storage_domain.storage.logical_units.username' is mandatory but was not provided.
(In reply to Raz Tamir from comment #4) > With th vendor_id I now get: > > 2017-09-11 12:28:05,257+03 ERROR [io.undertow.request] (default task-10) > UT005023: Exception handling request to > /ovirt-engine/api/v4/storagedomains/68b2d50f-bc9d-4e41-bc41-ab7532449ee9: > java.lang.RuntimeException: > org.jboss.resteasy.spi.UnhandledException: > org.ovirt.api.metamodel.server.ValidationException: Parameter > 'storage_domain.storage.logical_units.username' is mandatory but was not > provided. And with storage_domain.storage.logical_units.username, it works? (Long story short, when all parameters are provided, is the functionality working?)
Yes, the functionality is working with the listed parameters as mendatory: vendor_id username serial product_id portal password paths lun_mapping
Juan hi, The fix in the model is merged. Is the update of the engine pom should be part of this bug ? Thanks
(In reply to Fred Rolland from comment #7) > Juan hi, > > The fix in the model is merged. > Is the update of the engine pom should be part of this bug ? > Thanks Not necessary, Ori will release new version of the model and bump engine dependency.
*** Bug 1491169 has been marked as a duplicate of this bug. ***
Version 4.2.18 of the model, containing this fix, has been released. The engine does now need to be updated to use that version of the model: restapi: Update to version 4.2.18 of the model https://gerrit.ovirt.org/81717 That completes the fix for this issue.
(In reply to Juan Hernández from comment #10) > Version 4.2.18 of the model, containing this fix, has been released. The > engine does now need to be updated to use that version of the model: > > restapi: Update to version 4.2.18 of the model > https://gerrit.ovirt.org/81717 > > That completes the fix for this issue. Merged
Verified on ovirt-engine-4.2.0-0.0.master.20170921184504.gitfcfc9a7.el7.centos Add iSCSI storage domain from Targets -> LUNs works fine
comment #12 is a mistake Verified on ovirt-engine-4.2.0-0.0.master.20170921184504.gitfcfc9a7.el7.centos Extend storage domain works as usual with <target>, <address> and <port> as mandatory
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.