Bug 8208 - bare metal provisioning

Set dhcp range of linmin DHCPD to empty, so it will not conflict with
our External DHCP
This commit is contained in:
Frank 2011-03-24 16:50:23 -07:00
parent 8aa0ab99da
commit cdaa1edfa5
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
#!/bin/sh
DHCP_CONF="/etc/dhcpd.conf"
err_exit() {
echo "$*"
exit 1
}
[ ! -f $DHCP_CONF ] && err_exit "Cannot find $DHCP_CONF"
cat $DHCP_CONF | tr '\n' '~' > /tmp/dhcpd.tmp && sed -i 's/\(subnet.*netmask.*{\).*\(~}\)/\1\2/g' /tmp/dhcpd.tmp && cat /tmp/dhcpd.tmp | tr '~' '\n' > $DHCP_CONF && rm /tmp/dhcpd.tmp -f
[ $? -ne 0 ] && err_exit "Configure dhcpd.conf failed"
service dhcpd restart
[ $? -ne 0 ] && err_exit "restart dhcpd failed"
exit 0

View File

@ -92,7 +92,7 @@ public class BareMetalPlanner implements DeploymentPlanner {
for (HostVO h : hosts) {
if (h.getStatus() == Status.Up) {
if(_capacityMgr.checkIfHostHasCapacity(h.getId(), cpu_requested, ram_requested, true)){
if(_capacityMgr.checkIfHostHasCapacity(h.getId(), cpu_requested, ram_requested, false)){
s_logger.debug("Find host " + h.getId() + " has enough capacity");
DataCenter dc = _dcDao.findById(h.getDataCenterId());
Pod pod = _podDao.findById(h.getPodId());