Merge branch '4.13'

This commit is contained in:
Daan Hoogland 2020-03-28 19:30:17 +01:00
commit 66f5ecf908
4 changed files with 13 additions and 41 deletions

View File

@ -192,7 +192,6 @@ import com.cloud.agent.resource.virtualnetwork.VRScripts;
import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer;
import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
import com.cloud.configuration.Resource.ResourceType;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.Vlan;
import com.cloud.exception.CloudException;
import com.cloud.exception.InternalErrorException;
@ -6448,16 +6447,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
private static String getRouterSshControlIp(NetworkElementCommand cmd) {
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
String routerGuestIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP);
String zoneNetworkType = cmd.getAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE);
if (routerGuestIp != null && zoneNetworkType != null && NetworkType.valueOf(zoneNetworkType) == NetworkType.Basic) {
if (s_logger.isDebugEnabled())
s_logger.debug("In Basic zone mode, use router's guest IP for SSH control. guest IP : " + routerGuestIp);
return routerGuestIp;
}
if (s_logger.isDebugEnabled())
s_logger.debug("Use router's private IP for SSH control. IP : " + routerIp);
return routerIp;

View File

@ -138,22 +138,11 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
// we have to get management/private ip for the control nic for vmware/hyperv due ssh issues.
HypervisorType hType = vm.getHypervisorType();
if (((hType == HypervisorType.VMware) || (hType == HypervisorType.Hyperv)) && isRouterVm(vm)) {
if (dest.getDataCenter().getNetworkType() != NetworkType.Basic) {
super.reserve(nic, config, vm, dest, context);
super.reserve(nic, config, vm, dest, context);
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
nic.setMacAddress(mac);
return;
} else {
// in basic mode and in VMware case, control network will be shared with guest network
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
nic.setMacAddress(mac);
nic.setIPv4Address("0.0.0.0");
nic.setIPv4Netmask("0.0.0.0");
nic.setFormat(AddressFormat.Ip4);
nic.setIPv4Gateway("0.0.0.0");
return;
}
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
nic.setMacAddress(mac);
return;
}
String ip = _dcDao.allocateLinkLocalIpAddress(dest.getDataCenter().getId(), dest.getPod().getId(), nic.getId(), context.getReservationId());

View File

@ -2037,7 +2037,11 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
if (dc.getNetworkType() == NetworkType.Basic) {
// ask domR to setup SSH on guest network
buf.append(" sshonguest=true");
if (profile.getHypervisorType() == HypervisorType.VMware) {
buf.append(" sshonguest=false");
} else {
buf.append(" sshonguest=true");
}
}
}
@ -2395,19 +2399,9 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
final DomainRouterVO router = _routerDao.findById(profile.getId());
final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
NicProfile controlNic = null;
if (profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType() == NetworkType.Basic) {
// TODO this is a ugly to test hypervisor type here
// for basic network mode, we will use the guest NIC for control NIC
for (final NicProfile nic : profile.getNics()) {
if (nic.getTrafficType() == TrafficType.Guest && nic.getIPv4Address() != null) {
controlNic = nic;
}
}
} else {
for (final NicProfile nic : profile.getNics()) {
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
controlNic = nic;
}
for (final NicProfile nic : profile.getNics()) {
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
controlNic = nic;
}
}
return controlNic;

View File

@ -58,7 +58,7 @@ public class ImageStoreUtil {
return "";
}
// raw
if ((output.contains("x86 boot") || output.contains("data")) && (isCorrectExtension(uripath, "raw"))) {
if ((output.contains("x86 boot") || output.contains("DOS/MBR boot sector") || output.contains("data")) && (isCorrectExtension(uripath, "raw") || isCorrectExtension(uripath, "img"))) {
s_logger.debug("File at path " + path + " looks like a raw image :" + output);
return "";
}