ServerResource resource = null;
try {
if (cmd.getDhcpType().equalsIgnoreCase(BaremetalDhcpType.DNSMASQ.toString())) {
resource = new BaremetalDnsmasqResource();
resource.configure("Dnsmasq resource", params);
} else if (cmd.getDhcpType().equalsIgnoreCase(BaremetalDhcpType.DHCPD.toString())) {
resource = new BaremetalDhcpdResource();
resource.configure("Dhcpd resource", params);
} else {
throw new CloudRuntimeException("Unsupport DHCP server type: " + cmd.getDhcpType());