Skip to content

Commit 3bd04bf

Browse files
author
Pearl Dsilva
committed
Support for shared networks
1 parent 89877c2 commit 3bd04bf

5 files changed

Lines changed: 9 additions & 25 deletions

File tree

engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41400to41500.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ private void updateSystemVmTemplates(final Connection conn) {
143143
//put(Hypervisor.HypervisorType.KVM, "81b3e48bb934784a13555a43c5ef5ffb");
144144
//put(Hypervisor.HypervisorType.XenServer, "1b178a5dbdbe090555515340144c6017");
145145
//put(Hypervisor.HypervisorType.VMware, "e6a88e518c57d6f36c096c4204c3417f");
146-
put(Hypervisor.HypervisorType.KVM, "d60a5afaf9a86f69ebbae4c2bae6ff45");
147-
put(Hypervisor.HypervisorType.XenServer, "01cd0dd45840e0921e23aa2bf6c9a334");
148-
put(Hypervisor.HypervisorType.VMware, "43999dc771d21e85330d964d6a48d643");
146+
put(Hypervisor.HypervisorType.KVM, "0d95bb3d9385097dec8b485e46eae34b");
147+
put(Hypervisor.HypervisorType.XenServer, "8dd2df4eba815711e68cf204a8df7650");
148+
put(Hypervisor.HypervisorType.VMware, "6d18a4e41589fa32217adb0d0be3d286");
149149
put(Hypervisor.HypervisorType.Hyperv, "5c94da45337cf3e1910dcbe084d4b9ad");
150150
put(Hypervisor.HypervisorType.LXC, "81b3e48bb934784a13555a43c5ef5ffb");
151151
put(Hypervisor.HypervisorType.Ovm3, "875c5c65455fc06c4a012394410db375");

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4406,7 +4406,6 @@ private UserVm startVirtualMachine(long vmId, Long podId, Long clusterId, Long h
44064406

44074407
private void addUserVMCmdlineArgs(Long vmId, VirtualMachineProfile profile, DeployDestination dest, StringBuilder buf) {
44084408
UserVmVO k8sVM = _vmDao.findById(vmId);
4409-
String dhcpRange = null;
44104409
buf.append(" template=domP");
44114410
buf.append(" name=").append(profile.getHostName());
44124411
buf.append(" type=").append(k8sVM.getUserVmType());
@@ -4431,16 +4430,6 @@ private void addUserVMCmdlineArgs(Long vmId, VirtualMachineProfile profile, Depl
44314430
}
44324431
buf.append(" localgw=").append(dest.getPod().getGateway());
44334432
}
4434-
if (nic.isDefaultNic()) {
4435-
final long guestNetworkId = nic.getNetworkId();
4436-
final NetworkVO guestNetwork = _networkDao.findById(guestNetworkId);
4437-
if (guestNetwork != null) {
4438-
final String cidr = _networkModel.getValidNetworkCidr(guestNetwork);
4439-
if (cidr != null) {
4440-
dhcpRange = NetUtils.getDhcpRange(cidr);
4441-
}
4442-
}
4443-
}
44444433
}
44454434
DataCenterVO dc = _dcDao.findById(profile.getVirtualMachine().getDataCenterId());
44464435
buf.append(" internaldns1=").append(dc.getInternalDns1());
@@ -4451,9 +4440,6 @@ private void addUserVMCmdlineArgs(Long vmId, VirtualMachineProfile profile, Depl
44514440
if (dc.getDns2() != null) {
44524441
buf.append(" dns2=").append(dc.getDns2());
44534442
}
4454-
if (dhcpRange != null) {
4455-
buf.append(" dhcprange=" + dhcpRange);
4456-
}
44574443
s_logger.info("cmdline details: "+ buf.toString());
44584444
}
44594445

systemvm/debian/opt/cloud/bin/setup/CKSNode.sh

100644100755
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,8 @@ setup_k8s_node() {
4545
enable_fwding 1
4646
enable_irqbalance 0
4747
setup_ntp
48+
dhclient
4849

49-
mkdir -p /var/lib/dhcp/
50-
DHCPIP=$(cat /var/cache/cloud/cmdline | sed 's/.*dhcprange=\([0-9\.]*\).*/\1/')
51-
cat <<EOF >> /var/lib/dhcp/dhclient.leases
52-
lease {
53-
option dhcp-server-identifier $DHCPIP
54-
}
55-
EOF
5650
rm -f /etc/logrotate.d/cloud
5751

5852
log_it "Starting cloud-init services"

systemvm/debian/opt/cloud/bin/setup/postinit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ then
4242
fi
4343
fi
4444

45+
if [ "$TYPE" == "CKSNode" ]; then
46+
pkill -9 dhclient
47+
fi
48+
4549
[ ! -f /var/cache/cloud/enabled_svcs ] && touch /var/cache/cloud/enabled_svcs
4650
for svc in $(cat /var/cache/cloud/enabled_svcs)
4751
do

tools/appliance/systemvmtemplate/scripts/cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -e
2020

2121
function cleanup_apt() {
2222
export DEBIAN_FRONTEND=noninteractive
23-
apt-get -y remove --purge dictionaries-common busybox isc-dhcp-client isc-dhcp-common \
23+
apt-get -y remove --purge dictionaries-common busybox \
2424
task-english task-ssh-server tasksel tasksel-data laptop-detect wamerican sharutils \
2525
nano util-linux-locales krb5-locales
2626

0 commit comments

Comments
 (0)