3030import javax .inject .Inject ;
3131import javax .naming .ConfigurationException ;
3232
33- import org .apache .log4j .Logger ;
34-
3533import org .apache .cloudstack .affinity .AffinityGroupProcessor ;
3634import org .apache .cloudstack .affinity .AffinityGroupService ;
3735import org .apache .cloudstack .affinity .AffinityGroupVMMapVO ;
5048import org .apache .cloudstack .storage .datastore .db .PrimaryDataStoreDao ;
5149import org .apache .cloudstack .storage .datastore .db .StoragePoolVO ;
5250import org .apache .cloudstack .utils .identity .ManagementServerNode ;
51+ import org .apache .log4j .Logger ;
5352
54- import com .cloud .agent .AgentManager ;
55- import com .cloud .agent .Listener ;
56- import com .cloud .agent .api .AgentControlAnswer ;
57- import com .cloud .agent .api .AgentControlCommand ;
58- import com .cloud .agent .api .Answer ;
59- import com .cloud .agent .api .Command ;
60- import com .cloud .agent .api .StartupCommand ;
61- import com .cloud .agent .api .StartupRoutingCommand ;
62- import com .cloud .agent .manager .allocator .HostAllocator ;
6353import com .cloud .capacity .CapacityManager ;
6454import com .cloud .capacity .dao .CapacityDao ;
6555import com .cloud .configuration .Config ;
8070import com .cloud .exception .AffinityConflictException ;
8171import com .cloud .exception .ConnectionException ;
8272import com .cloud .exception .InsufficientServerCapacityException ;
73+ import com .cloud .exception .PermissionDeniedException ;
8374import com .cloud .host .Host ;
8475import com .cloud .host .HostVO ;
8576import com .cloud .host .Status ;
111102import com .cloud .utils .db .SearchCriteria ;
112103import com .cloud .utils .db .Transaction ;
113104import com .cloud .utils .db .TransactionCallback ;
105+ import com .cloud .utils .db .TransactionCallbackNoReturn ;
114106import com .cloud .utils .db .TransactionStatus ;
115107import com .cloud .utils .exception .CloudRuntimeException ;
116108import com .cloud .utils .fsm .StateListener ;
119111import com .cloud .vm .VMInstanceVO ;
120112import com .cloud .vm .VirtualMachine ;
121113import com .cloud .vm .VirtualMachine .Event ;
122- import com .cloud .vm .VirtualMachine .State ;
123114import com .cloud .vm .VirtualMachineProfile ;
115+ import com .cloud .vm .VirtualMachine .State ;
124116import com .cloud .vm .dao .UserVmDao ;
125117import com .cloud .vm .dao .VMInstanceDao ;
118+ import com .cloud .agent .AgentManager ;
119+ import com .cloud .agent .Listener ;
120+ import com .cloud .agent .api .AgentControlAnswer ;
121+ import com .cloud .agent .api .AgentControlCommand ;
122+ import com .cloud .agent .api .Answer ;
123+ import com .cloud .agent .api .Command ;
124+ import com .cloud .agent .api .StartupCommand ;
125+ import com .cloud .agent .api .StartupRoutingCommand ;
126+ import com .cloud .agent .manager .allocator .HostAllocator ;
126127
127128
128129@ Local (value = { DeploymentPlanningManager .class })
@@ -206,7 +207,7 @@ public List<AffinityGroupProcessor> getAffinityGroupProcessors() {
206207 return _affinityProcessors ;
207208 }
208209 public void setAffinityGroupProcessors (List <AffinityGroupProcessor > affinityProcessors ) {
209- _affinityProcessors = affinityProcessors ;
210+ this . _affinityProcessors = affinityProcessors ;
210211 }
211212
212213 @ Override
@@ -950,7 +951,7 @@ private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeLi
950951 }
951952
952953 // Cluster can be put in avoid set in following scenarios:
953- // 1. If storage allocators haven't put any pools in avoid set means either no pools in cluster
954+ // 1. If storage allocators haven't put any pools in avoid set means either no pools in cluster
954955 // or pools not suitable for the allocators to handle or there is no
955956 // linkage of any suitable host to any of the pools in cluster
956957 // 2. If all 'shared' or 'local' pools are in avoid set
@@ -1151,9 +1152,9 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
11511152 List <StoragePool > suitablePools = new ArrayList <StoragePool >();
11521153 StoragePool pool = null ;
11531154 if (toBeCreated .getPoolId () != null ) {
1154- pool = (StoragePool ) dataStoreMgr .getPrimaryDataStore (toBeCreated .getPoolId ());
1155+ pool = (StoragePool ) this . dataStoreMgr .getPrimaryDataStore (toBeCreated .getPoolId ());
11551156 } else {
1156- pool = (StoragePool ) dataStoreMgr .getPrimaryDataStore (plan .getPoolId ());
1157+ pool = (StoragePool ) this . dataStoreMgr .getPrimaryDataStore (plan .getPoolId ());
11571158 }
11581159
11591160 if (!pool .isInMaintenance ()) {
@@ -1166,7 +1167,7 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
11661167 && plan .getClusterId () == exstPoolClusterId ) {
11671168 canReusePool = true ;
11681169 } else if (plan .getDataCenterId () == exstPoolDcId ) {
1169- DataStore dataStore = dataStoreMgr .getPrimaryDataStore (pool .getId ());
1170+ DataStore dataStore = this . dataStoreMgr .getPrimaryDataStore (pool .getId ());
11701171 if (dataStore != null && dataStore .getScope () != null
11711172 && dataStore .getScope ().getScopeType () == ScopeType .ZONE ) {
11721173 canReusePool = true ;
@@ -1267,7 +1268,7 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
12671268 }
12681269 }
12691270 if (suitableVolumeStoragePools .values () != null ) {
1270- poolsToAvoidOutput .removeAll (suitableVolumeStoragePools .keySet ());
1271+ poolsToAvoidOutput .removeAll (suitableVolumeStoragePools .values ());
12711272 }
12721273 if (avoid .getPoolsToAvoid () != null ) {
12731274 avoid .getPoolsToAvoid ().addAll (poolsToAvoidOutput );
0 commit comments