Skip to content

Commit b4e18b7

Browse files
committed
Bug 8208 - bare metal provisioning
use hostTags in addHostCmd
1 parent 96e83fe commit b4e18b7

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

‎api/src/com/cloud/api/commands/AddHostCmd.java‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ public class AddHostCmd extends BaseCmd {
7777
private Long memCapacity;
7878

7979
@Parameter(name=ApiConstants.HOST_MAC, type=CommandType.STRING, description="Only for hypervisor is BareMetal, Mac of PXE nic")
80-
private String mac;
81-
82-
@Parameter(name=ApiConstants.HOST_TAG, type=CommandType.STRING, description="Only for hypervisor is BareMetal, Tag of host")
83-
private String hostTag;
84-
85-
80+
private String mac;
8681

8782
@Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="list of tags to be added to the host")
8883
private List<String> hostTags;
@@ -141,11 +136,7 @@ public Long getMemCapacity() {
141136

142137
public String getMac() {
143138
return mac;
144-
}
145-
146-
public String getHostTag() {
147-
return hostTag;
148-
}
139+
}
149140

150141
/////////////////////////////////////////////////////
151142
/////////////// API Implementation///////////////////

‎server/src/com/cloud/agent/manager/AgentManagerImpl.java‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ public List<? extends Host> discoverHosts(AddHostCmd cmd)
756756
Long cpuSpeed = cmd.getCpuSpeed();
757757
Long cpuNum = cmd.getCpuNum();
758758
String mac = cmd.getMac();
759-
String hostTag = cmd.getHostTag();
759+
List<String> hostTags = cmd.getHostTags();
760760
Map<String, String>bareMetalParams = new HashMap<String, String>();
761761

762762
// this is for standalone option
@@ -782,13 +782,11 @@ public List<? extends Host> discoverHosts(AddHostCmd cmd)
782782
bareMetalParams.put("cpuCapacity", cpuSpeed.toString());
783783
bareMetalParams.put("memCapacity", memCapacity.toString());
784784
bareMetalParams.put("mac", mac);
785-
if (hostTag != null) {
786-
bareMetalParams.put("hostTag", hostTag);
785+
if (hostTags != null) {
786+
bareMetalParams.put("hostTag", hostTags.get(0));
787787
}
788788
}
789789

790-
List<String> hostTags = cmd.getHostTags();
791-
792790
return discoverHostsFull(dcId, podId, clusterId, clusterName, url,
793791
username, password, cmd.getHypervisor(), hostTags, bareMetalParams);
794792
}

0 commit comments

Comments
 (0)