Skip to content

Commit 1e256cc

Browse files
author
Harikrishna Patnala
committed
CLOUDSTACK-8897: baremetal:addHost:make host tag info mandtory in baremetal addhost Api call
addhost api is successful with out providing the host tag info and we recommend host tag is mandatory for bare-metal. In the current implementation host tag check is happening at vm deployment stage but it will be good to have host tag field as mandatory field during adding of the host it self.
1 parent 61ce75e commit 1e256cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/src/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,12 @@ private List<HostVO> discoverHostsFull(final Long dcId, final Long podId, Long c
679679
}
680680
}
681681

682+
if ((hypervisorType.equalsIgnoreCase(HypervisorType.BareMetal.toString()))) {
683+
if (hostTags.isEmpty()) {
684+
throw new InvalidParameterValueException("hosttag is mandatory while adding host of type Baremetal");
685+
}
686+
}
687+
682688
if (clusterName != null) {
683689
final HostPodVO pod = _podDao.findById(podId);
684690
if (pod == null) {

0 commit comments

Comments
 (0)