mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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:
parent
8aa0ab99da
commit
cdaa1edfa5
15
scripts/util/prepare_linmin.sh
Normal file
15
scripts/util/prepare_linmin.sh
Normal 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
|
||||
@ -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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user