Fix baremetal functionality

1. Baremetal doesn't have secondary storage, so we don't need check them.

2. The new "AddBaremetalHostCmd" hasn't been used by UI, so keep the validity
checking out for now. "AddHostCmd" would still works.

3. Baremetal haven't implemented multiple ip range feature(CLOUDSTACK-702),
return true for now for single range.
This commit is contained in:
Sheng Yang 2013-06-18 14:04:05 -07:00
parent a18513286a
commit a6a49490fb
3 changed files with 6 additions and 9 deletions

View File

@ -92,10 +92,11 @@ public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, R
public Map<? extends ServerResource, Map<String, String>> find(long dcId, Long podId, Long clusterId, URI url, String username, String password, List<String> hostTags)
throws DiscoveryException {
/* Enable this after we decide to use addBaremetalHostCmd instead of addHostCmd
String discoverName = _params.get(ApiConstants.BAREMETAL_DISCOVER_NAME);
if (!this.getClass().getName().equals(discoverName)) {
return null;
}
} */
Map<BareMetalResourceBase, Map<String, String>> resources = new HashMap<BareMetalResourceBase, Map<String, String>>();
Map<String, String> details = new HashMap<String, String>();

View File

@ -85,10 +85,6 @@ public class BareMetalTemplateAdapter extends TemplateAdapterBase implements Tem
}
}
// Check that the resource limit for secondary storage won't be exceeded
_resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(cmd.getEntityOwnerId()),
ResourceType.secondary_storage, UriUtils.getRemoteSize(profile.getUrl()));
return profile;
}
@ -125,8 +121,6 @@ public class BareMetalTemplateAdapter extends TemplateAdapterBase implements Tem
}
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template);
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.secondary_storage,
UriUtils.getRemoteSize(profile.getUrl()));
return template;
}

View File

@ -168,12 +168,14 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv
@Override
public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
return false; //To change body of implemented methods use File | Settings | File Templates.
//TODO Add support for baremetal
return true;
}
@Override
public boolean removeDhcpSupportForSubnet(Network network) {
return false; //To change body of implemented methods use File | Settings | File Templates.
//TODO Add support for baremetal
return true;
}
}