Wow, this one was a real pain to fix as there is not much official information on how to fix this error, just a couple dozen pages from a mailing list that’s not exactly easy to follow. From what I can tell, the developers do not really want you logging into the database. But in this case we must.
First a little background. I am working on setting up Red Hat Enterprise Virtualization (RHEV), using a couple of spare machines. One machine, a desktop is running RHEL6 with RHEV-M installed via Yum. The other machine is a server that I built using the RHEV-H iso.
Once I got both machines up and running I figured I would take a poke at the WebUI and see if I could figure out my way around. So I clicked and clicked, removed and added, rebooted and restarted, and I found myself in a situation where I was trying to re-add an existing NFS share to use as a Storage Domain.
Well things started to go south pretty fast when I started to get this error in the WebUI.
“Error while executing action: Cannot add Storage Connection. Storage connection already exists.”
What is occurring here is that even though the UI no longer shows the Storage Domain as active, it still exists in the postgres database. So you must log into the database to remove it. Below are the steps.
First SSH into the server running your database. In my lab, this is the RHEV-M host. Then switch users and connect to the database
[root@pandora ~]# su – postgres
-bash-4.1$ psql engine
Now lets look at our existing storage connections. Note how we are taking care to query the ID and Connection Name.
engine=# select id, connection from storage_server_connections;
id | connection
7e7284e2-a4c5-4ff5-978e-75cf08486f0c | pandora.lab.localdomain:/var/lib/exports/iso-20150905011112
6dab7f89-629f-4ecf-95cf-b643e243a96d | pandora.lab.localdomain:/var/lib/exports/nfs
Both of these need to be removed, which we do by using the ID. Note the single quotes and the spaces.
engine=# DELETE from storage_server_connections where id=’7e7284e2-a4c5-4ff5-978e-75cf08486f0c’ ;
engine-# DELETE from storage_server_connections where id=’6dab7f89-629f-4ecf-95cf-b643e243a96d’ ;
I “should” now be able to re-add our NFS shares.
Note if you need to restart ovirt you will also need to restart httpd. I am running RHEL 6.6.
[root@pandora ~]# service ovirt-engine start
Starting oVirt Engine: [ OK ]
[root@pandora ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]