Skip to content

Commit 61fd6a7

Browse files
author
Chiradeep Vittal
committed
ensure elb vm is managed by elb manager
1 parent e936a52 commit 61fd6a7

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

‎core/src/com/cloud/vm/DomainRouterVO.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ public DomainRouterVO(long id,
6868
super(id, serviceOfferingId, name, name, Type.DomainRouter, templateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
6969
this.networkId = networkId;
7070
}
71+
72+
public DomainRouterVO(long id,
73+
long serviceOfferingId,
74+
String name,
75+
long templateId,
76+
HypervisorType hypervisorType,
77+
long guestOSId,
78+
long domainId,
79+
long accountId,
80+
long networkId,
81+
boolean haEnabled,
82+
VirtualMachine.Type vmType) {
83+
super(id, serviceOfferingId, name, name, vmType, templateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
84+
this.networkId = networkId;
85+
}
7186

7287
public void setPublicIpAddress(String publicIpAddress) {
7388
this.publicIpAddress = publicIpAddress;

‎patches/systemvm/debian/config/etc/init.d/cloud-early-config‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,12 @@ setup_elbvm() {
432432
[ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH0_IP
433433
echo "$public_ip $NAME" >> /etc/hosts
434434

435-
setup_sshd $ETH0_IP
435+
if [ "$SSHONGUEST" == "true" ]
436+
then
437+
setup_sshd $ETH0_IP
438+
else
439+
setup_sshd $ETH1_IP
440+
fi
436441

437442
enable_fwding 0
438443
enable_svc haproxy 0

‎server/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public DomainRouterVO deployELBVm(Network guestNetwork, DeployDestination dest,
481481

482482

483483
elbVm = new DomainRouterVO(id, _elasticLbVmOffering.getId(), VirtualMachineName.getSystemVmName(id, _instance, _elbVmNamePrefix), template.getId(), template.getHypervisorType(), template.getGuestOSId(),
484-
owner.getDomainId(), owner.getId(), guestNetwork.getId(), _elasticLbVmOffering.getOfferHA());
484+
owner.getDomainId(), owner.getId(), guestNetwork.getId(), _elasticLbVmOffering.getOfferHA(), VirtualMachine.Type.ElasticLoadBalancerVm);
485485
elbVm.setRole(Role.LB);
486486
elbVm = _itMgr.allocate(elbVm, template, _elasticLbVmOffering, networks, plan, null, owner);
487487
//TODO: create usage stats
@@ -745,12 +745,7 @@ public void handleDeleteLoadBalancerRule(LoadBalancer lb, long userId, Account c
745745
releaseIp(lb.getSourceIpAddressId(), userId, caller);
746746
}
747747

748-
@Override
749-
public DomainRouterVO findByName(String name) {
750-
// TODO Auto-generated method stub
751-
return null;
752-
}
753-
748+
754749
@Override
755750
public DomainRouterVO findByName(String name) {
756751
if (!VirtualMachineName.isValidSystemVmName(name, _instance, _elbVmNamePrefix)) {

0 commit comments

Comments
 (0)