@@ -254,7 +254,7 @@ public List<? extends Cluster> discoverCluster(AddClusterCmd cmd) throws Illegal
254254
255255 List <HostVO > hosts = new ArrayList <HostVO >();
256256 Map <? extends ServerResource , Map <String , String >> resources = null ;
257- resources = discoverer .find (dcId , podId , clusterId , uri , username , password );
257+ resources = discoverer .find (dcId , podId , clusterId , uri , username , password , null );
258258
259259 if (resources != null ) {
260260 for (Map .Entry <? extends ServerResource , Map <String , String >> entry : resources .entrySet ()) {
@@ -306,12 +306,7 @@ public List<? extends Host> discoverHosts(AddHostCmd cmd) throws IllegalArgument
306306 String url = cmd .getUrl ();
307307 String username = cmd .getUsername ();
308308 String password = cmd .getPassword ();
309- Long memCapacity = cmd .getMemCapacity ();
310- Long cpuSpeed = cmd .getCpuSpeed ();
311- Long cpuNum = cmd .getCpuNum ();
312- String mac = cmd .getMac ();
313309 List <String > hostTags = cmd .getHostTags ();
314- Map <String , String > bareMetalParams = new HashMap <String , String >();
315310
316311 dcId = _accountMgr .checkAccessAndSpecifyAuthority (UserContext .current ().getCaller (), dcId );
317312
@@ -334,28 +329,6 @@ public List<? extends Host> discoverHosts(AddHostCmd cmd) throws IllegalArgument
334329 }
335330 }
336331
337- if (cmd .getHypervisor ().equalsIgnoreCase (Hypervisor .HypervisorType .BareMetal .toString ())) {
338- if (memCapacity == null ) {
339- memCapacity = Long .valueOf (0 );
340- }
341- if (cpuSpeed == null ) {
342- cpuSpeed = Long .valueOf (0 );
343- }
344- if (cpuNum == null ) {
345- cpuNum = Long .valueOf (0 );
346- }
347- if (mac == null ) {
348- mac = "unknown" ;
349- }
350-
351- bareMetalParams .put ("cpuNum" , cpuNum .toString ());
352- bareMetalParams .put ("cpuCapacity" , cpuSpeed .toString ());
353- bareMetalParams .put ("memCapacity" , memCapacity .toString ());
354- bareMetalParams .put ("mac" , mac );
355- if (hostTags != null && hostTags .size () > 0 ) {
356- bareMetalParams .put ("hostTag" , hostTags .get (0 ));
357- }
358- }
359332 String allocationState = cmd .getAllocationState ();
360333 if (allocationState == null ) {
361334 allocationState = Host .HostAllocationState .Enabled .toString ();
@@ -480,7 +453,7 @@ private List<HostVO> discoverHostsFull(Long dcId, Long podId, Long clusterId, St
480453 Map <? extends ServerResource , Map <String , String >> resources = null ;
481454
482455 try {
483- resources = discoverer .find (dcId , podId , clusterId , uri , username , password );
456+ resources = discoverer .find (dcId , podId , clusterId , uri , username , password , hostTags );
484457 } catch (DiscoveryException e ) {
485458 throw e ;
486459 } catch (Exception e ) {
0 commit comments