Bug 8208 - bare metal provisioning

use hostTags in addHostCmd
This commit is contained in:
Frank 2011-03-18 18:04:34 -07:00
parent 96e83fe97f
commit b4e18b7fbe
2 changed files with 5 additions and 16 deletions

View File

@ -77,12 +77,7 @@ public class AddHostCmd extends BaseCmd {
private Long memCapacity;
@Parameter(name=ApiConstants.HOST_MAC, type=CommandType.STRING, description="Only for hypervisor is BareMetal, Mac of PXE nic")
private String mac;
@Parameter(name=ApiConstants.HOST_TAG, type=CommandType.STRING, description="Only for hypervisor is BareMetal, Tag of host")
private String hostTag;
private String mac;
@Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="list of tags to be added to the host")
private List<String> hostTags;
@ -141,11 +136,7 @@ public class AddHostCmd extends BaseCmd {
public String getMac() {
return mac;
}
public String getHostTag() {
return hostTag;
}
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////

View File

@ -756,7 +756,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
Long cpuSpeed = cmd.getCpuSpeed();
Long cpuNum = cmd.getCpuNum();
String mac = cmd.getMac();
String hostTag = cmd.getHostTag();
List<String> hostTags = cmd.getHostTags();
Map<String, String>bareMetalParams = new HashMap<String, String>();
// this is for standalone option
@ -782,13 +782,11 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
bareMetalParams.put("cpuCapacity", cpuSpeed.toString());
bareMetalParams.put("memCapacity", memCapacity.toString());
bareMetalParams.put("mac", mac);
if (hostTag != null) {
bareMetalParams.put("hostTag", hostTag);
if (hostTags != null) {
bareMetalParams.put("hostTag", hostTags.get(0));
}
}
List<String> hostTags = cmd.getHostTags();
return discoverHostsFull(dcId, podId, clusterId, clusterName, url,
username, password, cmd.getHypervisor(), hostTags, bareMetalParams);
}