Skip to content

Commit aa3d020

Browse files
Harikrishna PatnalaHarikrishna Patnala
authored andcommitted
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 aa3d020

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,13 @@ 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 == null || hostTags.size() == 0) {
684+
throw new InvalidParameterValueException("hosttag is mandatory while adding host of type Baremetal");
685+
}
686+
687+
}
688+
682689
if (clusterName != null) {
683690
final HostPodVO pod = _podDao.findById(podId);
684691
if (pod == null) {

0 commit comments

Comments
 (0)