Description of problem: Activating a FC LUN while the guest is running results in an IndexOutOfBoundsException exception being thrown as FC Luns have no rows within the storage_server_connections table. BZ#854141 shows another example failure when starting guests, this was resolved by http://gerrit.ovirt.org/#/c/7764/. Really we need the same checks in the following method. ovirt-engine/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractDiskVmCommand.java ~~~ 49 protected void performPlugCommnad(VDSCommandType commandType, 50 Disk disk, VmDevice vmDevice) { 51 if (disk.getDiskStorageType() == DiskStorageType.LUN) { 52 LunDisk lunDisk = (LunDisk) disk; 53 if (commandType == VDSCommandType.HotPlugDisk) { 54 LUNs lun = lunDisk.getLun(); 55 lun.setLunConnections(new ArrayList<storage_server_connections>(getDbFacade() 56 .getStorageServerConnectionDAO() 57 .getAllForLun(lun.getLUN_id()))); 58 if (!StorageHelperDirector.getInstance() 59 .getItem(lun.getLunConnections().get(0).getstorage_type()) 60 .ConnectStorageToLunByVdsId(null, 61 getVm().getrun_on_vds().getValue(), 62 lun, 63 getVm().getstorage_pool_id())) { 64 throw new VdcBLLException(VdcBllErrors.StorageServerConnectionError); 65 } 66 } 67 } 68 runVdsCommand(commandType, new HotPlugDiskVDSParameters(getVm().getrun_on_vds().getValue(), 69 getVm().getId(), disk, vmDevice)); 70 } ~~~ ~~~ 12171 2013-02-11 14:25:18,116 ERROR [org.ovirt.engine.core.bll.HotPlugDiskToVmCommand] (pool-3-thread-50) [5ee28eb1] Command org.ovirt.engine.core.bll.HotPlugDiskToVmCommand throw exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 12172 at java.util.ArrayList.rangeCheck(ArrayList.java:604) [rt.jar:1.7.0_09-icedtea] 12173 at java.util.ArrayList.get(ArrayList.java:382) [rt.jar:1.7.0_09-icedtea] 12174 at org.ovirt.engine.core.bll.AbstractDiskVmCommand.performPlugCommnad(AbstractDiskVmCommand.java:58) [engine-bll.jar:] 12175 at org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.ExecuteVmCommand(HotPlugDiskToVmCommand.java:77) [engine-bll.jar:] 12176 at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:78) [engine-bll.jar:] 12177 at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:876) [engine-bll.jar:] 12178 at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:973) [engine-bll.jar:] 12179 at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1372) [engine-bll.jar:] 12180 at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:168) [engine-utils.jar:] 12181 at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:107) [engine-utils.jar:] 12182 at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:991) [engine-bll.jar:] 12183 at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291) [engine-bll.jar:] 12184 at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommands(MultipleActionsRunner.java:182) [engine-bll.jar:] 12185 at org.ovirt.engine.core.bll.MultipleActionsRunner.RunCommands(MultipleActionsRunner.java:162) [engine-bll.jar:] 12186 at org.ovirt.engine.core.bll.MultipleActionsRunner$1.run(MultipleActionsRunner.java:84) [engine-bll.jar:] 12187 at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64) [engine-utils.jar:] 12188 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea] 12189 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea] 12190 at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea] 12191 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea] 12192 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea] 12193 at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea] [..] 12223 2013-02-11 14:25:30,403 ERROR [org.ovirt.engine.core.bll.HotPlugDiskToVmCommand] (pool-3-thread-50) [2ddff44c] Command org.ovirt.engine.core.bll.HotPlugDiskToVmCommand throw exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 12224 at java.util.ArrayList.rangeCheck(ArrayList.java:604) [rt.jar:1.7.0_09-icedtea] 12225 at java.util.ArrayList.get(ArrayList.java:382) [rt.jar:1.7.0_09-icedtea] 12226 at org.ovirt.engine.core.bll.AbstractDiskVmCommand.performPlugCommnad(AbstractDiskVmCommand.java:58) [engine-bll.jar:] 12227 at org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.ExecuteVmCommand(HotPlugDiskToVmCommand.java:77) [engine-bll.jar:] 12228 at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:78) [engine-bll.jar:] 12229 at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:876) [engine-bll.jar:] 12230 at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:973) [engine-bll.jar:] 12231 at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1372) [engine-bll.jar:] 12232 at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:168) [engine-utils.jar:] 12233 at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:107) [engine-utils.jar:] 12234 at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:991) [engine-bll.jar:] 12235 at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291) [engine-bll.jar:] 12236 at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommands(MultipleActionsRunner.java:182) [engine-bll.jar:] 12237 at org.ovirt.engine.core.bll.MultipleActionsRunner.RunCommands(MultipleActionsRunner.java:162) [engine-bll.jar:] 12238 at org.ovirt.engine.core.bll.MultipleActionsRunner$1.run(MultipleActionsRunner.java:84) [engine-bll.jar:] 12239 at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64) [engine-utils.jar:] 12240 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea] 12241 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea] 12242 at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea] 12243 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea] 12244 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea] 12245 at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea] ~~~ Version-Release number of selected component (if applicable): rhevm-3.1.0-40 How reproducible: I don't have FC LUNs to hand to confirm this but... Activate FC Luns attached to a running guest. Steps to Reproduce: 1. Attach a FC LUN to a given guest. 2. Activate the FC LUN. 3. Operation fails. Actual results: LUN fails to activate. Expected results: LUN activates. Additional info: The example logs will also show BZ#876109, an audit logging exception.