Greg Padgett has uploaded a new change for review. Change subject: core,webadmin: Failure to reconnect authenticated iSCSI LUNs ......................................................................
core,webadmin: Failure to reconnect authenticated iSCSI LUNs Fix failure to reconnect to iSCSI storage domains on LUNs requiring authentication due to missing CHAP credentials. The credentials were given to VDSM when connecting sessions on the host, but not stored in the database for future connections. Now they will be saved and sent to VDSM when required. Change-Id: I15b4cba7418d9d818fb2fd69c708fdeb20942f9c Signed-off-by: Greg Padgett <gpadg...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddSANStorageDomainCommand.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java 2 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/8344/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddSANStorageDomainCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddSANStorageDomainCommand.java index 59ed51e..b1eed71 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddSANStorageDomainCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddSANStorageDomainCommand.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.bll.Backend; import org.ovirt.engine.core.common.action.AddSANStorageDomainParameters; import org.ovirt.engine.core.common.businessentities.LUNs; +import org.ovirt.engine.core.common.businessentities.storage_server_connections; import org.ovirt.engine.core.common.vdscommands.CreateVGVDSCommandParameters; import org.ovirt.engine.core.common.vdscommands.GetVGInfoVDSCommandParameters; import org.ovirt.engine.core.common.vdscommands.VDSCommandType; @@ -61,6 +62,17 @@ new GetVGInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getstorage())) .getReturnValue(); + // connection details from VDS don't have CHAP credentials, so apply them from the UI + storage_server_connections sdConn = getStorageDomain().getStorageStaticData().getConnection(); + if (sdConn != null && sdConn.getuser_name() != null && sdConn.getpassword() != null) { + for (LUNs lun : luns) { + for (storage_server_connections lunConn : lun.getLunConnections()) { + lunConn.setuser_name(sdConn.getuser_name()); + lunConn.setpassword(sdConn.getpassword()); + } + } + } + TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java index 6b7c33c..841077d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java @@ -1619,6 +1619,13 @@ storageDomain.setstorage_name((String) model.getName().getEntity()); + if ((Boolean) sanModel.getUseUserAuth().getEntity()) { + storage_server_connections connection = new storage_server_connections(); + connection.setuser_name((Boolean) sanModel.getUseUserAuth().getEntity() ? (String) sanModel.getUserName().getEntity() : ""); //$NON-NLS-1$ + connection.setpassword((Boolean) sanModel.getUseUserAuth().getEntity() ? (String) sanModel.getPassword().getEntity() : ""); //$NON-NLS-1$ + storageDomain.setConnection(connection); + } + if (isNew) { SaveNewSanStorage(); -- To view, visit http://gerrit.ovirt.org/8344 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15b4cba7418d9d818fb2fd69c708fdeb20942f9c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Padgett <gpadg...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches