Skip to content

Commit a6a4949

Browse files
author
Sheng Yang
committed
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.
1 parent a185132 commit a6a4949

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ public boolean stop() {
9292
public Map<? extends ServerResource, Map<String, String>> find(long dcId, Long podId, Long clusterId, URI url, String username, String password, List<String> hostTags)
9393
throws DiscoveryException {
9494

95+
/* Enable this after we decide to use addBaremetalHostCmd instead of addHostCmd
9596
String discoverName = _params.get(ApiConstants.BAREMETAL_DISCOVER_NAME);
9697
if (!this.getClass().getName().equals(discoverName)) {
9798
return null;
98-
}
99+
} */
99100

100101
Map<BareMetalResourceBase, Map<String, String>> resources = new HashMap<BareMetalResourceBase, Map<String, String>>();
101102
Map<String, String> details = new HashMap<String, String>();

‎plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ public TemplateProfile prepare(RegisterTemplateCmd cmd) throws ResourceAllocatio
8585
}
8686
}
8787

88-
// Check that the resource limit for secondary storage won't be exceeded
89-
_resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(cmd.getEntityOwnerId()),
90-
ResourceType.secondary_storage, UriUtils.getRemoteSize(profile.getUrl()));
91-
9288
return profile;
9389
}
9490

@@ -125,8 +121,6 @@ public VMTemplateVO create(TemplateProfile profile) {
125121
}
126122

127123
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template);
128-
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.secondary_storage,
129-
UriUtils.getRemoteSize(profile.getUrl()));
130124
return template;
131125
}
132126

‎plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfi
168168

169169
@Override
170170
public boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
171-
return false; //To change body of implemented methods use File | Settings | File Templates.
171+
//TODO Add support for baremetal
172+
return true;
172173
}
173174

174175
@Override
175176
public boolean removeDhcpSupportForSubnet(Network network) {
176-
return false; //To change body of implemented methods use File | Settings | File Templates.
177+
//TODO Add support for baremetal
178+
return true;
177179
}
178180

179181
}

0 commit comments

Comments
 (0)