Source:
protected void executeCommand() { if (isCinderStorageDomain()) { activateCinderStorageDomain(); return; } final StoragePoolIsoMap map = DbFacade.getInstance() .getStoragePoolIsoMapDao() .get(new StoragePoolIsoMapId(getParameters().getStorageDomainId(), getParameters().getStoragePoolId())); changeStorageDomainStatusInTransaction(map, (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) ? StorageDomainStatus.Locked : StorageDomainStatus.Activating); freeLock(); log.info("ActivateStorage Domain. Before Connect all hosts to pool. Time: {}", new Date()); List<Pair<Guid, Boolean>> hostsConnectionResults = connectHostsInUpToDomainStorageServer(); if (!validateHostsConnectionResults(hostsConnectionResults)) { log.info("Cannot connect storage server, aborting Storage Domain activation. Time: {}", new Date()); setSucceeded(false); return; } syncStorageDomainInfo(hostsConnectionResults); runVdsCommand(VDSCommandType.ActivateStorageDomain, new ActivateStorageDomainVDSCommandParameters(getStoragePool().getId(), getStorageDomain().getId())); log.info("ActivateStorage Domain. After Connect all hosts to pool. Time: {}", new Date()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { map.setStatus(StorageDomainStatus.Active); DbFacade.getInstance().getStoragePoolIsoMapDao().updateStatus(map.getId(), map.getStatus()); if (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { calcStoragePoolStatusByDomainsStatus(); } return null; } }); refreshAllVdssInPool(); log.info("ActivateStorage Domain. After change storage pool status in vds. Time: {}", new Date()); if (getStorageDomain().getStorageDomainType() == StorageDomainType.ISO) { IsoDomainListSyncronizer.getInstance().refresheIsoDomainWhenActivateDomain(getStorageDomain().getId(), getStoragePool().getId()); } setSucceeded(true); }

Target:
protected void executeCommand() { if (isCinderStorageDomain()) { activateCinderStorageDomain(); return; } final StoragePoolIsoMap map = DbFacade.getInstance() .getStoragePoolIsoMapDao() .get(new StoragePoolIsoMapId(getParameters().getStorageDomainId(), getParameters().getStoragePoolId())); changeStorageDomainStatusInTransaction(map, (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) ? StorageDomainStatus.Locked : StorageDomainStatus.Activating); freeLock(); log.info("ActivateStorage Domain. Before Connect all hosts to pool. Time: {}", new Date()); List<Pair<Guid, Boolean>> hostsConnectionResults = connectHostsInUpToDomainStorageServer(); if (!validateHostsConnectionResults(hostsConnectionResults)) { log.info("Cannot connect storage server, aborting Storage Domain activation."); setSucceeded(false); return; } syncStorageDomainInfo(hostsConnectionResults); runVdsCommand(VDSCommandType.ActivateStorageDomain, new ActivateStorageDomainVDSCommandParameters(getStoragePool().getId(), getStorageDomain().getId())); log.info("ActivateStorage Domain. After Connect all hosts to pool. Time: {}", new Date()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { map.setStatus(StorageDomainStatus.Active); DbFacade.getInstance().getStoragePoolIsoMapDao().updateStatus(map.getId(), map.getStatus()); if (getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { calcStoragePoolStatusByDomainsStatus(); } return null; } }); refreshAllVdssInPool(); log.info("ActivateStorage Domain. After change storage pool status in vds. Time: {}", new Date()); if (getStorageDomain().getStorageDomainType() == StorageDomainType.ISO) { IsoDomainListSyncronizer.getInstance().refresheIsoDomainWhenActivateDomain(getStorageDomain().getId(), getStoragePool().getId()); } setSucceeded(true); }