Skip to content

Commit 66f5ecf

Browse files
committed
Merge branch '4.13'
2 parents da865f0 + 809dc33 commit 66f5ecf

4 files changed

Lines changed: 13 additions & 41 deletions

File tree

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@
192192
import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer;
193193
import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
194194
import com.cloud.configuration.Resource.ResourceType;
195-
import com.cloud.dc.DataCenter.NetworkType;
196195
import com.cloud.dc.Vlan;
197196
import com.cloud.exception.CloudException;
198197
import com.cloud.exception.InternalErrorException;
@@ -6448,16 +6447,6 @@ private static HostStatsEntry getHyperHostStats(VmwareHypervisorHost hyperHost)
64486447

64496448
private static String getRouterSshControlIp(NetworkElementCommand cmd) {
64506449
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
6451-
String routerGuestIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP);
6452-
String zoneNetworkType = cmd.getAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE);
6453-
6454-
if (routerGuestIp != null && zoneNetworkType != null && NetworkType.valueOf(zoneNetworkType) == NetworkType.Basic) {
6455-
if (s_logger.isDebugEnabled())
6456-
s_logger.debug("In Basic zone mode, use router's guest IP for SSH control. guest IP : " + routerGuestIp);
6457-
6458-
return routerGuestIp;
6459-
}
6460-
64616450
if (s_logger.isDebugEnabled())
64626451
s_logger.debug("Use router's private IP for SSH control. IP : " + routerIp);
64636452
return routerIp;

server/src/main/java/com/cloud/network/guru/ControlNetworkGuru.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,11 @@ public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, De
138138
// we have to get management/private ip for the control nic for vmware/hyperv due ssh issues.
139139
HypervisorType hType = vm.getHypervisorType();
140140
if (((hType == HypervisorType.VMware) || (hType == HypervisorType.Hyperv)) && isRouterVm(vm)) {
141-
if (dest.getDataCenter().getNetworkType() != NetworkType.Basic) {
142-
super.reserve(nic, config, vm, dest, context);
141+
super.reserve(nic, config, vm, dest, context);
143142

144-
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
145-
nic.setMacAddress(mac);
146-
return;
147-
} else {
148-
// in basic mode and in VMware case, control network will be shared with guest network
149-
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
150-
nic.setMacAddress(mac);
151-
nic.setIPv4Address("0.0.0.0");
152-
nic.setIPv4Netmask("0.0.0.0");
153-
nic.setFormat(AddressFormat.Ip4);
154-
nic.setIPv4Gateway("0.0.0.0");
155-
return;
156-
}
143+
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
144+
nic.setMacAddress(mac);
145+
return;
157146
}
158147

159148
String ip = _dcDao.allocateLinkLocalIpAddress(dest.getDataCenter().getId(), dest.getPod().getId(), nic.getId(), context.getReservationId());

server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,11 @@ public boolean finalizeVirtualMachineProfile(final VirtualMachineProfile profile
20372037

20382038
if (dc.getNetworkType() == NetworkType.Basic) {
20392039
// ask domR to setup SSH on guest network
2040-
buf.append(" sshonguest=true");
2040+
if (profile.getHypervisorType() == HypervisorType.VMware) {
2041+
buf.append(" sshonguest=false");
2042+
} else {
2043+
buf.append(" sshonguest=true");
2044+
}
20412045
}
20422046

20432047
}
@@ -2395,19 +2399,9 @@ protected NicProfile getControlNic(final VirtualMachineProfile profile) {
23952399
final DomainRouterVO router = _routerDao.findById(profile.getId());
23962400
final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
23972401
NicProfile controlNic = null;
2398-
if (profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType() == NetworkType.Basic) {
2399-
// TODO this is a ugly to test hypervisor type here
2400-
// for basic network mode, we will use the guest NIC for control NIC
2401-
for (final NicProfile nic : profile.getNics()) {
2402-
if (nic.getTrafficType() == TrafficType.Guest && nic.getIPv4Address() != null) {
2403-
controlNic = nic;
2404-
}
2405-
}
2406-
} else {
2407-
for (final NicProfile nic : profile.getNics()) {
2408-
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
2409-
controlNic = nic;
2410-
}
2402+
for (final NicProfile nic : profile.getNics()) {
2403+
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
2404+
controlNic = nic;
24112405
}
24122406
}
24132407
return controlNic;

utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static String checkTemplateFormat(String path, String uripath) {
5858
return "";
5959
}
6060
// raw
61-
if ((output.contains("x86 boot") || output.contains("data")) && (isCorrectExtension(uripath, "raw"))) {
61+
if ((output.contains("x86 boot") || output.contains("DOS/MBR boot sector") || output.contains("data")) && (isCorrectExtension(uripath, "raw") || isCorrectExtension(uripath, "img"))) {
6262
s_logger.debug("File at path " + path + " looks like a raw image :" + output);
6363
return "";
6464
}

0 commit comments

Comments
 (0)