Skip to content

Commit d58044c

Browse files
author
frank
committed
Add Baremetal agent package back to RPM spec file
1 parent cb71b5c commit d58044c

4 files changed

Lines changed: 23 additions & 228 deletions

File tree

‎packaging/centos63/cloud.spec‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ Group: System Environment/Libraries
162162
%description awsapi
163163
Apache Cloudstack AWS API compatibility wrapper
164164

165+
166+
%package baremetal-agent
167+
Summary: CloudStack baremetal agent
168+
Requires: tftp-server
169+
Requires: xinetd
170+
Requires: syslinux
171+
Requires: chkconfig
172+
Requires: dhcp
173+
Requires: httpd
174+
Group: System Environment/Libraries
175+
%description baremetal-agent
176+
The CloudStack baremetal agent
177+
165178
%prep
166179
echo Doing CloudStack build
167180

@@ -236,6 +249,7 @@ install -D client/target/utilities/bin/cloud-set-guest-sshkey ${RPM_BUILD_ROOT}%
236249
install -D client/target/utilities/bin/cloud-setup-databases ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-databases
237250
install -D client/target/utilities/bin/cloud-setup-encryption ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-encryption
238251
install -D client/target/utilities/bin/cloud-setup-management ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-management
252+
install -D client/target/utilities/bin/cloud-setup-baremetal ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-baremetal
239253
install -D client/target/utilities/bin/cloud-sysvmadm ${RPM_BUILD_ROOT}%{_bindir}/%{name}-sysvmadm
240254
install -D client/target/utilities/bin/cloud-update-xenserver-licenses ${RPM_BUILD_ROOT}%{_bindir}/%{name}-update-xenserver-licenses
241255

@@ -603,6 +617,8 @@ fi
603617
%{_defaultdocdir}/%{name}-awsapi-%{version}/LICENSE
604618
%{_defaultdocdir}/%{name}-awsapi-%{version}/NOTICE
605619

620+
%files baremetal-agent
621+
%attr(0755,root,root) %{_bindir}/cloudstack-setup-baremetal
606622

607623
%changelog
608624
* Fri Oct 03 2012 Hugo Trippaers <hugo@apache.org> 4.1.0

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv
6565
static {
6666
Capability cap = new Capability(BaremetalDhcpManager.BAREMETAL_DHCP_SERVICE_CAPABITLITY);
6767
Map<Capability, String> baremetalCaps = new HashMap<Capability, String>();
68-
baremetalCaps.put(cap, null);
69-
baremetalCaps.put(Capability.DhcpAccrossMultipleSubnets, Boolean.TRUE.toString());
68+
baremetalCaps.put(cap, null);
69+
baremetalCaps.put(Capability.DhcpAccrossMultipleSubnets, Boolean.TRUE.toString());
7070
capabilities = new HashMap<Service, Map<Capability, String>>();
7171
capabilities.put(Service.Dhcp, baremetalCaps);
7272
}
@@ -82,11 +82,8 @@ public Provider getProvider() {
8282
}
8383

8484
private boolean canHandle(DeployDestination dest, TrafficType trafficType, GuestType networkType) {
85-
Pod pod = dest.getPod();
86-
if (pod != null && dest.getDataCenter().getNetworkType() == NetworkType.Basic && trafficType == TrafficType.Guest) {
87-
SearchCriteriaService<BaremetalDhcpVO, BaremetalDhcpVO> sc = SearchCriteria2.create(BaremetalDhcpVO.class);
88-
sc.addAnd(sc.getEntity().getPodId(), Op.EQ, pod.getId());
89-
return sc.find() != null;
85+
if (dest.getDataCenter().getNetworkType() == NetworkType.Basic && trafficType == TrafficType.Guest) {
86+
return true;
9087
}
9188

9289
return false;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ protected String getDhcpServerGuid(String zoneId, String name, String ip) {
136136
public boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> profile,
137137
DeployDestination dest, ReservationContext context) throws ResourceUnavailableException {
138138
Long zoneId = profile.getVirtualMachine().getDataCenterId();
139-
Long podId = profile.getVirtualMachine().getPodIdToDeployIn();
140-
List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHosts(Type.BaremetalDhcp, null, podId, zoneId);
139+
List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHosts(Type.BaremetalDhcp, null, null, zoneId);
141140
if (hosts.size() == 0) {
142-
throw new CloudRuntimeException("No external Dhcp found in zone " + zoneId + " pod " + podId);
141+
throw new CloudRuntimeException("No external Dhcp found in zone " + zoneId);
143142
}
144143

145144
if (hosts.size() > 1) {
146-
throw new CloudRuntimeException("Something wrong, more than 1 external Dhcp found in zone " + zoneId + " pod " + podId);
145+
throw new CloudRuntimeException("Something wrong, more than 1 external Dhcp found in zone " + zoneId);
147146
}
148147

149148
HostVO h = hosts.get(0);

‎python/bindir/cloud-setup-baremetal‎

Lines changed: 0 additions & 217 deletions
This file was deleted.

0 commit comments

Comments
 (0)