Maor Lipchuk has posted comments on this change.

Change subject: engine: Setup multiple iscsi sessions with the iscsi target
......................................................................


Patch Set 2: Code-Review-1

(5 comments)

You will have a compilation error in ISCSIStorageHelper.
There is no getIscsiInitiatorsByVdsIdAndStorageTargetId in InterfaceDAO only 
getIscsiInitiatorsByHostIdAndStorageTargetId

http://gerrit.ovirt.org/#/c/23198/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java:

Line 83:         for (StorageServerConnections conn : conns) {
Line 84:             // Get list of endpoints (nics or vlans) that will 
initiate iscsi sessions.
Line 85:             // Targets are represented by StorageServerConnections 
object (connection, iqn, port, portal).
Line 86:             List<VdsNetworkInterface> initiators = 
DbFacade.getInstance().getInterfaceDao()
Line 87:                     
.getIscsiInitiatorsByVdsIdAndStorageTargetId(vdsId, conn.getid());
There is no getIscsiInitiatorsByVdsIdAndStorageTargetId in InterfaceDAO only 
getIscsiInitiatorsByHostIdAndStorageTargetId (Host instead of Vds)
Line 88: 
Line 89:             if (initiators != null && !initiators.isEmpty()) {
Line 90:                 conn.setInitiatorName(initiators.remove(0).getName());
Line 91: 


Line 85:             // Targets are represented by StorageServerConnections 
object (connection, iqn, port, portal).
Line 86:             List<VdsNetworkInterface> initiators = 
DbFacade.getInstance().getInterfaceDao()
Line 87:                     
.getIscsiInitiatorsByVdsIdAndStorageTargetId(vdsId, conn.getid());
Line 88: 
Line 89:             if (initiators != null && !initiators.isEmpty()) {
1) IINM initiators should not be null
Line 90:                 conn.setInitiatorName(initiators.remove(0).getName());
Line 91: 
Line 92:                 // Iscsi target is represented by connection object, 
therefore if this target is approachable
Line 93:                 // from more than one endpoint(initiator) we have to 
clone this connection per endpoint.


Line 94:                 for (VdsNetworkInterface initiator : initiators) {
Line 95:                     StorageServerConnections newConn = 
StorageServerConnections.copyOf(conn);
Line 96:                     newConn.setid(Guid.newGuid().toString());
Line 97:                     newConn.setInitiatorName(initiator.getName());
Line 98:                     res.add(newConn);
The logic seems fine, but I don't really understand why it looks that 
complicated with the remove of element 0.
I would just use a new list and initialized it with the elements
Line 99:                 }
Line 100:             }
Line 101:         }
Line 102: 


http://gerrit.ovirt.org/#/c/23198/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java:

Line 176:     @Min(value = 0, message = 
"VALIDATION_STORAGE_CONNECTION_NFS_RETRANS")
Line 177:     @Max(value = Short.MAX_VALUE, message = 
"VALIDATION_STORAGE_CONNECTION_NFS_RETRANS")
Line 178:     private Short nfsRetrans;
Line 179: 
Line 180:     private String initiatorName;
What about validation? name size, characters...
Line 181: 
Line 182:     public String getInitiatorName() {
Line 183:         return initiatorName;
Line 184:     }


http://gerrit.ovirt.org/#/c/23198/2/packaging/dbscripts/network_sp.sql
File packaging/dbscripts/network_sp.sql:

Line 1251:    FROM vds_interface_view,
Line 1252:         network_cluster,
Line 1253:         network,
Line 1254:         iscsi_bonds_networks_map,
Line 1255:         iscsi_bonds_storage_connections_map
I would recommend a new view for this.
We might reuse it in the future
Line 1256:    WHERE
Line 1257:        iscsi_bonds_storage_connections_map.connection_id = 
v_target_id AND
Line 1258:        iscsi_bonds_storage_connections_map.iscsi_bond_id = 
iscsi_bonds_networks_map.iscsi_bond_id AND
Line 1259:        iscsi_bonds_networks_map.network_id = network.id AND


-- 
To view, visit http://gerrit.ovirt.org/23198
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I779f6dd95dfbfc2b74ad7ba3ce2271b7c9ad94db
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to