import org.ovirt.engine.sdk.Api; import org.ovirt.engine.sdk.decorators.Host; import org.ovirt.engine.sdk.entities.PowerManagement; import org.ovirt.engine.sdk.entities.Slaves; import org.ovirt.engine.sdk.entities.Storage; import org.ovirt.engine.sdk.entities.StorageDomain; public class debugRemove { private static final String URL = "https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api"; public static void main(String[] args) throws Exception { Api api = new Api(URL, "admin@internal", "123456", true); StorageDomain st = new StorageDomain(); st.setType("data"); st.setHost((org.ovirt.engine.sdk.entities.Host) api.getHosts().list().get(0)); Storage storage = new Storage(); storage.setPath("/data/images2"); storage.setType("localfs"); st.setStorage(storage); api.getStorageDomains().add(st); api.close(); } } causes to: Exception in thread "main" code : 409 reason: Conflict detail: Cannot add Storage Connection. Storage connection already exists. at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118) at org.ovirt.engine.sdk.web.HttpProxyBroker.add(HttpProxyBroker.java:209) at org.ovirt.engine.sdk.decorators.StorageDomains.add(StorageDomains.java:230) at debugRemove.main(debugRemove.java:21)
(In reply to Ilia Meerovich from comment #0) > import org.ovirt.engine.sdk.Api; > import org.ovirt.engine.sdk.decorators.Host; > import org.ovirt.engine.sdk.entities.PowerManagement; > import org.ovirt.engine.sdk.entities.Slaves; > import org.ovirt.engine.sdk.entities.Storage; > import org.ovirt.engine.sdk.entities.StorageDomain; > > > public class debugRemove { > private static final String URL = > "https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api"; > > public static void main(String[] args) throws Exception { > Api api = new Api(URL, "admin@internal", "123456", true); > StorageDomain st = new StorageDomain(); > st.setType("data"); > st.setHost((org.ovirt.engine.sdk.entities.Host) > api.getHosts().list().get(0)); > Storage storage = new Storage(); > storage.setPath("/data/images2"); > storage.setType("localfs"); > st.setStorage(storage); > api.getStorageDomains().add(st); > api.close(); > } > } > > causes to: > Exception in thread "main" > code : 409 > reason: Conflict > detail: Cannot add Storage Connection. Storage connection already exists. > at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118) > at org.ovirt.engine.sdk.web.HttpProxyBroker.add(HttpProxyBroker.java:209) > at > org.ovirt.engine.sdk.decorators.StorageDomains.add(StorageDomains.java:230) > at debugRemove.main(debugRemove.java:21) ilia, can you reproduce this using native api?
I am also getting the same error while adding iso domain "Cannot add Storage Connection. Storage connection already exists."
anil, can u please also query the DB, and add the output of the following query: SELECT id,connection,iqn,port,portal,storage_type,mount_options,vfs_type FROM storage_server_connections;
Created attachment 915776 [details] Comment (This comment was longer than 65,535 characters and has been moved to an attachment by Red Hat Bugzilla).
Hi Ilia, You may hit bug 991470 which has been closed; the proposed alternative is to reuse the storage connection. The means to do it was introduced as part of edit connections feature [1]. * Can you please verify that the proposed solution [1] resolves the issue? * Have you encountered the described issue after invoking any operation through the rest-api (creating the domain/etc.)? [1] http://www.ovirt.org/Features/Manage_Storage_Connections#Add_new_file_.28nfs.2Fposix.2Flocal.29_storage_domain_with_existing_storage_connection_.28POST.29
Hi Daniel, If this workaround breaks/change the flow was used before storage-connections feature/3.3, - it's unacceptable ... (In reply to Daniel Erez from comment #5) > Hi Ilia, > > You may hit bug 991470 which has been closed; the proposed alternative is to > reuse the storage connection. The means to do it was introduced as part of > edit connections feature [1]. > > * Can you please verify that the proposed solution [1] resolves the issue? > * Have you encountered the described issue after invoking any operation > through the rest-api (creating the domain/etc.)? > > [1] > http://www.ovirt.org/Features/Manage_Storage_Connections#Add_new_file_.28nfs. > 2Fposix.2Flocal.29_storage_domain_with_existing_storage_connection_.28POST.29
(In reply to Michael Pasternak from comment #6) > Hi Daniel, > > If this workaround breaks/change the flow was used before > storage-connections feature/3.3, - it's unacceptable ... afaik, the workaround has been introduced instead of a fallback logic in the rest-api: http://gerrit.ovirt.org/#/c/17658/ > > (In reply to Daniel Erez from comment #5) > > Hi Ilia, > > > > You may hit bug 991470 which has been closed; the proposed alternative is to > > reuse the storage connection. The means to do it was introduced as part of > > edit connections feature [1]. > > > > * Can you please verify that the proposed solution [1] resolves the issue? > > * Have you encountered the described issue after invoking any operation > > through the rest-api (creating the domain/etc.)? > > > > [1] > > http://www.ovirt.org/Features/Manage_Storage_Connections#Add_new_file_.28nfs. > > 2Fposix.2Flocal.29_storage_domain_with_existing_storage_connection_.28POST.29
(In reply to Daniel Erez from comment #7) > (In reply to Michael Pasternak from comment #6) > > Hi Daniel, > > > > If this workaround breaks/change the flow was used before > > storage-connections feature/3.3, - it's unacceptable ... > > afaik, the workaround has been introduced instead of a fallback logic in the > rest-api: http://gerrit.ovirt.org/#/c/17658/ > this patch was "abandoned", also i'm not sure it related to the mention issue.
Daniel, I cannot use this workaround since ART backend is just providing needed api to tests so it is doing what tests are telling to it to do. I just wrote simple programm in java sdk in order to reproduce this issue easily. Actually it can be reproduced also via UI so customer may/will face this issue.
(In reply to Ilia Meerovich from comment #9) > Daniel, > > I cannot use this workaround since ART backend is just providing needed api > to tests so it is doing what tests are telling to it to do. > I just wrote simple programm in java sdk in order to reproduce this issue > easily. > Actually it can be reproduced also via UI so customer may/will face this > issue. * Can you please provide reproduce steps for the issue solely through the UI? (I need to know this for determining whether this issue is related to bug 991470) * Can you please attach the relevant logs and preferably DB dump as well?
This is a dup of bug 991470 which was closed. Keeping this to track the future fix.
This was solved as part of bug 991470, please verify.
verified using the same steps described in bug 994170 (comment 14) on av7: POST: <storage_domain> <name>data1 bla</name> <type>data</type> <host id="66864669-9940-4482-8232-a83a8d01a77e"/> <storage> <type>nfs</type> <address>10.35.160.108</address> <path>/RHEV/gickowic/nfs2</path> </storage> </storage_domain> response: <fault> <reason>Operation Failed</reason> <detail> [Storage Domain name must be formed of "a-z0-9A-Z" or "-_"] </detail> </fault> POST: <storage_domain> <name>data1_bla</name> <type>data</type> <host id="66864669-9940-4482-8232-a83a8d01a77e"/> <storage> <type>nfs</type> <address>10.35.160.108</address> <path>/RHEV/gickowic/nfs2</path> </storage> </storage_domain> Response: Status Code: 201 Created Connection: close Content-Encoding: gzip Content-Length: 384 Content-Type: application/xml Date: Sun, 27 Apr 2014 13:45:54 GMT Location: https://gadi-rhevm.scl.lab.tlv.redhat.com/api/api/storagedomains/c291c3ba-187d-428c-833b-e0463dbff95a Vary: Accept-Encoding
Closing as part of 3.4.0